PHP Трейт Artesaos\Defender\Traits\HasDefender

Наследование: use trait Artesaos\Defender\Traits\Users\HasRoles, use trait Artesaos\Defender\Traits\Users\HasPermissions
Показать файл Открыть проект

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

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