eZ\Publish\Core\Base\Exceptions\UnauthorizedException::__construct PHP Method

__construct() public method

Example: User does not have access to 'read' 'content' with: id '44', type 'article'
public __construct ( string $module, string $function, array $properties = null, Exception $previous = null )
$module string The module name should be in sync with the name of the domain object in question
$function string
$properties array Key value pair with non sensitive data on what kind of data user does not have access to
$previous Exception
    public function __construct($module, $function, array $properties = null, Exception $previous = null)
    {
        $this->setMessageTemplate("User does not have access to '%function%' '%module%'");
        $this->setParameters(['%module%' => $module, '%function%' => $function]);
        if ($properties) {
            $this->setMessageTemplate("User does not have access to '%function%' '%module%' with: %with%'");
            $with = [];
            foreach ($properties as $name => $value) {
                $with[] = "{$name} '{$value}'";
            }
            $this->addParameter('%with%', implode(', ', $with));
        }
        parent::__construct($this->getBaseTranslation(), self::UNAUTHORIZED, $previous);
    }
UnauthorizedException