From 5200e00c9bf14a33f622a456f30a2f7065e4ef35 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 3 Jul 2024 22:36:42 +0800 Subject: [PATCH] :recycle: Optimized the initial permission system --- .idea/workspace.xml | 61 +++++++++++++++---------------- pkg/internal/services/accounts.go | 4 +- settings.toml | 7 +++- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bcc541f..b1dfad2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,13 +4,10 @@ - @@ -181,7 +177,8 @@ - true diff --git a/pkg/internal/services/accounts.go b/pkg/internal/services/accounts.go index 3bb3fd6..ea62583 100644 --- a/pkg/internal/services/accounts.go +++ b/pkg/internal/services/accounts.go @@ -118,8 +118,8 @@ func ConfirmAccount(code string) error { for k, v := range viper.GetStringMap("permissions.verified") { if val, ok := user.PermNodes[k]; !ok { user.PermNodes[k] = v - } else if !ComparePermNode(val, v) { - user.PermNodes[k] = v + } else { + user.PermNodes[k] = val } } diff --git a/settings.toml b/settings.toml index 8e6d066..1bd3f34 100644 --- a/settings.toml +++ b/settings.toml @@ -44,7 +44,10 @@ dsn = "host=localhost user=postgres password=password dbname=hy_passport port=54 prefix = "passport_" [permissions.default] -CreatePaperclipAttachments = 1048576 +CreatePost = true +CreateAttachments = 1048576 [permissions.verified] -CreatePaperclipAttachments = 26214400 +CreateRealm = true +CreateArticle = true +CreateAttachments = 26214400