PHP 트레잇 Artesaos\Defender\Traits\HasDefender

상속: use trait Artesaos\Defender\Traits\Users\HasRoles, use trait Artesaos\Defender\Traits\Users\HasPermissions
파일 보기 프로젝트 열기: artesaos/defender

공개 메소드들

메소드 설명
canDo ( string $permission, boolean $force = false ) : boolean Checks for permission If has superuser group automatically passes.
findById ( integer $id ) : Artesaos\Defender\Contracts\User Find a user by its id.
getAllPermissions ( boolean $force = false ) : Collection Retrieve all user permissions.
getRolesPermissions ( boolean $force = false ) : Collection Get permissions from database based on roles.
hasPermission ( string $permission, boolean $force = false ) : boolean Returns if the current user has the given permission.
hasPermissions ( array $permissions, boolean $strict = true, boolean $force = false ) : boolean Returns if the current user has all or one permission of the given array.
isSuperUser ( ) : boolean check has superuser role.
roleHasPermission ( string $permission, boolean $force = false ) : boolean Check if the user has the given permission using only his roles.

보호된 메소드들

메소드 설명
getFreshAllPermissions ( ) : Collection Get fresh permissions from database.
getFreshRolesPermissions ( ) : Collection Get fresh permissions from database based on roles.

메소드 상세

canDo() 공개 메소드

Checks for permission If has superuser group automatically passes.
public canDo ( string $permission, boolean $force = false ) : boolean
$permission string
$force boolean
리턴 boolean

findById() 공개 메소드

Find a user by its id.
public findById ( integer $id ) : Artesaos\Defender\Contracts\User
$id integer
리턴 Artesaos\Defender\Contracts\User

getAllPermissions() 공개 메소드

Retrieve all user permissions.
public getAllPermissions ( boolean $force = false ) : Collection
$force boolean
리턴 Illuminate\Support\Collection

getFreshAllPermissions() 보호된 메소드

Get fresh permissions from database.
protected getFreshAllPermissions ( ) : Collection
리턴 Illuminate\Support\Collection

getFreshRolesPermissions() 보호된 메소드

Get fresh permissions from database based on roles.
protected getFreshRolesPermissions ( ) : Collection
리턴 Illuminate\Support\Collection

getRolesPermissions() 공개 메소드

Get permissions from database based on roles.
public getRolesPermissions ( boolean $force = false ) : Collection
$force boolean
리턴 Illuminate\Support\Collection

hasPermission() 공개 메소드

User permissions override role permissions.
public hasPermission ( string $permission, boolean $force = false ) : boolean
$permission string
$force boolean
리턴 boolean

hasPermissions() 공개 메소드

User permissions override role permissions.
public hasPermissions ( array $permissions, boolean $strict = true, boolean $force = false ) : boolean
$permissions array Array of permissions
$strict boolean Check if has all permissions from array or one of them
$force boolean
리턴 boolean

isSuperUser() 공개 메소드

check has superuser role.
public isSuperUser ( ) : boolean
리턴 boolean

roleHasPermission() 공개 메소드

Check if the user has the given permission using only his roles.
public roleHasPermission ( string $permission, boolean $force = false ) : boolean
$permission string
$force boolean
리턴 boolean