Better store check when trying to add a group to a user (from user panel)

### What does it do ?

Make better check when adding a group to a user (from the user panel > access permission tab).
In addition, it sets the group rank, assuming each group already bound to the user has a valid rank (+1 incremented)

### Why is it needed ?

The current method makes use of some RegEx, resulting in faulty results (see issue mentioned down below).

### Related issue(s)/PR(s)

* #11399