PHP Class Webiny\Component\Security\Authorization\AccessControl

Inheritance: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\Http\HttpTrait, use trait Webiny\Component\ServiceManager\ServiceManagerTrait
Show file Open project: Webiny/Framework Class Usage Examples

Protected Properties

Property Type Description
$currentPath Webiny\Component\StdLib\StdObject\StringObject\StringObject Current path - based on current request.

Public Methods

Method Description
__construct ( AbstractUser $user, ConfigObject $config ) Base constructor.
isUserAllowedAccess ( ) : boolean Checks if current user is allowed access.

Private Methods

Method Description
getAccessDecision ( array $requestedRoles ) : boolean This method get the votes from all the voters and sends them to the ruling.
getCurrentPath ( ) : StringObject Returns current path (url) as StringObject instance.
getRequestedRoles ( ) : array Returns an array of roles required by the access rule.
getVoters ( ) : array Creates an array of registered Voters.
setDecisionStrategy ( ) Sets the decision strategy based on the application configuration.
testPath ( string $path ) : boolean Tests the given $path if it's within the current request path.
whatsTheRuling ( integer $votes, integer $maxVotes ) : boolean Method that decides if access is allowed or not based on the results of votes and the defined decision strategy.

Method Details

__construct() public method

Base constructor.
public __construct ( AbstractUser $user, ConfigObject $config )
$user Webiny\Component\Security\User\AbstractUser Instance of current user.
$config Webiny\Component\Config\ConfigObject Access control configuration.

isUserAllowedAccess() public method

Checks if current user is allowed access.
public isUserAllowedAccess ( ) : boolean
return boolean

Property Details

$currentPath protected property

Current path - based on current request.
protected StringObject,Webiny\Component\StdLib\StdObject\StringObject $currentPath
return Webiny\Component\StdLib\StdObject\StringObject\StringObject