def get_privileges(self, role_id): if self.privileges is None: roles, privileges = adm_server.get_roles(self.admin) if self.task: self.task.roles = roles self.privileges = privileges return self.privileges[role_id]
def get_privileges(self, role_id): if self.privileges is None: roles, privileges = adm_server.get_roles(self.admin) self.privileges = privileges try: result = self.privileges[role_id] except: result = {} return result