Exemplo n.º 1
0
 def permissions(self):
   if self.permissions_json == DECLARED_ROLE:
     declared_role = get_declared_role(self.name)
     permissions = declared_role.permissions
   else:
     permissions = json.loads(self.permissions_json) or {}
   # make sure not to omit actions
   for action in ['create', 'read', 'update', 'delete']:
     if action not in permissions:
       permissions[action] = []
   return permissions
Exemplo n.º 2
0
 def permissions(self):
     if self.permissions_json == DECLARED_ROLE:
         declared_role = get_declared_role(self.name)
         permissions = declared_role.permissions
     else:
         permissions = json.loads(self.permissions_json) or {}
     # make sure not to omit actions
     for action in ['create', 'read', 'update', 'delete']:
         if action not in permissions:
             permissions[action] = []
     return permissions