You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In typical user management CRUD apps, it's a common case to have to remove users from a group or add them to them - it would be easier if we could do this like so:
$user->changeGroups($_POST['groups']);
Right now, we have to:
Get group IDs from a form
Compare with current group IDs on a user
Revoke any that no longer appear in data from form
Add any new ones that appear in data from form
This is, for obvious reasons, incredibly impractical.
I suggest implementing a new changeGroups method which would remove ALL groups from a user, and at the same time add those we're feeding it. The method should be wrapped in a transaction in order to be safe against failures and leaving a user without groups should something break mid-way.
The text was updated successfully, but these errors were encountered:
In typical user management CRUD apps, it's a common case to have to remove users from a group or add them to them - it would be easier if we could do this like so:
Right now, we have to:
This is, for obvious reasons, incredibly impractical.
I suggest implementing a new
changeGroups
method which would remove ALL groups from a user, and at the same time add those we're feeding it. The method should be wrapped in a transaction in order to be safe against failures and leaving a user without groups should something break mid-way.The text was updated successfully, but these errors were encountered: