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

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$abstract boolean Whether or not the role is "abstract", meaning it can't be assigned to accounts directly but only serves as a "template role" for other roles to inherit from
$identifier string The identifier of this role
$name string The name of this role (without package key)
$packageKey string The package key this role belongs to (extracted from the identifier)
$parentRoles Role[]
$privileges Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]

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

Метод Описание
__construct ( string $identifier, array $parentRoles = [] )
__toString ( ) : string Returns the string representation of this role (the identifier)
addParentRole ( Role $parentRole ) : void Add a (direct) parent role to this role.
addPrivilege ( Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface $privilege ) : void Add a privilege to this role.
getAllParentRoles ( ) : Role[] Returns all (directly and indirectly reachable) parent roles for the given role.
getIdentifier ( ) : string Returns the fully qualified identifier of this role
getName ( ) : string The name of this role, being the identifier without the package key.
getPackageKey ( ) : string The key of the package that defines this role.
getParentRoles ( ) : Role[] Returns an array of all directly assigned parent roles.
getPrivilegeForTarget ( string $privilegeTargetIdentifier, array $privilegeParameters = [] ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface
getPrivileges ( ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]
getPrivilegesByType ( string $className ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]
hasParentRole ( Role $role ) : boolean Returns TRUE if the given role is a directly assigned parent of this role.
isAbstract ( ) : boolean Whether or not this role is "abstract", meaning it can't be assigned to accounts directly but only serves as a "template role" for other roles to inherit from
setAbstract ( boolean $abstract ) : void
setParentRoles ( array $parentRoles ) : void Assign parent roles to this role.
setPrivileges ( array $privileges ) : void Assign privileges to this role.

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

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

public __construct ( string $identifier, array $parentRoles = [] )
$identifier string The fully qualified identifier of this role (Vendor.Package:Role)
$parentRoles array

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

Returns the string representation of this role (the identifier)
public __toString ( ) : string
Результат string the string representation of this role

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

Add a (direct) parent role to this role.
public addParentRole ( Role $parentRole ) : void
$parentRole Role
Результат void

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

Add a privilege to this role.
public addPrivilege ( Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface $privilege ) : void
$privilege Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface
Результат void

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

Returns all (directly and indirectly reachable) parent roles for the given role.
public getAllParentRoles ( ) : Role[]
Результат Role[] Array of parent roles, indexed by role identifier

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

Returns the fully qualified identifier of this role
public getIdentifier ( ) : string
Результат string

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

The name of this role, being the identifier without the package key.
public getName ( ) : string
Результат string

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

The key of the package that defines this role.
public getPackageKey ( ) : string
Результат string

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

Returns an array of all directly assigned parent roles.
public getParentRoles ( ) : Role[]
Результат Role[] Array of direct parent roles, indexed by role identifier

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

public getPrivilegeForTarget ( string $privilegeTargetIdentifier, array $privilegeParameters = [] ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface
$privilegeTargetIdentifier string
$privilegeParameters array
Результат Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface the matching privilege or NULL if no privilege exists for the given constraints

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

public getPrivileges ( ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]
Результат Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[] Array of privileges assigned to this role

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

public getPrivilegesByType ( string $className ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]
$className string Fully qualified name of the Privilege class to filter for
Результат Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]

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

Returns TRUE if the given role is a directly assigned parent of this role.
public hasParentRole ( Role $role ) : boolean
$role Role
Результат boolean

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

Whether or not this role is "abstract", meaning it can't be assigned to accounts directly but only serves as a "template role" for other roles to inherit from
public isAbstract ( ) : boolean
Результат boolean

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

public setAbstract ( boolean $abstract ) : void
$abstract boolean
Результат void

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

Assign parent roles to this role.
public setParentRoles ( array $parentRoles ) : void
$parentRoles array indexed by role identifier
Результат void

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

Assign privileges to this role.
public setPrivileges ( array $privileges ) : void
$privileges array
Результат void

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

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

Whether or not the role is "abstract", meaning it can't be assigned to accounts directly but only serves as a "template role" for other roles to inherit from
protected bool $abstract
Результат boolean

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

The identifier of this role
protected string $identifier
Результат string

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

The name of this role (without package key)
protected string $name
Результат string

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

The package key this role belongs to (extracted from the identifier)
protected string $packageKey
Результат string

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

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

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

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