Bug #32213
closedchanging "admin" parameter of user-group with non-admin user is accepted but nothing changed
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1848981
Description of problem:
When trying to update "admin" parameter of user-group with non-admin user change is accepted, but nothing happen.
WebUI seems already prepared as when trying the same with non-admin user checkbox for Administrator is not visible
How reproducible: Always
Steps to Reproduce:
1. Create non-admin user with roles below
view_filters, create_filters, edit_filters, destroy_filters
view_usergroups, create_usergroups, edit_usergroups, destroy_usergroups view_roles, create_roles, edit_roles, destroy_roles
view_external_usergroups, create_external_usergroups, edit_external_usergroup, destroy_external_usergroups
view_bookmarks, create_bookmarks, edit_bookmarks, destroy_bookmarks
attach_subscriptions, unattach_subscriptions
escalate_roles
view_organizations
view_authenticators
2. Create new usergroup
3. Attempt to change "admin" parameter of user-group with hammer or API as below
- hammer --config /root/.hammer/non_admin_user_config.yml user-group update --id 1 --admin 1
or
- curl -X PUT -H "Content-Type: application/json" -u user:password -d \'{"admin": \'1\'}\' https://`hostname -f`/api/usergroups/1/
Actual results:
hammer: User group [group] updated.
API: {"admin":false,"created_at":"2020-06-16 14:10:11 UTC","updated_at":"2020-06-16 14:27:08 UTC","name":"group","id":1,"external_usergroups":[],"usergroups":[],"users":[],"roles":[]}
Expected results:
Not allowing operation with non-admin user and show warning message.'