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


PHP owa_coreAPI::isEveryoneCapable方法代码示例

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


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

示例1: isCapable

 /**
  * Checks if user has a partciular capability
  *
  * @param string 	$cap
  * @param integer 	$siteId	only needed if capability requires site access. you need to pass site_id (not id) field
  * @return boolean
  */
 function isCapable($cap, $siteId = null)
 {
     owa_coreAPI::debug("Checking if user is capable of: " . $cap);
     // is this capability assigned to everyone?
     // is this the global admin user?
     // was no capability passed?
     // if so, the user can see and do everything
     if (owa_coreAPI::isEveryoneCapable($cap) || $this->user->isAdmin() || empty($cap)) {
         owa_coreAPI::debug('No capability passed or user is an admin and capable of everything.');
         return true;
     }
     // is this user's role capable?
     if (!in_array($cap, $this->capabilities)) {
         owa_coreAPI::debug('capability does not exist for this role. user is not capable');
         return false;
     }
     // Does capability also require site access?
     if ($this->isSiteAccessRequiredForCapability($cap)) {
         owa_coreAPI::debug('Site access required for this capability.');
         if (!$this->isSiteAccessible($siteId)) {
             owa_coreAPI::debug('Site is not accessible for this user.');
             return false;
         } else {
             owa_coreAPI::debug('Site is accessible for this user.');
         }
     }
     return true;
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:35,代码来源:serviceUser.php

示例2: isEveryoneCapable

 protected function isEveryoneCapable($capability)
 {
     return owa_coreAPI::isEveryoneCapable($capability);
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:4,代码来源:owa_controller.php


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