PHP Class Caffeinated\Shinobi\Shinobi

显示文件 Open project: caffeinated/shinobi Class Usage Examples

Protected Properties

Property Type Description
$auth Illuminate\Contracts\Auth\Guard

Public Methods

Method Description
__construct ( Illuminate\Contracts\Auth\Guard $auth ) Create a new UserHasPermission instance.
can ( array | string $permissions ) : boolean Checks if user has the given permissions.
canAtLeast ( array $permissions ) : boolean Checks if user has at least one of the given permissions.
isRole ( $role ) : boolean Checks if user is assigned the given role.

Method Details

__construct() public method

Create a new UserHasPermission instance.
public __construct ( Illuminate\Contracts\Auth\Guard $auth )
$auth Illuminate\Contracts\Auth\Guard

can() public method

Checks if user has the given permissions.
public can ( array | string $permissions ) : boolean
$permissions array | string
return boolean

canAtLeast() public method

Checks if user has at least one of the given permissions.
public canAtLeast ( array $permissions ) : boolean
$permissions array
return boolean

isRole() public method

Checks if user is assigned the given role.
public isRole ( $role ) : boolean
return boolean

Property Details

$auth protected_oe property

protected Guard,Illuminate\Contracts\Auth $auth
return Illuminate\Contracts\Auth\Guard