PHP Класс App\Services\Access\Access

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
allow ( string $permission ) : boolean Check if the current user has a permission by its name or id
allowMultiple ( $permissions, $needsAll = false ) : boolean Check an array of permissions and whether or not all are required to continue
guest ( ) : mixed Return if the current session user is a guest or not
hasPermission ( $permission ) : boolean
hasPermissions ( $permissions, $needsAll = false ) : boolean
hasRole ( string $role ) : boolean Checks if the current user has a Role by its name or id
hasRoles ( $roles, boolean $needsAll = false ) : boolean Checks if the user has either one or more, or all of an array of roles
id ( ) : mixed Get the currently authenticated user's id
loginUsingId ( $id ) : mixed
logout ( ) : mixed
user ( ) Get the currently authenticated user or null.

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

allow() публичный Метод

Check if the current user has a permission by its name or id
public allow ( string $permission ) : boolean
$permission string Permission name or id.
Результат boolean

allowMultiple() публичный Метод

Check an array of permissions and whether or not all are required to continue
public allowMultiple ( $permissions, $needsAll = false ) : boolean
$permissions
$needsAll
Результат boolean

guest() публичный Метод

Return if the current session user is a guest or not
public guest ( ) : mixed
Результат mixed

hasPermission() публичный Метод

public hasPermission ( $permission ) : boolean
$permission
Результат boolean

hasPermissions() публичный Метод

public hasPermissions ( $permissions, $needsAll = false ) : boolean
$permissions
$needsAll
Результат boolean

hasRole() публичный Метод

Checks if the current user has a Role by its name or id
public hasRole ( string $role ) : boolean
$role string Role name.
Результат boolean

hasRoles() публичный Метод

Checks if the user has either one or more, or all of an array of roles
public hasRoles ( $roles, boolean $needsAll = false ) : boolean
$roles
$needsAll boolean
Результат boolean

id() публичный Метод

Get the currently authenticated user's id
public id ( ) : mixed
Результат mixed

loginUsingId() публичный Метод

public loginUsingId ( $id ) : mixed
$id
Результат mixed

logout() публичный Метод

public logout ( ) : mixed
Результат mixed

user() публичный Метод

Get the currently authenticated user or null.
public user ( )