Forráskód Böngészése

如果修改了部门,则清空权限

ith5 6 hónapja
szülő
commit
6e4204acdc
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      plugin/saiadmin/app/logic/system/SystemUserLogic.php

+ 6 - 0
plugin/saiadmin/app/logic/system/SystemUserLogic.php

@@ -127,6 +127,12 @@ class SystemUserLogic extends BaseLogic
                     throw new ApiException('没有权限操作该角色数据');
                 }
             }
+            // 如果修改了部门,则清空权限
+            if ($user->dept_id != $data['dept_id']) {
+                $data['game_list'] = null;
+                $data['normal_game_list'] = null;
+                $data['ad_permission'] = null;
+            }
             $result = parent::edit($id, $data);
             if ($result) {
                 $user->roles()->detach();