PHP Класс BookStack\Repos\PermissionsRepo

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$permission
$permissionService
$role
$systemRoles

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный метод

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

assignRolePermissions() публичный метод

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

deleteRole() публичный метод

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() публичный метод

Get all the user roles from the system.
public getAllRoles ( ) : Illuminate\Database\Eloquent\Collection | static[]
Результат Illuminate\Database\Eloquent\Collection | static[]

getAllRolesExcept() публичный метод

Get all the roles except for the provided one.
public getAllRolesExcept ( Role $role ) : mixed
$role BookStack\Role
Результат mixed

getRoleById() публичный метод

Get a role via its ID.
public getRoleById ( $id ) : mixed
$id
Результат mixed

saveNewRole() публичный метод

Save a new role into the system.
public saveNewRole ( array $roleData ) : Role
$roleData array
Результат BookStack\Role

updateRole() публичный метод

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

Описание свойств

$permission защищенное свойство

protected $permission

$permissionService защищенное свойство

protected $permissionService

$role защищенное свойство

protected $role

$systemRoles защищенное свойство

protected $systemRoles