本文整理汇总了PHP中AuthorizationPolicy类的典型用法代码示例。如果您正苦于以下问题:PHP AuthorizationPolicy类的具体用法?PHP AuthorizationPolicy怎么用?PHP AuthorizationPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AuthorizationPolicy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isValid
/**
* @see HandlerValidator::isValid()
*/
function isValid()
{
// Delegate to the AuthorizationPolicy
if (!$this->_policy->applies()) {
return false;
}
if ($this->_policy->effect() == AUTHORIZATION_DENY) {
return false;
} else {
return true;
}
}
示例2: isValid
/**
* @see HandlerValidator::isValid()
*/
function isValid()
{
// Delegate to the AuthorizationPolicy
if (!$this->_policy->applies()) {
return false;
}
// Pass the authorized context to the police.
$this->_policy->setAuthorizedContext($this->handler->getAuthorizedContext());
if ($this->_policy->effect() == AUTHORIZATION_DENY) {
return false;
} else {
return true;
}
}
示例3: HttpsPolicy
/**
* Constructor
*
* @param $request PKPRequest
*/
function HttpsPolicy(&$request)
{
parent::AuthorizationPolicy();
$this->_request =& $request;
// Add advice
$callOnDeny = array($request, 'redirectSSL', array());
$this->setAdvice(AUTHORIZATION_ADVICE_CALL_ON_DENY, $callOnDeny);
}
示例4: SubmissionRequiredPolicy
/**
* Constructor
* @param $request PKPRequest
* @param $args array request parameters
* @param $submissionParameterName string the request parameter we expect
* the submission id in.
* @param $message string
*/
function SubmissionRequiredPolicy(&$request, &$args, $submissionParameterName = 'submissionId', $message = null)
{
parent::AuthorizationPolicy($message);
$this->_request =& $request;
assert(is_array($args));
$this->_args =& $args;
$this->_submissionParameterName = $submissionParameterName;
}
示例5: DataObjectRequiredPolicy
/**
* Constructor
* @param $request PKPRequest
* @param $args array request parameters
* @param $parameterName string the request parameter we expect
* @param $message string
* @param $operations array Optional list of operations for which this check takes effect. If specified, operations outside this set will not be checked against this policy.
*/
function DataObjectRequiredPolicy(&$request, &$args, $parameterName, $message = null, $operations = null)
{
parent::AuthorizationPolicy($message);
$this->_request =& $request;
assert(is_array($args));
$this->_args =& $args;
$this->_parameterName = $parameterName;
$this->_operations = $operations;
}
示例6: HandlerOperationPolicy
/**
* Constructor
* @param $request PKPRequest
* @param $operations array|string either a single operation or a list of operations that
* this policy is targeting.
* @param $message string a message to be displayed if the authorization fails
*/
function HandlerOperationPolicy(&$request, $operations, $message = null)
{
parent::AuthorizationPolicy($message);
$this->_request =& $request;
// Make sure a single operation doesn't have to
// be passed in as an array.
assert(is_string($operations) || is_array($operations));
if (!is_array($operations)) {
$operations = array($operations);
}
$this->_operations = $operations;
}
示例7: WorkflowSettingsAssignmentPolicy
/**
* Constructor
* @param $request PKPRequest
*/
function WorkflowSettingsAssignmentPolicy(&$request)
{
parent::AuthorizationPolicy('user.authorization.workflowStageSettingMissing');
$this->_request =& $request;
}
示例8: UserRolesRequiredPolicy
/**
* Constructor
*
* @param $request PKPRequest
*/
function UserRolesRequiredPolicy($request)
{
parent::AuthorizationPolicy();
$this->_request = $request;
}
示例9: ContextRequiredPolicy
/**
* Constructor
*
* @param $request PKPRequest
*/
function ContextRequiredPolicy(&$request, $message = 'user.authorization.contextRequired')
{
parent::AuthorizationPolicy($message);
$this->_request =& $request;
}
示例10: QueryAssignedToUserAccessPolicy
/**
* Constructor
* @param $request PKPRequest
*/
function QueryAssignedToUserAccessPolicy($request)
{
parent::AuthorizationPolicy('user.authorization.submissionQuery');
$this->_request = $request;
}
示例11: UserAccessibleWorkflowStagePolicy
/**
* Constructor
* @param $stageId The one that will be checked against accessible
* user workflow stages.
*/
function UserAccessibleWorkflowStagePolicy($stageId)
{
parent::AuthorizationPolicy();
$this->_stageId = $stageId;
}
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:10,代码来源:UserAccessibleWorkflowStagePolicy.inc.php
示例12: ReviewAssignmentAccessPolicy
/**
* Constructor
* @param $request PKPRequest
*/
function ReviewAssignmentAccessPolicy(&$request)
{
parent::AuthorizationPolicy('user.authorization.monographReviewer');
$this->_request =& $request;
}
示例13: ReviewAssignmentAccessPolicy
/**
* Constructor
* @param $request PKPRequest
*/
function ReviewAssignmentAccessPolicy($request)
{
parent::AuthorizationPolicy('user.authorization.submissionReviewer');
$this->_request = $request;
}
示例14: ManagerRequiredPolicy
/**
* Constructor
* @param $request PKPRequest
*/
function ManagerRequiredPolicy($request)
{
parent::AuthorizationPolicy('user.authorization.managerRequired');
$this->_request = $request;
}
示例15: array
/**
* Constructor
*
* @param $request PKPRequest
*/
function __construct($request)
{
parent::__construct();
$this->_request = $request;
// Add advice
$callOnDeny = array($request, 'redirectSSL', array());
$this->setAdvice(AUTHORIZATION_ADVICE_CALL_ON_DENY, $callOnDeny);
}