PHP Класс Silber\Bouncer\Conductors\AssignsRole

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$role Silber\Bouncer\Database\Role | string The role to be assigned to an authority.

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

Метод Описание
__construct ( Role | string $role ) Constructor.
to ( Model | array | integer $authority ) : boolean Assign the role to the given authority.

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

Метод Описание
assignRole ( Role $role, string $class, array $keys ) : void Assign the role to the authorities with the given keys.
getAuthoritiesWithRole ( Role $role, string $class, array $ids ) : Collection Get the keys of the authorities that already have the given role.
role ( ) : Role Get or create the role.

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

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

Constructor.
public __construct ( Role | string $role )
$role Silber\Bouncer\Database\Role | string

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

Assign the role to the authorities with the given keys.
protected assignRole ( Role $role, string $class, array $keys ) : void
$role Silber\Bouncer\Database\Role
$class string
$keys array
Результат void

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

Get the keys of the authorities that already have the given role.
protected getAuthoritiesWithRole ( Role $role, string $class, array $ids ) : Collection
$role Silber\Bouncer\Database\Role
$class string
$ids array
Результат Illuminate\Support\Collection

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

Get or create the role.
protected role ( ) : Role
Результат Silber\Bouncer\Database\Role

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

Assign the role to the given authority.
public to ( Model | array | integer $authority ) : boolean
$authority Illuminate\Database\Eloquent\Model | array | integer
Результат boolean

Описание свойств

$role защищенное свойство

The role to be assigned to an authority.
protected Role,Silber\Bouncer\Database|string $role
Результат Silber\Bouncer\Database\Role | string