优化权限修改

master
chenzhi 4 years ago
parent 753098a85f
commit 0f82acf447

@ -116,6 +116,7 @@ return array(
'OFFICIEL_CHANNEL'=>"江息网络",
/*分库的表格*/
'SUBSITE_TABLE'=>[
"tab_spend"
"tab_spend",
"sys_auth_group"
]
);

@ -147,7 +147,7 @@ class AuthManagerController extends AdminController{
*/
public function access(){
$this->updateRules();
$auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
$auth_group = SM('auth_group',"sys_")->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
->getfield('id,id,title,rules');
$node_list = $this->returnNodes();
$map = array('module'=>'admin','type'=>AuthRuleModel::RULE_MAIN,'status'=>1);
@ -220,7 +220,7 @@ class AuthManagerController extends AdminController{
if ( $data ) {
if ( empty($data['id']) ) {
\Think\Log::actionLog('AuthManager/createGroup','authGroup',1);
$r = $AuthGroup->add();
$r = SM("auth_group","sys_")->add($data);
addOperationLog(array(
"op_type"=>0,
"key"=> $_POST['title'],
@ -228,7 +228,8 @@ class AuthManagerController extends AdminController{
));
}else{
\Think\Log::actionLog('AuthManager/editGroup','authGroup',1);
$r = $AuthGroup->save();
$r = SM("auth_group","sys_")->save($data);
// dd($r);
//操作日志不传title表示是访问授权
$oparr = array(
"op_type"=>1,

@ -5,15 +5,16 @@
<h3 class="page_title">角色权限</h3>
<p class="description_text">说明:可以设置管理账号的不同操作权限</p>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<a id="add-group" class="" href="{:U('createGroup')}"><span class="button_icon button_icon1"></span>新增</a>
<a url="{:U('changestatus?method=resumeGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon4"></span>正常</a>
<a url="{:U('changestatus?method=forbidGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon5"></span>禁用</a>
<a url="{:U('changestatus?method=deleteGroup')}" class="ajax-post confirm" target-form="ids" ><span class="button_icon button_icon2"></span>删除</a>
</div>
</div>
<if condition="!IS_SUBSITE">
<div class="cf top_nav_list">
<div class="fl button_list">
<a id="add-group" class="" href="{:U('createGroup')}"><span class="button_icon button_icon1"></span>新增</a>
<a url="{:U('changestatus?method=resumeGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon4"></span>正常</a>
<a url="{:U('changestatus?method=forbidGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon5"></span>禁用</a>
<a url="{:U('changestatus?method=deleteGroup')}" class="ajax-post confirm" target-form="ids" ><span class="button_icon button_icon2"></span>删除</a>
</div>
</div>
</if>
<!-- 数据列表 -->
<div class="data_list">
<table class="">
@ -33,7 +34,13 @@
<volist name="_list" id="vo">
<tr>
<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
<td><a href="{:U('AuthManager/editgroup?id='.$vo['id'])}">{$vo.title}</a> </td>
<td>
<if condition="IS_SUBSITE">
{$vo.title}
<else />
<a href="{:U('AuthManager/editgroup?id='.$vo['id'])}">{$vo.title}</a>
</if>
</td>
<td>
<span>
<empty name="vo['description']">
@ -43,25 +50,31 @@
</empty>
</span>
</td>
<td><a href="{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >访问授权</a>
<a href="{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >分类授权</a>
<a href="{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
<a href="{:U('AuthManager/dataempower?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >数据授权</a>
<if condition="$vo['id'] eq 11 or $vo['id'] eq 12 or $vo['id'] eq 21">
<a href="{:U('AuthManager/AuthMarketMember?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >市场专员分成</a>
<td>
<a href="{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >访问授权</a>
<if condition="!IS_SUBSITE">
<a href="{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >分类授权</a>
<a href="{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
<a href="{:U('AuthManager/dataempower?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >数据授权</a>
<if condition="$vo['id'] eq 11 or $vo['id'] eq 12 or $vo['id'] eq 21">
<a href="{:U('AuthManager/AuthMarketMember?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >市场专员分成</a>
</if>
</if>
</td>
<td>
<eq name="vo.status" value="1"><span class="enabled_status">{:get_status_title($vo['status'])}</span>
<else /><span class="disabled_status">{:get_status_title($vo['status'])}</span></eq>
</td>
<td><eq name="vo.status" value="1">
<a href="{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}" class="ajax-get">禁用</a>
<else/>
<a href="{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}" class="ajax-get">正常</a>
</eq>
<a href="{:U('AuthManager/changeStatus?method=deleteGroup&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
</td>
<td>
<if condition="!IS_SUBSITE">
<eq name="vo.status" value="1">
<a href="{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}" class="ajax-get">禁用</a>
<else/>
<a href="{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}" class="ajax-get">正常</a>
</eq>
<a href="{:U('AuthManager/changeStatus?method=deleteGroup&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
</if>
</td>
</tr>
</volist>
<else/>

Loading…
Cancel
Save