PHP Class Neos\Flow\Security\Policy\Role

ファイルを表示 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$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[]

Public Methods

Method Description
__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.

Method Details

__construct() public method

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

__toString() public method

Returns the string representation of this role (the identifier)
public __toString ( ) : string
return string the string representation of this role

addParentRole() public method

Add a (direct) parent role to this role.
public addParentRole ( Role $parentRole ) : void
$parentRole Role
return void

addPrivilege() public method

Add a privilege to this role.
public addPrivilege ( Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface $privilege ) : void
$privilege Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface
return void

getAllParentRoles() public method

Returns all (directly and indirectly reachable) parent roles for the given role.
public getAllParentRoles ( ) : Role[]
return Role[] Array of parent roles, indexed by role identifier

getIdentifier() public method

Returns the fully qualified identifier of this role
public getIdentifier ( ) : string
return string

getName() public method

The name of this role, being the identifier without the package key.
public getName ( ) : string
return string

getPackageKey() public method

The key of the package that defines this role.
public getPackageKey ( ) : string
return string

getParentRoles() public method

Returns an array of all directly assigned parent roles.
public getParentRoles ( ) : Role[]
return Role[] Array of direct parent roles, indexed by role identifier

getPrivilegeForTarget() public method

public getPrivilegeForTarget ( string $privilegeTargetIdentifier, array $privilegeParameters = [] ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface
$privilegeTargetIdentifier string
$privilegeParameters array
return Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface the matching privilege or NULL if no privilege exists for the given constraints

getPrivileges() public method

public getPrivileges ( ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]
return Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[] Array of privileges assigned to this role

getPrivilegesByType() public method

public getPrivilegesByType ( string $className ) : Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]
$className string Fully qualified name of the Privilege class to filter for
return Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]

hasParentRole() public method

Returns TRUE if the given role is a directly assigned parent of this role.
public hasParentRole ( Role $role ) : boolean
$role Role
return boolean

isAbstract() public method

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
return boolean

setAbstract() public method

public setAbstract ( boolean $abstract ) : void
$abstract boolean
return void

setParentRoles() public method

Assign parent roles to this role.
public setParentRoles ( array $parentRoles ) : void
$parentRoles array indexed by role identifier
return void

setPrivileges() public method

Assign privileges to this role.
public setPrivileges ( array $privileges ) : void
$privileges array
return void

Property Details

$abstract protected_oe property

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
return boolean

$identifier protected_oe property

The identifier of this role
protected string $identifier
return string

$name protected_oe property

The name of this role (without package key)
protected string $name
return string

$packageKey protected_oe property

The package key this role belongs to (extracted from the identifier)
protected string $packageKey
return string

$parentRoles protected_oe property

protected Role[],Neos\Flow\Security\Policy $parentRoles
return Role[]

$privileges protected_oe property

protected PrivilegeInterface[],Neos\Flow\Security\Authorization\Privilege $privileges
return Neos\Flow\Security\Authorization\Privilege\PrivilegeInterface[]