选择语言 :

 Core_Permission::is_own

判断是否拥有指定权限,支持复合权限

//检查单个权限 $this->is_own('perm2');

//检查复合权限 $this->is_own('perm2','perm2');

boolean Core_Permission::is_own( string $key1 [, ... $key2 = null , $key3 = null ] )

参数列表

参数 类型 描述 默认值
$key1 string $key
$key2 ... null
$key3 unknown null
返回值
  • boolean
File: ./core/classes/permission.class.php
public function is_own($key1, $key2 = null, $key3 = null)
{
    if ($this->is_super_perm())
    {
        # 超级管理员
        return true;
    }

    $keys = func_get_args();
    $is_own = true;
    foreach ($keys as $key)
    {
        $key = trim($key);
        if (!Core::key_string($this->setting, $key))return false;
    }

    return true;
}