0
0
Fork 0

Add support for editing labelling of one's own role (#18812)

Still disallow edition of rank or permissions
This commit is contained in:
Claire 2022-07-17 13:37:30 +02:00 committed by GitHub
parent 05e39dc619
commit ecb3bb3256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 11 deletions

View file

@ -10,7 +10,7 @@ class UserRolePolicy < ApplicationPolicy
end
def update?
role.can?(:manage_roles) && role.overrides?(record)
role.can?(:manage_roles) && (role.overrides?(record) || role.id == record.id)
end
def destroy?