当前位置: 首页>>代码示例>>PHP>>正文


PHP GridHandler::authorize方法代码示例

本文整理汇总了PHP中GridHandler::authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP GridHandler::authorize方法的具体用法?PHP GridHandler::authorize怎么用?PHP GridHandler::authorize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridHandler的用法示例。


在下文中一共展示了GridHandler::authorize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: authorize

 /**
  * @see PKPHandler::authorize()
  * @param $request PKPRequest
  * @param $args array
  * @param $roleAssignments array
  */
 function authorize(&$request, $args, $roleAssignments)
 {
     $stageId = $request->getUserVar('stageId');
     import('classes.security.authorization.OmpWorkflowStageAccessPolicy');
     $this->addPolicy(new OmpWorkflowStageAccessPolicy($request, $args, $roleAssignments, 'monographId', $stageId));
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:13,代码来源:StageParticipantGridHandler.inc.php

示例2: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
     $this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
     $operation = $request->getRequestedOp();
     $workflowStageRequiredOps = array('assignStage', 'unassignStage');
     if (in_array($operation, $workflowStageRequiredOps)) {
         import('lib.pkp.classes.security.authorization.internal.WorkflowStageRequiredPolicy');
         $this->addPolicy(new WorkflowStageRequiredPolicy($request->getUserVar('stageId')));
     }
     $userGroupRequiredOps = array_merge($workflowStageRequiredOps, array('editUserGroup', 'updateUserGroup', 'removeUserGroup'));
     if (in_array($operation, $userGroupRequiredOps)) {
         // Validate the user group object.
         $userGroupId = $request->getUserVar('userGroupId');
         $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
         /* @var $userGroupDao UserGroupDAO */
         $userGroup = $userGroupDao->getById($userGroupId);
         if (!$userGroup) {
             fatalError('Invalid user group id!');
         } else {
             $this->_userGroup = $userGroup;
         }
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:28,代码来源:UserGroupGridHandler.inc.php

示例3: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     $stageId = (int) $request->getUserVar('stageId');
     import('lib.pkp.classes.security.authorization.WorkflowStageAccessPolicy');
     $this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $stageId));
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:10,代码来源:UserSelectGridHandler.inc.php

