Class

eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute

class Attribute

Authorization attribute class to be used with SecurityContextInterface::isGranted().

$module represents the global scope you want to check access to (e.g. "content") $function represents the feature inside $module (e.g. "read") $limitations are optional limitations to check against (e.g. array( 'valueObject' => $contentInfo )). Supported keys are "valueObject" and "targets". "valueObject": ValueObject you want to check access to (e.g. ContentInfo) "targets": Location, parent or "assignment" (e.g. Section) value object, or an array of the same

Usage example: use eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute as AuthorizationAttribute;

// From inside a controller // Will check if current user can assign a content to a section, $section being a Section value object. $hasAccess = $this->isGranted( new AuthorizationAttribute( 'content', 'read', array( 'valueObject' => $contentInfo, 'targets' => $section ) ) );

Properties

string $module
string $function
array $limitations

Methods

__construct($module = null, $function = null, array $limitations = array())

string __toString()

String representation so that it's understandable by basic voters.

Details

at line 49
public __construct($module = null, $function = null, array $limitations = array())

Parameters

$module
$function
array $limitations

at line 61
public string __toString()

String representation so that it's understandable by basic voters.

Return Value

string