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

버그 수정 및 새 토론 생성 권한 추가

https://github.com/openNAMU/openNAMU/issues/2263
잉여개발기 (SPDV) 1 год назад
Родитель
Сommit
2067fac3c4

+ 1 - 0
lang/en-US.json

@@ -39,6 +39,7 @@
     "bbs_management_authority" : "BBS management authority",
     "discuss_view_authority" : "Discussion view authority",
     "page_view" : "Page views",
+    "discuss_make_new_thread_authority" : "Create a new discussion authority",
 
     "_comment_" : "Common",
     "data" : "Data",

+ 2 - 1
lang/ko-KR.json

@@ -685,5 +685,6 @@
     "vote_management_authority" : "투표 관리 권한",
     "bbs_management_authority" : "BBS 관리 권한",
     "discuss_view_authority" : "토론 보기 권한",
-    "page_view" : "조회수"
+    "page_view" : "조회수",
+    "discuss_make_new_thread_authority" : "새 토론 만들기 권한"
 }

+ 2 - 0
route/give_admin_groups.py

@@ -51,6 +51,8 @@ def give_admin_groups(name = 'test'):
                             [5, '', get_lang(conn, 'view_authority')],
                         [4, 'view', get_lang(conn, 'view_authority')],
                     [3, 'discuss', get_lang(conn, 'discuss_authority')],
+                        [4, 'discuss_make_new_thread', get_lang(conn, 'discuss_make_new_thread_authority')],
+                            [5, '', get_lang(conn, 'discuss_view_authority')],
                         [4, 'discuss_view', get_lang(conn, 'discuss_view_authority')],
                     [3, 'upload', get_lang(conn, 'upload_authority')],
                     [3, 'vote', get_lang(conn, 'vote_authority')],

+ 3 - 0
route/topic.py

@@ -31,6 +31,9 @@ def topic(topic_num = 0, do_type = '', doc_name = 'Test'):
         topic_view_acl = acl_check('', 'topic_view', topic_num)
         if topic_view_acl == 1:
             return re_error(conn, 0)
+        elif topic_num == '0':
+            if acl_check('', 'discuss_make_new_thread', topic_num) == 1:
+                return re_error(conn, 0)
 
         ip = ip_check()
 

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


+ 16 - 0
route_go/route/tool/acl_and_auth.go

@@ -229,6 +229,14 @@ func Check_auth(auth_info map[string]bool) map[string]bool {
 		auth_info["view"] = true
 	}
 
+	topic_default := []string{"discuss_view", "discuss_make_new_thread"}
+
+	if _, ok := auth_info["discuss"]; ok {
+		for _, v := range topic_default {
+			auth_info[v] = true
+		}
+	}
+
 	bbs_default := []string{"bbs_edit", "bbs_comment"}
 
 	if _, ok := auth_info["bbs_use"]; ok {
@@ -763,6 +771,14 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 					acl_data = "owner"
 				}
 			}
+		} else if tool == "discuss_make_new_thread" {
+			acl_pass_auth = "toron"
+
+			if auth_info["discuss_make_new_thread"] {
+				acl_data = ""
+			} else {
+				acl_data = "owner"
+			}
 		} else if tool == "recaptcha" {
 			acl_pass_auth = "admin_default_feature"
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-v170",
+        "r_ver" : "v3.5.0-v171",
         "c_ver" : "20240513",
         "s_ver" : "20240426"
     }