PHP Interface Silber\Bouncer\Contracts\Clipboard

Show file Open project: JosephSilber/bouncer Interface Usage Examples

Public Methods

Method Description
check ( Model $authority, string $ability, Model | string | null $model = null ) : boolean Determine if the given authority has the given ability.
checkRole ( Model $authority, array | string $roles, string $boolean = 'or' ) : boolean Check if an authority has the given roles.
getAbilities ( Model $authority, boolean $allowed = true ) : Illuminate\Database\Eloquent\Collection Get a list of the authority's abilities.
getForbiddenAbilities ( Model $authority ) : Illuminate\Database\Eloquent\Collection Get a list of the authority's forbidden abilities.
getRoles ( Model $authority ) : Collection Get the given authority's roles.
registerAt ( Illuminate\Contracts\Auth\Access\Gate $gate ) : void Register the clipboard at the given gate.

Method Details

check() public method

Determine if the given authority has the given ability.
public check ( Model $authority, string $ability, Model | string | null $model = null ) : boolean
$authority Illuminate\Database\Eloquent\Model
$ability string
$model Illuminate\Database\Eloquent\Model | string | null
return boolean

checkRole() public method

Check if an authority has the given roles.
public checkRole ( Model $authority, array | string $roles, string $boolean = 'or' ) : boolean
$authority Illuminate\Database\Eloquent\Model
$roles array | string
$boolean string
return boolean

getAbilities() public method

Get a list of the authority's abilities.
public getAbilities ( Model $authority, boolean $allowed = true ) : Illuminate\Database\Eloquent\Collection
$authority Illuminate\Database\Eloquent\Model
$allowed boolean
return Illuminate\Database\Eloquent\Collection

getForbiddenAbilities() public method

Get a list of the authority's forbidden abilities.
public getForbiddenAbilities ( Model $authority ) : Illuminate\Database\Eloquent\Collection
$authority Illuminate\Database\Eloquent\Model
return Illuminate\Database\Eloquent\Collection

getRoles() public method

Get the given authority's roles.
public getRoles ( Model $authority ) : Collection
$authority Illuminate\Database\Eloquent\Model
return Illuminate\Support\Collection

registerAt() public method

Register the clipboard at the given gate.
public registerAt ( Illuminate\Contracts\Auth\Access\Gate $gate ) : void
$gate Illuminate\Contracts\Auth\Access\Gate
return void