Open Journal Systems  3.3.0
QueriesAccessHelper Class Reference

Public Member Functions

 __construct ($authorizedContext, $user)
 
 getAuthorizedContextObject ($assocType)
 
 getCanCreate ($stageId)
 
 getCanDelete ($queryId)
 
 getCanEdit ($queryId)
 
 getCanListAll ($stageId)
 
 getCanOpenClose ($query)
 
 getCanOrder ($stageId)
 

Data Fields

 $_authorizedContext
 
 $_user
 

Protected Member Functions

 hasStageRole ($stageId, $roles)
 
 isAssigned ($userId, $queryId)
 

Detailed Description

Implements access rules for queries. Permissions are intended as follows (per UI/UX group, 2015-12-01) Added permissions for Reviewers, 2017-11-05.

ROLE TASK MANAGER SUB EDITOR ASSISTANT AUTHOR REVIEWER Create Q Yes Yes Yes Yes Yes Edit Q All All If Creator If Creator if Creator List/View All All Assigned Assigned Assigned Open/close All All Assigned No No Delete Q All All If Blank If Blank If Blank

Definition at line 26 of file QueriesAccessHelper.inc.php.

Constructor & Destructor Documentation

◆ __construct()

QueriesAccessHelper::__construct (   $authorizedContext,
  $user 
)

Constructor

Parameters
$authorizedContextarray
$userUser

Definition at line 44 of file QueriesAccessHelper.inc.php.

Member Function Documentation

◆ getAuthorizedContextObject()

QueriesAccessHelper::getAuthorizedContextObject (   $assocType)

Retrieve authorized context objects from the authorized context.

Parameters
$assocTypeinteger any of the ASSOC_TYPE_* constants
Returns
mixed

Definition at line 54 of file QueriesAccessHelper.inc.php.

Referenced by hasStageRole().

◆ getCanCreate()

QueriesAccessHelper::getCanCreate (   $stageId)

Determine whether the user can create queries.

Parameters
$stageIdint
Returns
boolean

Definition at line 88 of file QueriesAccessHelper.inc.php.

References hasStageRole().

◆ getCanDelete()

QueriesAccessHelper::getCanDelete (   $queryId)

Determine whether the current user can delete a query.

Parameters
$queryIdint Query ID
Returns
boolean True iff the user is allowed to delete the query.

Definition at line 119 of file QueriesAccessHelper.inc.php.

References DAORegistry\getDAO(), and hasStageRole().

◆ getCanEdit()

QueriesAccessHelper::getCanEdit (   $queryId)

Determine whether the current user can edit a query.

Parameters
$queryIdint Query ID
Returns
boolean True iff the user is allowed to edit the query.

Definition at line 97 of file QueriesAccessHelper.inc.php.

References DAORegistry\getDAO(), and hasStageRole().

◆ getCanListAll()

QueriesAccessHelper::getCanListAll (   $stageId)

Determine whether the current user can list all queries on the submission

Parameters
$stageIdint The stage ID to load discussions for
Returns
boolean

Definition at line 141 of file QueriesAccessHelper.inc.php.

References hasStageRole().

◆ getCanOpenClose()

QueriesAccessHelper::getCanOpenClose (   $query)

Determine whether the current user can open/close a query.

Parameters
$queryQuery
Returns
boolean True if the user is allowed to open/close the query.

Definition at line 63 of file QueriesAccessHelper.inc.php.

References hasStageRole(), and isAssigned().

◆ getCanOrder()

QueriesAccessHelper::getCanOrder (   $stageId)

Determine whether the user can re-order the queries.

Parameters
$stageIdint
Returns
boolean

Definition at line 79 of file QueriesAccessHelper.inc.php.

References hasStageRole().

◆ hasStageRole()

QueriesAccessHelper::hasStageRole (   $stageId,
  $roles 
)
protected

Determine whether the current user has role(s) in the current workflow stage

Parameters
$stageIdint
$rolesarray [ROLE_ID_...]
Returns
boolean

Definition at line 163 of file QueriesAccessHelper.inc.php.

References getAuthorizedContextObject().

Referenced by getCanCreate(), getCanDelete(), getCanEdit(), getCanListAll(), getCanOpenClose(), and getCanOrder().

◆ isAssigned()

QueriesAccessHelper::isAssigned (   $userId,
  $queryId 
)
protected

Determine whether the current user is assigned to the current query.

Parameters
$userIdint User ID
$queryIdint Query ID
Returns
boolean

Definition at line 151 of file QueriesAccessHelper.inc.php.

References DAORegistry\getDAO().

Referenced by getCanOpenClose().

Field Documentation

◆ $_authorizedContext

array QueriesAccessHelper::$_authorizedContext

Definition at line 31 of file QueriesAccessHelper.inc.php.

◆ $_user

User QueriesAccessHelper::$_user

Definition at line 37 of file QueriesAccessHelper.inc.php.


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