Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorGridHandler.inc.php
1 <?php
2 
16 // import grid base classes
17 import('lib.pkp.classes.controllers.grid.GridHandler');
18 import('lib.pkp.controllers.grid.users.author.PKPAuthorGridHandler');
19 
20 
21 // import author grid specific classes
22 import('controllers.grid.users.author.AuthorGridRow');
23 
24 // Link action & modal classes
25 import('lib.pkp.classes.linkAction.request.AjaxModal');
26 
28 
32  function AuthorGridHandler() {
33  parent::PKPAuthorGridHandler();
34  $this->addRoleAssignment(
35  array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT, ROLE_ID_AUTHOR),
36  array('fetchGrid', 'fetchRow', 'addAuthor', 'editAuthor',
37  'updateAuthor', 'deleteAuthor', 'saveSequence'));
38  $this->addRoleAssignment(ROLE_ID_REVIEWER, array('fetchGrid', 'fetchRow'));
39  $this->addRoleAssignment(array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT), array('addUser'));
40  }
41 
42 
43  //
44  // Overridden methods from PKPHandler
45  //
52  function authorize($request, &$args, $roleAssignments) {
53  import('classes.security.authorization.SubmissionAccessPolicy');
54  $this->addPolicy(new SubmissionAccessPolicy($request, $args, $roleAssignments));
55  return parent::authorize($request, $args, $roleAssignments);
56  }
57 
58  /*
59  * Configure the grid
60  * @param $request PKPRequest
61  */
62  function initialize($request) {
63  // Load submission-specific translations
65  LOCALE_COMPONENT_APP_SUBMISSION,
66  LOCALE_COMPONENT_APP_DEFAULT
67  );
68 
69  parent::initialize($request);
70  }
71 
72 
73  //
74  // Overridden methods from GridHandler
75  //
80  function canAdminister() {
81  $monograph = $this->getSubmission();
82  $userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
83  // N.B.: $monograph will not be defined yet for feature
84  // initialization, which happens prior to fetching.
85  if (!$monograph || $monograph->getDateSubmitted() == null || array_intersect(array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR), $userRoles))
86  return true;
87  else
88  return false;
89  }
90 }
91 
92 ?>
addPolicy($authorizationPolicy, $addToTop=false)
static requireComponents()
addRoleAssignment($roleIds, $operations)
Handle author grid requests.
Class to control (write) access to submissions and (read) access to submission details in OMP...
authorize($request, &$args, $roleAssignments)
base PKP class to handle author grid requests.
& getAuthorizedContextObject($assocType)