PHP 클래스 BookStack\Repos\PermissionsRepo

파일 보기 프로젝트 열기: ssddanbrown/bookstack

보호된 프로퍼티들

프로퍼티 타입 설명
$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