本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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();
示例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;
}