eZPublishCommunityProject  2013.6
eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute Class Reference

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

Public Member Functions

 __construct ($module=null, $function=null, array $limitations=array())
 
 __toString ()
 String representation so that it's understandable by basic voters. More...
 

Public Attributes

 $function
 
 $limitations
 
 $module
 

Detailed Description

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( 'SectionID' => 3 ))

Usage example: use eZ as AuthorizationAttribute;

// From inside a controller // Will check if current user has access to content/read for section 3 (media) $hasAccess = $this->isGranted( new AuthorizationAttribute( 'content', 'read', array( 'SectionID' => 3 ) ) );

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute::__construct (   $module = null,
  $function = null,
array  $limitations = array() 
)
Parameters
string$module
string$function
array$limitations

Member Function Documentation

eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute::__toString ( )

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

Returns
string

Member Data Documentation

eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute::$function
eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute::$limitations
eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute::$module

The documentation for this class was generated from the following file: