Open Journal Systems  3.3.0
RoleBasedHandlerOperationPolicy Class Reference
Inheritance diagram for RoleBasedHandlerOperationPolicy:
HandlerOperationPolicy AuthorizationPolicy AssignedStageRoleHandlerOperationPolicy

Public Member Functions

 __construct ($request, $roles, $operations, $message='user.authorization.roleBasedAccessDenied', $allRoles=false)
 
 _checkUserRoleAssignment ($userRoles)
 
 effect ()
 
- Public Member Functions inherited from HandlerOperationPolicy
 __construct ($request, $operations, $message=null)
 
 _checkOperationWhitelist ()
 
 getOperations ()
 
getRequest ()
 
- Public Member Functions inherited from AuthorizationPolicy
 __construct ($message=null)
 
 addAuthorizedContextObject ($assocType, &$authorizedObject)
 
 applies ()
 
getAdvice ($adviceType)
 
getAuthorizedContext ()
 
getAuthorizedContextObject ($assocType)
 
 hasAdvice ($adviceType)
 
 hasAuthorizedContextObject ($assocType)
 
 setAdvice ($adviceType, &$adviceContent)
 
 setAuthorizedContext (&$authorizedContext)
 

Data Fields

 $_allRoles
 
 $_roles = array()
 
- Data Fields inherited from HandlerOperationPolicy
 $_operations = array()
 
 $_request
 
- Data Fields inherited from AuthorizationPolicy
 $_advice = array()
 
 $_authorizedContext = array()
 

Detailed Description

Class to control access to handler operations via role based access control.

Definition at line 18 of file RoleBasedHandlerOperationPolicy.inc.php.

Constructor & Destructor Documentation

◆ __construct()

RoleBasedHandlerOperationPolicy::__construct (   $request,
  $roles,
  $operations,
  $message = 'user.authorization.roleBasedAccessDenied',
  $allRoles = false 
)

Constructor

Parameters
$requestPKPRequest
$rolesarray|integer either a single role ID or an array of role ids
$operationsarray|string either a single operation or a list of operations that this policy is targeting.
$messagestring a message to be displayed if the authorization fails
$allRolesboolean whether all roles must match ("all of") or whether it is enough for only one role to match ("any of"). Default: false ("any of")

Definition at line 41 of file RoleBasedHandlerOperationPolicy.inc.php.

Member Function Documentation

◆ _checkUserRoleAssignment()

RoleBasedHandlerOperationPolicy::_checkUserRoleAssignment (   $userRoles)

Check whether the given user has been assigned to any of the allowed roles. If so then grant access.

Parameters
$userRolesarray
Returns
boolean

Definition at line 90 of file RoleBasedHandlerOperationPolicy.inc.php.

Referenced by AssignedStageRoleHandlerOperationPolicy\effect(), and effect().

◆ effect()

Field Documentation

◆ $_allRoles

boolean RoleBasedHandlerOperationPolicy::$_allRoles

Definition at line 29 of file RoleBasedHandlerOperationPolicy.inc.php.

◆ $_roles

array RoleBasedHandlerOperationPolicy::$_roles = array()

the target roles

Definition at line 23 of file RoleBasedHandlerOperationPolicy.inc.php.


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