16 import(
'lib.pkp.classes.security.authorization.HandlerOperationPolicy');
36 $message =
'user.authorization.roleBasedAccessDenied',
38 parent::__construct($request, $operations, $message);
42 assert(is_integer($roles) || is_array($roles));
43 if (!is_array($roles)) {
44 $roles = array($roles);
46 $this->_roles = $roles;
47 $this->_allRoles = $allRoles;
62 if (empty($userRoles))
return AUTHORIZATION_DENY;
67 $handler = $this->
getRequest()->getRouter()->getHandler();
68 $handler->markRoleAssignmentsChecked();
70 return AUTHORIZATION_PERMIT;
86 $foundMatchingRole =
false;
87 foreach($this->_roles as $roleId) {
88 $foundMatchingRole = in_array($roleId, $userRoles);
90 if ($this->_allRoles) {
91 if (!$foundMatchingRole) {
97 if ($foundMatchingRole) {
105 if ($this->_allRoles) {