當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。