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


PHP Authorization::isActiveNow方法代码示例

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


在下文中一共展示了Authorization::isActiveNow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
     }
     $agentId = $implicitAuthorization->getAgentId();
     $function = $implicitAuthorization->getFunction();
     $functionId = $function->getId();
     $qualifier = $implicitAuthorization->getQualifier();
     $qualifierId = $qualifier->getId();
     $authorizations = $this->_cache->getAZs($agentId->getIdString(), $functionId->getIdString(), $qualifierId->getIdString(), null, true, true, $implicitAuthorization->isActiveNow(), $this->_getContainingGroupIdStrings($agentId));
     // isActiveNow
     // Make sure that we are only returning explicit AZs for implicit
     // AZs, not other explicit AZs at this node. This means, only return
     // AZs where the agentId or the qualifier Id are different from those
     // of the implicit AZ
     $explicitForImplicit = array();
     foreach (array_keys($authorizations) as $key) {
         $az = $authorizations[$key];
         $aId = $az->getAgentId();
         $q = $az->getQualifier();
         $qId = $q->getId();
         if ($agentId->isEqual($aId) && $qualifierId->isEqual($qId)) {
             continue;
         } else {
             $explicitForImplicit[] = $az;
         }
     }
     $i = new HarmoniAuthorizationIterator($explicitForImplicit);
     return $i;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:62,代码来源:HarmoniAuthorizationManager.class.php


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