PHP Класс Silber\Bouncer\Clipboard

Наследование: use trait Illuminate\Auth\Access\HandlesAuthorization
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
checkGetId ( Model $authority, string $ability, Model | string | null $model = null ) : integer | boolean | null Determine if the given authority has the given ability, and return the ability ID.
compileAbilityIdentifiers ( string $ability, Model | string | null $model ) : Collection Compile a list of ability identifiers that match the provided parameters.
compileModelAbilityIdentifiers ( string $ability, Model | string $model ) : array Compile a list of ability identifiers that match the given model.
findMatchingAbility ( Collection $abilities, Collection $applicable, Model $model, Model $authority ) : integer | null Determine if any of the abilities can be matched against the provided applicable ones.
getMatchedAbilityId ( Collection $abilityMap, Collection $applicable ) : integer | null Get the ID of the ability that matches one of the applicable abilities.
parseGateArguments ( mixed $arguments, mixed $additional ) : array Parse the arguments we got from the gate.

Описание методов

check() публичный Метод

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
Результат boolean

checkGetId() защищенный Метод

Determine if the given authority has the given ability, and return the ability ID.
protected checkGetId ( Model $authority, string $ability, Model | string | null $model = null ) : integer | boolean | null
$authority Illuminate\Database\Eloquent\Model
$ability string
$model Illuminate\Database\Eloquent\Model | string | null
Результат integer | boolean | null

checkRole() публичный Метод

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
Результат boolean

compileAbilityIdentifiers() защищенный Метод

Compile a list of ability identifiers that match the provided parameters.
protected compileAbilityIdentifiers ( string $ability, Model | string | null $model ) : Collection
$ability string
$model Illuminate\Database\Eloquent\Model | string | null
Результат Illuminate\Support\Collection

compileModelAbilityIdentifiers() защищенный Метод

Compile a list of ability identifiers that match the given model.
protected compileModelAbilityIdentifiers ( string $ability, Model | string $model ) : array
$ability string
$model Illuminate\Database\Eloquent\Model | string
Результат array

findMatchingAbility() защищенный Метод

Determine if any of the abilities can be matched against the provided applicable ones.
protected findMatchingAbility ( Collection $abilities, Collection $applicable, Model $model, Model $authority ) : integer | null
$abilities Illuminate\Support\Collection
$applicable Illuminate\Support\Collection
$model Illuminate\Database\Eloquent\Model
$authority Illuminate\Database\Eloquent\Model
Результат integer | null

getAbilities() публичный Метод

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
Результат Illuminate\Database\Eloquent\Collection

getForbiddenAbilities() публичный Метод

Get a list of the authority's forbidden abilities.
public getForbiddenAbilities ( Model $authority ) : Illuminate\Database\Eloquent\Collection
$authority Illuminate\Database\Eloquent\Model
Результат Illuminate\Database\Eloquent\Collection

getMatchedAbilityId() защищенный Метод

Get the ID of the ability that matches one of the applicable abilities.
protected getMatchedAbilityId ( Collection $abilityMap, Collection $applicable ) : integer | null
$abilityMap Illuminate\Support\Collection
$applicable Illuminate\Support\Collection
Результат integer | null

getRoles() публичный Метод

Get the given authority's roles.
public getRoles ( Model $authority ) : Collection
$authority Illuminate\Database\Eloquent\Model
Результат Illuminate\Support\Collection

parseGateArguments() защищенный Метод

Parse the arguments we got from the gate.
protected parseGateArguments ( mixed $arguments, mixed $additional ) : array
$arguments mixed
$additional mixed
Результат array

registerAt() публичный Метод

Register the clipboard at the given gate.
public registerAt ( Illuminate\Contracts\Auth\Access\Gate $gate ) : void
$gate Illuminate\Contracts\Auth\Access\Gate
Результат void