/**
  * @see GridHandler::authorize()
  */
 function authorize($request, $args, $roleAssignments)
 {
     $category = $request->getUserVar('category');
     $pluginName = $request->getUserVar('plugin');
     $verb = $request->getUserVar('verb');
     if ($category && $pluginName) {
         import('classes.security.authorization.OhsPluginAccessPolicy');
         $this->addPolicy(new OhsPluginAccessPolicy($request, $args, $roleAssignments));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
 /**
  * @see GridHandler::authorize()
  * @param $request PKPRequest
  * @param $args array
  * @param $roleAssignments array
  */
 function authorize($request, &$args, $roleAssignments)
 {
     $category = $request->getUserVar('category');
     $pluginName = $request->getUserVar('plugin');
     $verb = $request->getUserVar('verb');
     if ($category && $pluginName) {
         import('classes.security.authorization.OmpPluginAccessPolicy');
         if ($verb) {
             $accessMode = ACCESS_MODE_MANAGE;
         } else {
             $accessMode = ACCESS_MODE_ADMIN;
         }
         $this->addPolicy(new OmpPluginAccessPolicy($request, $args, $roleAssignments, $accessMode));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
예제 #3
0
 /**
  * @copydoc GridHandler::authorize()
  */
 function authorize($request, $args, $roleAssignments)
 {
     $categoryName = $request->getUserVar('category');
     $pluginName = $request->getUserVar('plugin');
     if ($categoryName && $pluginName) {
         import('classes.security.authorization.OjsPluginAccessPolicy');
         switch ($request->getRequestedOp()) {
             case 'enable':
             case 'disable':
             case 'manage':
                 $accessMode = ACCESS_MODE_MANAGE;
                 break;
             default:
                 $accessMode = ACCESS_MODE_ADMIN;
                 break;
         }
         $this->addPolicy(new OjsPluginAccessPolicy($request, $args, $roleAssignments, $accessMode));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }