本文整理汇总了PHP中Handler::authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::authorize方法的具体用法?PHP Handler::authorize怎么用?PHP Handler::authorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Handler
的用法示例。
在下文中一共展示了Handler::authorize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
$stageId = (int) $request->getUserVar('stageId');
import('classes.security.authorization.WorkflowStageAccessPolicy');
$this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $stageId));
return parent::authorize($request, $args, $roleAssignments);
}
示例2: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// Require a submission
import('classes.security.authorization.SubmissionAccessPolicy');
$this->addPolicy(new SubmissionAccessPolicy($request, $args, $roleAssignments, 'submissionId'));
return parent::authorize($request, $args, $roleAssignments);
}
示例3: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// We need a review round id in request.
import('lib.pkp.classes.security.authorization.internal.ReviewRoundRequiredPolicy');
$this->addPolicy(new ReviewRoundRequiredPolicy($request, $args));
return parent::authorize($request, $args, $roleAssignments);
}
示例4: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// Allow both reviewers (if in review) and context roles.
import('classes.security.authorization.ReviewStageAccessPolicy');
$this->addPolicy(new ReviewStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $request->getUserVar('stageId')), true);
return parent::authorize($request, $args, $roleAssignments);
}
示例5: 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);
}
示例6: authorize
function authorize($request, &$args, $roleAssignments)
{
$fileIds = $request->getUserVar('filesIdsAndRevisions');
$libraryFileId = $request->getUserVar('libraryFileId');
if (is_string($fileIds)) {
$fileIdsArray = explode(';', $fileIds);
// Remove empty entries (a trailing ";" will cause these)
$fileIdsArray = array_filter($fileIdsArray, create_function('$a', 'return !empty($a);'));
}
if (!empty($fileIdsArray)) {
$multipleSubmissionFileAccessPolicy = new PolicySet(COMBINING_DENY_OVERRIDES);
foreach ($fileIdsArray as $fileIdAndRevision) {
$multipleSubmissionFileAccessPolicy->addPolicy($this->_getAccessPolicy($request, $args, $roleAssignments, $fileIdAndRevision));
}
$this->addPolicy($multipleSubmissionFileAccessPolicy);
} else {
if (is_numeric($libraryFileId)) {
import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
$this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
} else {
// IDs will be specified using the default parameters.
$this->addPolicy($this->_getAccessPolicy($request, $args, $roleAssignments));
}
}
return parent::authorize($request, $args, $roleAssignments);
}
示例7: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// User must be logged in
import('lib.pkp.classes.security.authorization.UserRequiredPolicy');
$this->addPolicy(new UserRequiredPolicy($request));
return parent::authorize($request, $args, $roleAssignments);
}
示例8: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// Authorize stage id.
import('lib.pkp.classes.security.authorization.WorkflowStageAccessPolicy');
$this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $this->_identifyStageId($request)));
return parent::authorize($request, $args, $roleAssignments);
}
示例9: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// Some operations need a review round id in request.
$reviewRoundOps = $this->_getReviewRoundOps();
import('lib.pkp.classes.security.authorization.internal.ReviewRoundRequiredPolicy');
$this->addPolicy(new ReviewRoundRequiredPolicy($request, $args, 'reviewRoundId', $reviewRoundOps));
return parent::authorize($request, $args, $roleAssignments);
}
示例10: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
import('lib.pkp.classes.security.authorization.ContextRequiredPolicy');
$this->addPolicy(new ContextRequiredPolicy($request));
import('classes.security.authorization.OjsJournalMustPublishPolicy');
$this->addPolicy(new OjsJournalMustPublishPolicy($request));
return parent::authorize($request, $args, $roleAssignments);
}
示例11: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
import('lib.pkp.classes.security.authorization.PKPSiteAccessPolicy');
$this->addPolicy(new PKPSiteAccessPolicy($request, array('header', 'sidebar', 'css'), SITE_ACCESS_ALL_ROLES));
if (!Config::getVar('general', 'installed')) {
define('SESSION_DISABLE_INIT', true);
}
return parent::authorize($request, $args, $roleAssignments, false);
}
示例12: authorize
/**
* @copydoc PKPHandler::authorize
*/
function authorize($request, &$args, $roleAssignments)
{
$returner = parent::authorize($request, $args, $roleAssignments);
if (!Config::getVar('oai', 'oai')) {
return false;
} else {
return $returner;
}
}
示例13: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
switch ($op = $request->getRequestedOp()) {
case 'signInAsUser':
import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy');
$this->addPolicy(new RoleBasedHandlerOperationPolicy($request, array(ROLE_ID_MANAGER, ROLE_ID_SITE_ADMIN), array('signInAsUser')));
break;
}
return parent::authorize($request, $args, $roleAssignments);
}
示例14: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
$context = $request->getContext();
if (!$context || !$context->getSetting('restrictSiteAccess')) {
$templateMgr = TemplateManager::getManager($request);
$templateMgr->setCacheability(CACHEABILITY_PUBLIC);
}
import('lib.pkp.classes.security.authorization.ContextRequiredPolicy');
$this->addPolicy(new ContextRequiredPolicy($request));
return parent::authorize($request, $args, $roleAssignments);
}
示例15: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
import('lib.pkp.classes.security.authorization.ContextRequiredPolicy');
$this->addPolicy(new ContextRequiredPolicy($request));
import('classes.security.authorization.OjsJournalMustPublishPolicy');
$this->addPolicy(new OjsJournalMustPublishPolicy($request));
import('classes.security.authorization.OjsIssueRequiredPolicy');
// the 'archives' op does not need this policy so it is left out of the operations array.
$this->addPolicy(new OjsIssueRequiredPolicy($request, $args, array('view', 'download')));
return parent::authorize($request, $args, $roleAssignments);
}