PHP Класс ZfcRbac\Service\AuthorizationService

Автор: Michaël Gallego ([email protected])
Наследование: implements ZfcRbac\Service\AuthorizationServiceInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$assertionPluginManager ZfcRbac\Assertion\AssertionPluginManager
$assertions array
$rbac Rbac\Rbac
$roleService RoleService

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

Метод Описание
__construct ( Rbac\Rbac $rbac, RoleService $roleService, AssertionPluginManager $assertionPluginManager ) Constructor
getIdentity ( ) : ZfcRbac\Identity\IdentityInterface | null Get the current identity from the role service
hasAssertion ( string | Rbac\Permission\PermissionInterface $permission ) : boolean Checks if a assertion exists
isGranted ( string | Rbac\Permission\PermissionInterface $permission, mixed $context = null ) : boolean Check if the permission is granted to the current identity
setAssertion ( string | Rbac\Permission\PermissionInterface $permission, string | callable | ZfcRbac\Assertion\AssertionInterface $assertion ) : void Set an assertion
setAssertions ( array $assertions ) : void Set assertions

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

Метод Описание
assert ( string | callable | ZfcRbac\Assertion\AssertionInterface $assertion, mixed $context = null ) : boolean

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

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

Constructor
public __construct ( Rbac\Rbac $rbac, RoleService $roleService, AssertionPluginManager $assertionPluginManager )
$rbac Rbac\Rbac
$roleService RoleService
$assertionPluginManager ZfcRbac\Assertion\AssertionPluginManager

assert() защищенный метод

protected assert ( string | callable | ZfcRbac\Assertion\AssertionInterface $assertion, mixed $context = null ) : boolean
$assertion string | callable | ZfcRbac\Assertion\AssertionInterface
$context mixed
Результат boolean

getIdentity() публичный метод

Get the current identity from the role service
public getIdentity ( ) : ZfcRbac\Identity\IdentityInterface | null
Результат ZfcRbac\Identity\IdentityInterface | null

hasAssertion() публичный метод

Checks if a assertion exists
public hasAssertion ( string | Rbac\Permission\PermissionInterface $permission ) : boolean
$permission string | Rbac\Permission\PermissionInterface
Результат boolean

isGranted() публичный метод

Check if the permission is granted to the current identity
public isGranted ( string | Rbac\Permission\PermissionInterface $permission, mixed $context = null ) : boolean
$permission string | Rbac\Permission\PermissionInterface
$context mixed
Результат boolean

setAssertion() публичный метод

Set an assertion
public setAssertion ( string | Rbac\Permission\PermissionInterface $permission, string | callable | ZfcRbac\Assertion\AssertionInterface $assertion ) : void
$permission string | Rbac\Permission\PermissionInterface
$assertion string | callable | ZfcRbac\Assertion\AssertionInterface
Результат void

setAssertions() публичный метод

Set assertions
public setAssertions ( array $assertions ) : void
$assertions array
Результат void

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

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

protected AssertionPluginManager,ZfcRbac\Assertion $assertionPluginManager
Результат ZfcRbac\Assertion\AssertionPluginManager

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

protected array $assertions
Результат array

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

protected Rbac,Rbac $rbac
Результат Rbac\Rbac

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

protected RoleService,ZfcRbac\Service $roleService
Результат RoleService