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
The CX user views an admin user, and only sees the roles they are allowed to manage - no admin role, because they don't have permission to manage it (restricted here)
The CX changes a non-admin role, hits update
In the users_controller update action, we update the roles here (as part of the user update via params) and here (specifically setting the roles) - they both work the same way, replacing all the roles the user has with the ones that the admin user has selected.
But since we're replacing the roles, and the CX user didn't have access to see the admin roles, the admin user loses admin access (since the params did not include the admin role id) - and CX is none the wiser of the mistake!
This happened to me the other day and made me think I was in the process of being fired because I unexpectedly lost admin access. Please, for the sake of my heart, let's fix this! 😄
(also we should probably not update roles twice in the same action)
The text was updated successfully, but these errors were encountered:
When the current ability logged in assigned new roles to which they have
access to a user, other non-accessible roles were removed. We're now
ensuring that non-accessible roles are not touched.
It also fixes the roles being saved twice: once on the generic
`user#update` and a second on `#set_roles`. Now, that only happens in
the latter situation.
Fixessolidusio#4528
When the current ability logged in assigned new roles to which they have
access to a user, other non-accessible roles were removed. We're now
ensuring that non-accessible roles are not touched.
It also fixes the roles being saved twice: once on the generic
`user#update` and a second on `#set_roles`. Now, that only happens in
the latter situation.
Fixes#4528
Consider the following situation:
admin
role, because they don't have permission to manage it (restricted here)In the users_controller update action, we update the roles here (as part of the user update via params) and here (specifically setting the roles) - they both work the same way, replacing all the roles the user has with the ones that the admin user has selected.
But since we're replacing the roles, and the CX user didn't have access to see the admin roles, the admin user loses admin access (since the params did not include the admin role id) - and CX is none the wiser of the mistake!
This happened to me the other day and made me think I was in the process of being fired because I unexpectedly lost admin access. Please, for the sake of my heart, let's fix this! 😄
(also we should probably not update roles twice in the same action)
The text was updated successfully, but these errors were encountered: