PHP Class App\Services\Access\Access

Afficher le fichier Open project: rappasoft/laravel-5-boilerplate Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

allow() public méthode

Check if the current user has a permission by its name or id
public allow ( string $permission ) : boolean
$permission string Permission name or id.
Résultat boolean

allowMultiple() public méthode

Check an array of permissions and whether or not all are required to continue
public allowMultiple ( $permissions, $needsAll = false ) : boolean
$permissions
$needsAll
Résultat boolean

guest() public méthode

Return if the current session user is a guest or not
public guest ( ) : mixed
Résultat mixed

hasPermission() public méthode

public hasPermission ( $permission ) : boolean
$permission
Résultat boolean

hasPermissions() public méthode

public hasPermissions ( $permissions, $needsAll = false ) : boolean
$permissions
$needsAll
Résultat boolean

hasRole() public méthode

Checks if the current user has a Role by its name or id
public hasRole ( string $role ) : boolean
$role string Role name.
Résultat boolean

hasRoles() public méthode

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
Résultat boolean

id() public méthode

Get the currently authenticated user's id
public id ( ) : mixed
Résultat mixed

loginUsingId() public méthode

public loginUsingId ( $id ) : mixed
$id
Résultat mixed

logout() public méthode

public logout ( ) : mixed
Résultat mixed

user() public méthode

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