(cls, permission_list)
return permissions
Converts a list of Permission objects into a Permissions object
Converts a list of Permission objects into a Permissions object
Converts a list of Permission objects into a Permissions object
def from_permission_list(cls, permission_list):
        """Converts a list of Permission objects into a Permissions object"""
        permissions = Permissions.min()
        for perm in permission_list:
            setattr(permissions, perm.name, perm.allow_all)
            if perm.name in PARAMETERIZED_PERMISSIONS:
                setattr(permissions, PARAMETERIZED_PERMISSIONS[perm.name], list(perm.allowed_items))
        return permissions
def from_permission_list ( cls , permission_list ) : permissions = Permissions . min ( ) for perm in permission_list : setattr ( permissions , perm . name , perm . allow_all ) if perm . name in PARAMETERIZED_PERMISSIONS : setattr ( permissions , PARAMETERIZED_PERMISSIONS [ perm . name ] , list ( perm . allowed_items ) ) return permissions