沒人響應(yīng),自己照葫蘆畫瓢勉強(qiáng)改了一下能用,不知對(duì)別的功能有沒有影響,暫時(shí)不管了,等碰到了再解決。
我的辦法是:將/application/admin/controller/Form.php中權(quán)限判斷的這段
if (empty($typeid)) {
/*權(quán)限控制 by 小虎哥*/
$admin_info = session('admin_info');
if (0 < intval($admin_info['role_id'])) {
$auth_role_info = $admin_info['auth_role_info'];
echo 'Role ID: ' . $admin_info['role_id'] . '<br>';
var_dump($auth_role_info);
if(! empty($auth_role_info)){
$is_notaccess = false;
$permission_arctype = !empty($auth_role_info['permission']['arctype']) ? $auth_role_info['permission']['arctype'] : [];
var_dump($permission_arctype);
if(!empty($permission_arctype)){
$typeids_tmp = Db::name('arctype')->where(['current_channel'=>8,'lang'=>$this->admin_lang])->cache(true, EYOUCMS_CACHE_TIME, 'arctype')->column('id');
echo 'Article Category IDs: ';
var_dump($typeids_tmp);
$typeids_tmp = !empty($typeids_tmp) ? $typeids_tmp : [];
$typeids_tmp1 = array_intersect($typeids_tmp, $auth_role_info['permission']['arctype']);
if (!empty($typeids_tmp1)) {
$is_notaccess = true;
$typeids_tmp2 = implode(',', $typeids_tmp1);
$rawstr = " (a.typeid IN ({$typeids_tmp2}) AND a.form_type = 0) ";
echo 'Raw String: ' . $rawstr . '<br>';
$formids_tmp1 = Db::name('form')->where(['lang'=>$this->admin_lang])->cache(true, EYOUCMS_CACHE_TIME, 'form')->column('form_id');
if (!empty($formids_tmp1)) {
$formids_tmp2 = implode(',', $formids_tmp1);
$rawstr .= " OR (a.typeid IN ({$formids_tmp2}) AND a.form_type = 1) ";
echo 'Updated Raw String: ' . $rawstr . '<br>';
}
$condition[] = Db::raw("({$rawstr})");
}
}
if (false === $is_notaccess) {
$this->error('您沒有操作權(quán)限,請(qǐng)聯(lián)系超級(jí)管理員分配權(quán)限');
}
}
}
/*--end*/
}
替換成:
if (empty($typeid)) {
$admin_info = session('admin_info');
if (0 < intval($admin_info['role_id'])) {
$auth_role_info = $admin_info['auth_role_info'];
if (!empty($auth_role_info) && intval($auth_role_info['switch_map']) != 1) {
$this->error('您沒有操作權(quán)限,請(qǐng)聯(lián)系超級(jí)管理員分配權(quán)限');
}
}
}