def __getattr__(self, permission): permission = Permission.by_name(permission) if permission and self.permissions: return is_in_list(permission.key(), self.permissions) return False
def has_permission(self, permission): return is_in_list(Permission.by_name(permission).key(), self.permissions)