Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AdminPluginGridHandler.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.plugins.PluginGridHandler');
17 
23  $roles = array(ROLE_ID_SITE_ADMIN);
24 
25  $this->addRoleAssignment($roles, array('plugin'));
26 
27  parent::PluginGridHandler($roles);
28  }
29 
30  //
31  // Overriden template methods.
32  //
36  function getRowInstance() {
37  $userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
38 
39  import('controllers.grid.plugins.PluginGridRow');
40  return new PluginGridRow($userRoles, CONTEXT_PRESS);
41  }
42 
49  function authorize($request, &$args, $roleAssignments) {
50  $category = $request->getUserVar('category');
51  $pluginName = $request->getUserVar('plugin');
52  $verb = $request->getUserVar('verb');
53 
54  if ($category && $pluginName) {
55  import('classes.security.authorization.OmpPluginAccessPolicy');
56  if ($verb) {
57  $accessMode = ACCESS_MODE_MANAGE;
58  } else {
59  $accessMode = ACCESS_MODE_ADMIN;
60  }
61 
62  $this->addPolicy(new OmpPluginAccessPolicy($request, $args, $roleAssignments, $accessMode));
63  }
64 
65  return parent::authorize($request, $args, $roleAssignments);
66  }
67 }
68 
69 ?>
addPolicy($authorizationPolicy, $addToTop=false)
addRoleAssignment($roleIds, $operations)
Class to control access to OMP&#39;s plugins.
Handle site level plugins grid requests.
Plugin grid row definition.
& getAuthorizedContextObject($assocType)
Handle plugins grid requests.
authorize($request, &$args, $roleAssignments)