rabin 3 years ago
parent
commit
e38a6fa8d1
1 changed files with 37 additions and 6 deletions
  1. 37 6
      src/Database.php

+ 37 - 6
src/Database.php

@@ -2985,14 +2985,24 @@ class Database
 
         if ($this->id) {
             # 新增权限
-            if (Dever::load('manage/auth.oper', 3) == false) {
+            if (isset($config['manage']['list']) && $config['manage']['list'] == 'update') {
+                $auth = 1;
+            } else {
+                $auth = 3;
+            }
+            if (Dever::load('manage/auth.oper', $auth) == false) {
                 Dever::alert('你没有权限');
             }
 
             $data = $this->load('one', $this->id);
         } else {
             # 新增权限
-            if (Dever::load('manage/auth.oper', 4) == false) {
+            if (isset($config['manage']['list']) && $config['manage']['list'] == 'update') {
+                $auth = 1;
+            } else {
+                $auth = 4;
+            }
+            if (Dever::load('manage/auth.oper', $auth) == false) {
                 Dever::alert('你没有权限');
             }
         }
@@ -3014,13 +3024,23 @@ class Database
 
         if ($this->id) {
             # 新增权限
-            if (Dever::load('manage/auth.oper', 3) == false) {
+            if (isset($config['manage']['list']) && $config['manage']['list'] == 'update') {
+                $auth = 1;
+            } else {
+                $auth = 3;
+            }
+            if (Dever::load('manage/auth.oper', $auth) == false) {
                 Dever::alert('你没有权限');
             }
             $data = $this->load('one', $this->id);
         } else {
             # 新增权限
-            if (Dever::load('manage/auth.oper', 4) == false) {
+            if (isset($config['manage']['list']) && $config['manage']['list'] == 'update') {
+                $auth = 1;
+            } else {
+                $auth = 4;
+            }
+            if (Dever::load('manage/auth.oper', $auth) == false) {
                 Dever::alert('你没有权限');
             }
         }
@@ -3566,7 +3586,13 @@ class Database
 
         if ($this->id) {
             # 新增权限
-            if (Dever::load('manage/auth.oper', 3) == false) {
+
+            if (isset($config['manage']['list']) && $config['manage']['list'] == 'update') {
+                $auth = 1;
+            } else {
+                $auth = 3;
+            }
+            if (Dever::load('manage/auth.oper', $auth) == false) {
                 Dever::alert('你没有权限');
             }
 
@@ -3606,7 +3632,12 @@ class Database
         }
         if (!$method) {
             # 新增权限
-            if (Dever::load('manage/auth.oper', 4) == false) {
+            if (isset($config['manage']['list']) && $config['manage']['list'] == 'update') {
+                $auth = 1;
+            } else {
+                $auth = 4;
+            }
+            if (Dever::load('manage/auth.oper', $auth) == false) {
                 Dever::alert('你没有权限');
             }