PHP Class Silber\Bouncer\Clipboard

Inheritance: use trait Illuminate\Auth\Access\HandlesAuthorization
Afficher le fichier Open project: JosephSilber/bouncer Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
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.

Method Details

check() public méthode

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
Résultat boolean

checkGetId() protected méthode

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
Résultat integer | boolean | null

checkRole() public méthode

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
Résultat boolean

compileAbilityIdentifiers() protected méthode

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
Résultat Illuminate\Support\Collection

compileModelAbilityIdentifiers() protected méthode

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
Résultat array

findMatchingAbility() protected méthode

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
Résultat integer | null

getAbilities() public méthode

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
Résultat Illuminate\Database\Eloquent\Collection

getForbiddenAbilities() public méthode

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

getMatchedAbilityId() protected méthode

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
Résultat integer | null

getRoles() public méthode

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

parseGateArguments() protected méthode

Parse the arguments we got from the gate.
protected parseGateArguments ( mixed $arguments, mixed $additional ) : array
$arguments mixed
$additional mixed
Résultat array

registerAt() public méthode

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