PHP Class Silber\Bouncer\Database\Queries\Abilities

Afficher le fichier Open project: JosephSilber/bouncer

Méthodes publiques

Méthode Description
getForAuthority ( Model $authority, boolean $allowed = true ) : Illuminate\Database\Eloquent\Collection Get a list of the authority's abilities.

Méthodes protégées

Méthode Description
addRoleInheritCondition ( Builder $query, Model $authority, string $roles ) : Closure Add the role inheritence "where" clause to the given query.
getAuthorityConstraint ( Model $authority, boolean $allowed ) : Closure Get a constraint for abilities that have been granted to the given authority.
getAuthorityRoleConstraint ( Model $authority ) : Closure Get a constraint for roles that are assigned to the given authority.
getRoleConstraint ( Model $authority, boolean $allowed ) : Closure Get a constraint for abilities that have been granted to the given authority through a role.

Method Details

addRoleInheritCondition() protected méthode

Add the role inheritence "where" clause to the given query.
protected addRoleInheritCondition ( Builder $query, Model $authority, string $roles ) : Closure
$query Illuminate\Database\Query\Builder
$authority Illuminate\Database\Eloquent\Model
$roles string
Résultat Closure

getAuthorityConstraint() protected méthode

Get a constraint for abilities that have been granted to the given authority.
protected getAuthorityConstraint ( Model $authority, boolean $allowed ) : Closure
$authority Illuminate\Database\Eloquent\Model
$allowed boolean
Résultat Closure

getAuthorityRoleConstraint() protected méthode

Get a constraint for roles that are assigned to the given authority.
protected getAuthorityRoleConstraint ( Model $authority ) : Closure
$authority Illuminate\Database\Eloquent\Model
Résultat Closure

getForAuthority() public méthode

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

getRoleConstraint() protected méthode

Get a constraint for abilities that have been granted to the given authority through a role.
protected getRoleConstraint ( Model $authority, boolean $allowed ) : Closure
$authority Illuminate\Database\Eloquent\Model
$allowed boolean
Résultat Closure