trait HasRole

Traits

Methods

roleModel()

Make a role model

Model
permissionModel()

Make permission model

mixed
assignRole($role)

Assign the given role to the user

bool
hasRole($role)

Determine if the user has the given role

bool
hasPermission($permission)

Determine if the user can perform a given action

Collection
roles()

Get roles for current user

Details

in MakeRoleModel at line 14
roleModel()

Make a role model

Exceptions

Exception

in MakePermissionModel at line 15
Model permissionModel()

Make permission model

Return Value

Model

Exceptions

Exception

at line 26
mixed assignRole($role)

Assign the given role to the user

Parameters

$role string

Return Value

mixed

at line 49
bool hasRole($role)

Determine if the user has the given role

Parameters

$role mixed

Return Value

bool

at line 64
bool hasPermission($permission)

Determine if the user can perform a given action

Parameters

$permission mixed

Return Value

bool

at line 87
Collection roles()

Get roles for current user

Return Value

Collection