PHP Class BookStack\Repos\PermissionsRepo

Afficher le fichier Open project: ssddanbrown/bookstack

Protected Properties

Свойство Type Description
$permission
$permissionService
$role
$systemRoles

Méthodes publiques

Méthode Description
__construct ( RolePermission $permission, Role $role, PermissionService $permissionService ) PermissionsRepo constructor.
assignRolePermissions ( Role $role, array $permissionNameArray = [] ) Assign an list of permission names to an role.
deleteRole ( $roleId, $migrateRoleId ) Delete a role from the system.
getAllRoles ( ) : Illuminate\Database\Eloquent\Collection | static[] Get all the user roles from the system.
getAllRolesExcept ( Role $role ) : mixed Get all the roles except for the provided one.
getRoleById ( $id ) : mixed Get a role via its ID.
saveNewRole ( array $roleData ) : Role Save a new role into the system.
updateRole ( $roleId, $roleData ) Updates an existing role.

Method Details

__construct() public méthode

PermissionsRepo constructor.
public __construct ( RolePermission $permission, Role $role, PermissionService $permissionService )
$permission BookStack\RolePermission
$role BookStack\Role
$permissionService BookStack\Services\PermissionService

assignRolePermissions() public méthode

Assign an list of permission names to an role.
public assignRolePermissions ( Role $role, array $permissionNameArray = [] )
$role BookStack\Role
$permissionNameArray array

deleteRole() public méthode

Check it's not an admin role or set as default before deleting. If an migration Role ID is specified the users assign to the current role will be added to the role of the specified id.
public deleteRole ( $roleId, $migrateRoleId )
$roleId
$migrateRoleId

getAllRoles() public méthode

Get all the user roles from the system.
public getAllRoles ( ) : Illuminate\Database\Eloquent\Collection | static[]
Résultat Illuminate\Database\Eloquent\Collection | static[]

getAllRolesExcept() public méthode

Get all the roles except for the provided one.
public getAllRolesExcept ( Role $role ) : mixed
$role BookStack\Role
Résultat mixed

getRoleById() public méthode

Get a role via its ID.
public getRoleById ( $id ) : mixed
$id
Résultat mixed

saveNewRole() public méthode

Save a new role into the system.
public saveNewRole ( array $roleData ) : Role
$roleData array
Résultat BookStack\Role

updateRole() public méthode

Ensure Admin role always has all permissions.
public updateRole ( $roleId, $roleData )
$roleId
$roleData

Property Details

$permission protected_oe property

protected $permission

$permissionService protected_oe property

protected $permissionService

$role protected_oe property

protected $role

$systemRoles protected_oe property

protected $systemRoles