|
@@ -309,5 +309,29 @@ class User extends Base_Controller{
|
|
|
exit(json_result('0000',$this->response['0000'],array('list'=>$res)));
|
|
|
}
|
|
|
|
|
|
+ // 修改用户权限
|
|
|
+ public function save_user_privilege(){
|
|
|
+ // $role = $this->get_user_info('role');
|
|
|
+
|
|
|
+ $privilegeIds = $this->input->post('privilegeIds',true);
|
|
|
+ $userid = $this->input->post('userid',true);
|
|
|
+
|
|
|
+ // $res = $this->User_model->get_one($userid);
|
|
|
+ // 判断用户权限
|
|
|
+ // if ($role >= $res['role']) {
|
|
|
+ // exit(json_result('0011',$this->response['0011'],array()));
|
|
|
+ // }
|
|
|
+
|
|
|
+ // 参数判断
|
|
|
+ // if (empty($privilegeIds) || empty($userid)) {
|
|
|
+ // json_result('0000',$this->response['0000'],array());
|
|
|
+ // }
|
|
|
+
|
|
|
+ $this->User_model->update(['privilege'=>$privilegeIds],['id'=>$userid]);
|
|
|
+ $this->add_operation_log('update','修改用户权限 id:'.$userid,0);
|
|
|
+ $this->add_operation_log('update','Update user rights.User ID:'.$userid,0,1);
|
|
|
+
|
|
|
+ exit(json_result('0000',$this->response['0000'],array()));
|
|
|
+ }
|
|
|
}
|
|
|
?>
|