本文整理汇总了PHP中Authorization::getExplicitAZ方法的典型用法代码示例。如果您正苦于以下问题:PHP Authorization::getExplicitAZ方法的具体用法?PHP Authorization::getExplicitAZ怎么用?PHP Authorization::getExplicitAZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authorization
的用法示例。
在下文中一共展示了Authorization::getExplicitAZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExplicitUserAZsForImplicitAZ
/**
* Given an implicit returns the matching explicit user Authorizations.
* Explicit Authorizations can be modified. A null argument will be
* treated as a wildcard.
*
* @param object Authorization $implicitAuthorization
*
* @return object AuthorizationIterator
*
* @throws object AuthorizationException An exception with
* one of the following messages defined in
* org.osid.authorization.AuthorizationException may be thrown:
* {@link
* org.osid.authorization.AuthorizationException#OPERATION_FAILED
* OPERATION_FAILED}, {@link
* org.osid.authorization.AuthorizationException#PERMISSION_DENIED
* PERMISSION_DENIED}, {@link
* org.osid.authorization.AuthorizationException#CONFIGURATION_ERROR
* CONFIGURATION_ERROR}, {@link
* org.osid.authorization.AuthorizationException#UNIMPLEMENTED
* UNIMPLEMENTED}, {@link
* org.osid.authorization.AuthorizationException#NULL_ARGUMENT
* NULL_ARGUMENT}, {@link
* org.osid.authorization.AuthorizationException#UNKNOWN_ID
* UNKNOWN_ID}, {@link
* org.osid.authorization.AuthorizationException#UNKNOWN_TYPE
* UNKNOWN_TYPE}
*
* @access public
*/
function getExplicitUserAZsForImplicitAZ(Authorization $implicitAuthorization)
{
if ($implicitAuthorization->isExplicit()) {
// "The Authorization must be implicit."
throwError(new Error(AuthorizationExeption::OPERATION_FAILED(), "AuthorizationManager", true));
}
return new HarmoniIterator(array($implicitAuthorization->getExplicitAZ()));
}
示例2: isCascadingUpView
/**
* Answer true if the authorization is an implicit view AZ cascading up from
* a descendent and should hence be ignored when determining roles.
*
* @param object Authorization $az
* @return boolean
* @access protected
* @since 7/11/08
*/
protected function isCascadingUpView(Authorization $az)
{
// We are only interested in implicit AZs
if ($az->isExplicit()) {
return false;
}
// Return false if not a view AZ
$authZ = Services::getService("AuthZ");
$idMgr = Services::getService("Id");
$viewId = $idMgr->getId('edu.middlebury.authorization.view');
if (!$az->getFunction()->getId()->isEqual($viewId)) {
return false;
}
// Load a list of descendents
$qualifierId = $az->getQualifier()->getId();
if (!isset($this->descendentIds)) {
$this->descendentIds = array();
}
if (!isset($this->descendentIds[$qualifierId->getIdString()])) {
$descendents = array();
$descendents = $authZ->getQualifierDescendants($qualifierId);
$descendentIds = array();
while ($descendents->hasNext()) {
$descendentIds[] = $descendents->next()->getId();
}
$this->descendentIds[$qualifierId->getIdString()] = $descendentIds;
}
// Check the explicit AZ's qualifier against our list of descendents.
$explicitAZ = $az->getExplicitAZ();
$explicitQualifierId = $explicitAZ->getQualifier()->getId();
foreach ($this->descendentIds[$qualifierId->getIdString()] as $id) {
if ($id->isEqual($explicitQualifierId)) {
return true;
}
}
return false;
}