示例4: authorize

 /**
  * @copydoc PKPHandler::authorize()
  * @param $contextRequired boolean
  */
 function authorize($request, &$args, $roleAssignments, $contextRequired = true)
 {
     if ($contextRequired) {
         import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
         $this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:12,代码来源:SetupGridHandler.inc.php

示例5: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     $stageId = $request->getUserVar('stageId');
     // This is being validated in WorkflowStageAccessPolicy
     // Get the access policy
     import('lib.pkp.classes.security.authorization.QueryAccessPolicy');
     $this->addPolicy(new QueryAccessPolicy($request, $args, $roleAssignments, $stageId));
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:12,代码来源:QueryNotesGridHandler.inc.php

示例6: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     $this->_request = $request;
     import('lib.pkp.classes.security.authorization.WorkflowStageAccessPolicy');
     $this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', WORKFLOW_STAGE_ID_PRODUCTION));
     if ($request->getUserVar('representationId')) {
         import('lib.pkp.classes.security.authorization.internal.RepresentationRequiredPolicy');
         $this->addPolicy(new RepresentationRequiredPolicy($request, $args));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:selwyntcy,项目名称:ojs,代码行数:14,代码来源:ArticleGalleyGridHandler.inc.php

示例7: authorize

 /**
  * @see PKPHandler::authorize()
  * @param $request PKPRequest
  * @param $args array
  * @param $roleAssignments array
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.PkpContextAccessPolicy');
     $this->addPolicy(new PkpContextAccessPolicy($request, $roleAssignments));
     // If a signoff ID was specified, authorize it.
     if ($request->getUserVar('issueId')) {
         import('classes.security.authorization.OjsIssueRequiredPolicy');
         $this->addPolicy(new OjsIssueRequiredPolicy($request, $args));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:jalperin,项目名称:ojs,代码行数:17,代码来源:IssueGridHandler.inc.php

示例8: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.PolicySet');
     $rolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES);
     import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy');
     foreach ($roleAssignments as $role => $operations) {
         $rolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations));
     }
     $this->addPolicy($rolePolicy);
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:14,代码来源:ContextGridHandler.inc.php

示例9: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.PkpContextAccessPolicy');
     $this->addPolicy(new PkpContextAccessPolicy($request, $roleAssignments));
     import('lib.pkp.classes.security.authorization.SubmissionAccessPolicy');
     $this->addPolicy(new SubmissionAccessPolicy($request, $args, $roleAssignments));
     // If a representation was specified, authorize it.
     if ($request->getUserVar('representationId')) {
         import('lib.pkp.classes.security.authorization.internal.RepresentationRequiredPolicy');
         $this->addPolicy(new RepresentationRequiredPolicy($request, $args));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:relaciones-internacionales-journal,项目名称:ojs,代码行数:16,代码来源:ArticleGalleyGridHandler.inc.php

示例10: authorize

 /**
  * @copydoc PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     $operation = $request->getRouter()->getRequestedOp($request);
     $siteAccessOps = array('fetchGrid', 'fetchRows', 'saveSequence');
     if (in_array($operation, $siteAccessOps)) {
         import('lib.pkp.classes.security.authorization.PKPSiteAccessPolicy');
         $this->addPolicy(new PKPSiteAccessPolicy($request, null, $roleAssignments));
     } else {
         import('classes.security.authorization.OmpPublishedMonographAccessPolicy');
         $this->addPolicy(new OmpPublishedMonographAccessPolicy($request, $args, $roleAssignments, 'rowId'));
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:NateWr,项目名称:omp,代码行数:16,代码来源:CatalogMonographsGridHandler.inc.php

示例11: authorize

 /**
  * @see PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.WorkflowStageAccessPolicy');
     $this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', WORKFLOW_STAGE_ID_PRODUCTION));
     if (parent::authorize($request, $args, $roleAssignments)) {
         $representationId = (int) $request->getUserVar('representationId');
         $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO');
         $this->monograph = $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
         $this->publicationFormat = $publicationFormatDao->getById($representationId, $this->monograph->getId());
         return true;
     }
     return false;
 }
开发者ID:PublishingWithoutWalls,项目名称:omp,代码行数:16,代码来源:ApprovedProofFilesGridHandler.inc.php

示例12: authorize

 /**
  * @see PKPHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.PolicySet');
     $rolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES);
     import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy');
     foreach ($roleAssignments as $role => $operations) {
         $rolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations));
     }
     $this->addPolicy($rolePolicy);
     $this->reviewFormId = (int) $request->getUserVar('reviewFormId');
     $reviewFormDao = DAORegistry::getDAO('ReviewFormDAO');
     if (!$reviewFormDao->reviewFormExists($this->reviewFormId, Application::getContextAssocType(), $request->getContext()->getId())) {
         return false;
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:19,代码来源:ReviewFormElementsGridHandler.inc.php

示例13: authorize

 /**
  * @see PKPHandler::authorize()
  * @param $request PKPRequest
  * @param $args array
  * @param $roleAssignments array
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
     $this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
     $returner = parent::authorize($request, $args, $roleAssignments);
     $spotlightId = $request->getUserVar('spotlightId');
     if ($spotlightId) {
         $press = $request->getPress();
         $spotlightDao = DAORegistry::getDAO('SpotlightDAO');
         $spotlight = $spotlightDao->getById($spotlightId);
         if ($spotlight == null || $spotlight->getPressId() != $press->getId()) {
             return false;
         }
     }
     return $returner;
 }
开发者ID:NateWr,项目名称:omp,代码行数:22,代码来源:ManageSpotlightsGridHandler.inc.php

示例14: authorize

 /**
  * @copydoc GridHandler::authorize()
  */
 function authorize($request, &$args, $roleAssignments)
 {
     import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
     $this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
     $context = $request->getContext();
     $announcementTypeId = $request->getUserVar('announcementTypeId');
     if ($announcementTypeId) {
         // Ensure announcement type is valid and for this context
         $announcementTypeDao = DAORegistry::getDAO('AnnouncementTypeDAO');
         /* @var $announcementTypeDao AnnouncementTypeDAO */
         $announcementType = $announcementTypeDao->getById($announcementTypeId);
         if (!$announcementType || $announcementType->getAssocType() != $context->getAssocType() || $announcementType->getAssocId() != $context->getId()) {
             return false;
         }
     }
     return parent::authorize($request, $args, $roleAssignments);
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:20,代码来源:AnnouncementTypeGridHandler.inc.php

示例15: authorize

 /**
  * @copydoc GridHandler::authorize()
  * @param $requireAnnouncementsEnabled Iff true, allow access only if context settings enable announcements
  */
 function authorize($request, &$args, $roleAssignments, $requireAnnouncementsEnabled = true)
 {
     import('lib.pkp.classes.security.authorization.ContextRequiredPolicy');
     $this->addPolicy(new ContextRequiredPolicy($request));
     $returner = parent::authorize($request, $args, $roleAssignments);
     // Ensure announcements are enabled.
     $context = $request->getContext();
     if ($requireAnnouncementsEnabled && !$context->getSetting('enableAnnouncements')) {
         return false;
     }
     $announcementId = $request->getUserVar('announcementId');
     if ($announcementId) {
         // Ensure announcement is valid and for this context
         $announcementDao = DAORegistry::getDAO('AnnouncementDAO');
         /* @var $announcementDao AnnouncementDAO */
         if ($announcementDao->getAnnouncementAssocType($announcementId) != $context->getAssocType() && $announcementDao->getAnnouncementAssocId($announcementId) != $context->getId()) {
             return false;
         }
     }
     return $returner;
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:25,代码来源:AnnouncementGridHandler.inc.php


注:本文中的GridHandler::authorize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。