PHP 클래스 App\Services\Access\Access

파일 보기 프로젝트 열기: rappasoft/laravel-5-boilerplate 1 사용 예제들

공개 메소드들

메소드 설명
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 ( )