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


PHP Permission::Find方法代码示例

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


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

示例1: permissions

 public function permissions($blog_id = null)
 {
     require_once 'class.mt_permission.php';
     $whereOrder = "permission_author_id = " . $this->id;
     if (!is_null($blog_id)) {
         if (is_array($blog_id)) {
             $ids = join(',', $blog_id);
             $whereOrder = $whereOrder . " and permission_blog_id in ( {$ids} )";
         } else {
             $whereOrder = $whereOrder . " and permission_blog_id = {$blog_id}";
         }
     }
     $whereOrder = $whereOrder . " order by permission_blog_id";
     $permission = new Permission();
     return $permission->Find($whereOrder);
 }
开发者ID:benvanstaveren,项目名称:movabletype,代码行数:16,代码来源:class.mt_author.php

示例2: loadModulePermissions

 public function loadModulePermissions($group, $name, $userLevel)
 {
     $module = new Module();
     $module->Load("update_path = ?", array($group . ">" . $name));
     $arr = array();
     $arr['user'] = json_decode($module->user_levels, true);
     $permission = new Permission();
     $modulePerms = $permission->Find("module_id = ? and user_level = ?", array($module->id, $userLevel));
     $perms = array();
     foreach ($modulePerms as $p) {
         $perms[$p->permission] = $p->value;
     }
     $arr['perm'] = $perms;
     return $arr;
 }
开发者ID:bravokeyl,项目名称:ems,代码行数:15,代码来源:BaseService.php

示例3: fetch_permission

 public function fetch_permission($args)
 {
     // Blog filter
     if ($sql = $this->include_exclude_blogs($args)) {
         $blog_filter = 'and permission_blog_id ' . $sql;
     } elseif (isset($args['blog_id'])) {
         $blog_id = intval($args['blog_id']);
         $blog_filter = "and permission_blog_id = {$blog_id}";
     }
     // Author filter
     if (isset($args['id'])) {
         $id_filter = 'and permission_author_id in (' . $args['id'] . ')';
     }
     require_once 'class.mt_permission.php';
     $perm = new Permission();
     $where = "1 = 1\n                  {$blog_filter}\n                  {$id_filter}\n                  order by permission_id asc";
     $result = $perm->Find($where);
     return $result;
 }
开发者ID:OCMO,项目名称:movabletype,代码行数:19,代码来源:mtdb.base.php

示例4: includeModuleManager

<?php

//Reset modules if required
if ($settingsManager->getSetting("System: Reset Modules and Permissions") == "1") {
    $permissionTemp = new Permission();
    $permissions = $permissionTemp->Find("1=1");
    foreach ($permissions as $permTemp) {
        $permTemp->Delete();
    }
    $moduleTemp = new Module();
    $modulesTemp = $moduleTemp->Find("1=1");
    foreach ($modulesTemp as $moduleTemp) {
        $moduleTemp->Delete();
    }
    $settingsManager->setSetting("System: Reset Modules and Permissions", "0");
}
$addNewPermissions = false;
if ($settingsManager->getSetting("System: Add New Permissions") == "1") {
    $addNewPermissions = true;
    $settingsManager->setSetting("System: Add New Permissions", "0");
}
function includeModuleManager($type, $name)
{
    global $moduleManagers;
    $moduleCapsName = ucfirst($name);
    $moduleTypeCapsName = ucfirst($type);
    // Admin or Modules
    $incFile = CLIENT_PATH . '/' . $type . '/' . $name . '/api/' . $moduleCapsName . $moduleTypeCapsName . "Manager.php";
    include $incFile;
    $moduleManagerClass = $moduleCapsName . $moduleTypeCapsName . "Manager";
    $moduleManagers[] = new $moduleManagerClass();
开发者ID:riazuddinahmed1,项目名称:icehrm-1,代码行数:31,代码来源:modules.php

示例5: loadModulePermissions

 public function loadModulePermissions($group, $name, $userLevel)
 {
     $module = new Module();
     $module->Load("update_path = ?", array($group . ">" . $name));
     LogManager::getInstance()->info(" Current Mod :" . json_encode($module));
     $arr = array();
     $arr['user'] = json_decode($module->user_levels, true);
     $arr['user_roles'] = !empty($module->user_roles) ? json_decode($module->user_roles, true) : array();
     $permission = new Permission();
     $modulePerms = $permission->Find("module_id = ? and user_level = ?", array($module->id, $userLevel));
     $perms = array();
     foreach ($modulePerms as $p) {
         $perms[$p->permission] = $p->value;
     }
     $arr['perm'] = $perms;
     return $arr;
 }
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:17,代码来源:BaseService.php


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