From 13c97211905a5c04c0aa7f9bd6f79cd2c980ab25 Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 14 Apr 2017 14:36:17 -0700 Subject: [PATCH] Users with administrator can execute all permissions This isn't totally true because of heiarchy, but we can think about how to handle that later as it requires interface changes. --- disco/types/permissions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/disco/types/permissions.py b/disco/types/permissions.py index 6e4d9f3..6157bd9 100644 --- a/disco/types/permissions.py +++ b/disco/types/permissions.py @@ -40,6 +40,10 @@ class PermissionValue(object): self.value = value def can(self, *perms): + # Administrator permission overwrites all others + if self.administrator: + return True + for perm in perms: if isinstance(perm, EnumAttr): perm = perm.value