Don't let user delete roles to which they belong, without permission
This commit is contained in:
parent
edd48ef667
commit
964671fcbf
|
@ -100,6 +100,12 @@ class RolesView(PrincipalMasterView):
|
||||||
return False
|
return False
|
||||||
if role is guest_role(self.Session()):
|
if role is guest_role(self.Session()):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# current user can delete their own roles, only if they have permission
|
||||||
|
user = self.request.user
|
||||||
|
if user and role in user.roles:
|
||||||
|
return self.has_perm('edit_my')
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def unique_name(self, node, value):
|
def unique_name(self, node, value):
|
||||||
|
|
Loading…
Reference in a new issue