Grant superusers permission to decrypt all secrets

This commit is contained in:
Jeremy Stretch 2016-07-06 17:40:32 -04:00
parent 8d837979ff
commit 425776865a

View File

@ -304,4 +304,6 @@ class Secret(CreatedUpdatedModel):
"""
Check whether the given user has permission to decrypt this Secret.
"""
if user.is_superuser:
return True
return user in self.role.users.all() or user.groups.filter(pk__in=self.role.groups.all()).exists()