PHP Класс Neos\Flow\Security\Policy\PolicyService

The access decision voters get the roles and privileges configured (in the security policy) for a specific method invocation from this service.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$configurationManager Neos\Flow\Configuration\ConfigurationManager
$initialized boolean
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$policyConfiguration array
$privilegeTargets Neos\Flow\Security\Authorization\Privilege\PrivilegeTarget[]
$roles Role[]

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

Метод Описание
getAllPrivilegesByType ( string $type ) : array Returns all privileges of the given type
getPrivilegeTargetByIdentifier ( string $privilegeTargetIdentifier ) : PrivilegeTarget Returns the privilege target identified by the given string
getPrivilegeTargets ( ) : PrivilegeTarget[] Returns all configured privilege targets
getRole ( string $roleIdentifier ) : Role Returns a Role object configured in the PolicyService
getRoles ( boolean $includeAbstract = false ) : Role[] Returns an array of all configured roles
hasRole ( string $roleIdentifier ) : boolean Checks if a role exists
injectConfigurationManager ( ConfigurationManager $configurationManager ) : void This object is created very early so we can't rely on AOP for the property injection
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void This object is created very early so we can't rely on AOP for the property injection
reset ( ) : void Resets the PolicyService to behave transparently during functional testing.

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

Метод Описание
emitConfigurationLoaded ( array &$policyConfiguration ) : void Emits a signal when the policy configuration has been loaded
emitRolesInitialized ( array &$roles ) : void Emits a signal when roles have been initialized
initialize ( ) : void Parses the global policy configuration and initializes roles and privileges accordingly
initializePrivilegeTargets ( ) : void Initialized all configured privilege targets from the policy definitions

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

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

This signal can be used to add roles and/or privilegeTargets during runtime. In the slot make sure to receive the $policyConfiguration array by reference so you can alter it.
protected emitConfigurationLoaded ( array &$policyConfiguration ) : void
$policyConfiguration array The policy configuration
Результат void

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

This signal can be used to register roles during runtime. In the slot make sure to receive the $roles array by reference so you can alter it.
protected emitRolesInitialized ( array &$roles ) : void
$roles array
Результат void

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

Returns all privileges of the given type
public getAllPrivilegesByType ( string $type ) : array
$type string Full qualified class or interface name
Результат array

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

Returns the privilege target identified by the given string
public getPrivilegeTargetByIdentifier ( string $privilegeTargetIdentifier ) : PrivilegeTarget
$privilegeTargetIdentifier string Identifier of a privilege target
Результат Neos\Flow\Security\Authorization\Privilege\PrivilegeTarget

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

Returns all configured privilege targets
public getPrivilegeTargets ( ) : PrivilegeTarget[]
Результат Neos\Flow\Security\Authorization\Privilege\PrivilegeTarget[]

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

Returns a Role object configured in the PolicyService
public getRole ( string $roleIdentifier ) : Role
$roleIdentifier string The role identifier of the role, format: (:)
Результат Role

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

Returns an array of all configured roles
public getRoles ( boolean $includeAbstract = false ) : Role[]
$includeAbstract boolean If TRUE the result includes abstract roles, otherwise those will be skipped
Результат Role[] Array of all configured roles, indexed by role identifier

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

Checks if a role exists
public hasRole ( string $roleIdentifier ) : boolean
$roleIdentifier string The role identifier, format: (:)
Результат boolean

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

Parses the global policy configuration and initializes roles and privileges accordingly
protected initialize ( ) : void
Результат void

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

Initialized all configured privilege targets from the policy definitions
protected initializePrivilegeTargets ( ) : void
Результат void

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

This object is created very early so we can't rely on AOP for the property injection
public injectConfigurationManager ( ConfigurationManager $configurationManager ) : void
$configurationManager Neos\Flow\Configuration\ConfigurationManager The configuration manager
Результат void

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

This object is created very early so we can't rely on AOP for the property injection
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат void

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

Resets the PolicyService to behave transparently during functional testing.
public reset ( ) : void
Результат void

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

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

protected ConfigurationManager,Neos\Flow\Configuration $configurationManager
Результат Neos\Flow\Configuration\ConfigurationManager

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

protected bool $initialized
Результат boolean

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

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\ObjectManagerInterface

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

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

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

protected PrivilegeTarget[],Neos\Flow\Security\Authorization\Privilege $privilegeTargets
Результат Neos\Flow\Security\Authorization\Privilege\PrivilegeTarget[]

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

protected Role[],Neos\Flow\Security\Policy $roles
Результат Role[]