mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Added interface for adding/removing roles in entity perms.
This commit is contained in:
@ -15,16 +15,15 @@ class PermissionFormData
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the roles with permissions assigned.
|
||||
* Get the permissions with assigned roles.
|
||||
*/
|
||||
public function rolesWithPermissions(): array
|
||||
public function permissionsWithRoles(): array
|
||||
{
|
||||
return $this->entity->permissions()
|
||||
->with('role')
|
||||
->where('role_id', '!=', 0)
|
||||
->get(['id', 'role_id'])
|
||||
->pluck('role')
|
||||
->sortBy('display_name')
|
||||
->get()
|
||||
->sortBy('role.display_name')
|
||||
->all();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user