Просмотр исходного кода

버그 수정 및 Vote 권한 추가

잉여개발기 (SPDV) 1 год назад
Родитель
Сommit
e55dd08ba4

+ 2 - 0
route/give_admin_groups.py

@@ -22,6 +22,8 @@ def give_admin_groups(name = 'test'):
             [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
             [3, 'bbs', get_lang(conn, 'bbs_authority')],
             [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
+            [3, 'vote', get_lang(conn, 'vote_authority')],
+            [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
             [3, 'admin_default_feature', get_lang(conn, 'admin_default_feature_authority')],
             [4, 'treat_as_admin', get_lang(conn, 'treat_as_admin_authority')],
             [4, 'user_name_bold', get_lang(conn, 'user_name_bold_authority')],

+ 0 - 1
route/tool/func.py

@@ -1900,7 +1900,6 @@ def level_check(conn, ip = ''):
     return [level, exp, max_exp]
 
 def acl_check(name = '', tool = '', topic_num = '', ip = '', memo = ''):
-    name = '' if name == None else name
     ip = ip_check() if ip == '' else ip
 
     other_set = {}

+ 1 - 1
route/view_set.py

@@ -43,7 +43,7 @@ def view_set(name = 'Test', multiple = False):
             if flask.request.method == 'POST':
                 check_data = 'document_set (' + name + ')'
             else:
-                check_data = None
+                check_data = ''
 
             user_data = re.search(r'^user:(.+)$', name)
             if user_data:

+ 1 - 1
route/vote_close.py

@@ -17,7 +17,7 @@ def vote_close(num = 1):
         curs.execute(db_change('select data from vote where id = ? and name = "open_user" and type = "option"'), [num])
         db_data = curs.fetchall()
         open_user = db_data[0][0] if db_data else ''
-        if open_user != ip_check() and acl_check('', 'owner_auth', '', '') == 1:
+        if open_user != ip_check() and acl_check('', 'vote_auth', '', '') == 1:
             return re_error(conn, '/ban')
 
         if data_list[0][0] == 'close':

BIN
route_go/bin/main.amd64.bin


BIN
route_go/bin/main.amd64.exe


BIN
route_go/bin/main.arm64.bin


BIN
route_go/bin/main.arm64.exe


+ 5 - 2
route_go/route/tool/acl_and_auth.go

@@ -128,7 +128,7 @@ func Check_auth(auth_info map[string]bool) map[string]bool {
 		auth_info["admin"] = true
 	}
 
-	admin_auth := []string{"ban", "toron", "check", "acl", "hidel", "give", "bbs"}
+	admin_auth := []string{"ban", "toron", "check", "acl", "hidel", "give", "bbs", "vote"}
 
 	if _, ok := auth_info["admin"]; ok {
 		for _, v := range admin_auth {
@@ -306,6 +306,9 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 		} else if tool == "give_auth" {
 			acl_pass_auth = "give"
 			acl_data = "owner"
+		} else if tool == "vote_auth" {
+			acl_pass_auth = "vote_fix"
+			acl_data = "owner"
 		} else if tool == "" {
 			acl_pass_auth = "acl"
 
@@ -513,7 +516,7 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 				}
 			}
 		} else if tool == "vote" {
-			acl_pass_auth = "owner"
+			acl_pass_auth = "vote_fix"
 
 			if for_a == 0 {
 				end_number += 1