/** * Constructor * @param $request PKPRequest * @param $roles array|integer either a single role ID or an array of role ids * @param $operations array|string either a single operation or a list of operations that * this policy is targeting. * @param $message string a message to be displayed if the authorization fails * @param $allRoles boolean whether all roles must match ("all of") or whether it is * enough for only one role to match ("any of"). */ function RoleBasedHandlerOperationPolicy($request, $roles, $operations, $message = 'user.authorization.roleBasedAccessDenied', $allRoles = false) { parent::HandlerOperationPolicy($request, $operations, $message); // Make sure a single role doesn't have to be // passed in as an array. assert(is_integer($roles) || is_array($roles)); if (!is_array($roles)) { $roles = array($roles); } $this->_roles = $roles; $this->_allRoles = $allRoles; }
/** * Constructor * @param $request PKPRequest * @param $operations array|string either a single operation or a list of operations that * this policy is targeting. * @param $message string a message to be displayed if the authorization fails */ function PKPPublicAccessPolicy(&$request, $operations, $message = 'user.authorization.privateOperation') { parent::HandlerOperationPolicy($request, $operations, $message); }
/** * Constructor * @param $request PKPRequest * @param $operations array|string either a single operation or a list of operations that * this policy is targeting. * @param $message string a message to be displayed if the authorization fails */ function __construct($request, $operations, $message = 'user.authorization.privateOperation') { parent::__construct($request, $operations, $message); }