diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 6e686be..9026300 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,45 +4,10 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -77,34 +42,34 @@
- {
+ "keyToString": {
+ "DefaultGoTemplateProperty": "Go File",
+ "Go Build.Backend.executor": "Debug",
+ "Go 构建.Backend.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.go.formatter.settings.were.checked": "true",
+ "RunOnceActivity.go.migrated.go.modules.settings": "true",
+ "RunOnceActivity.go.modules.automatic.dependencies.download": "true",
+ "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
+ "git-widget-placeholder": "refactor/nexus",
+ "go.import.settings.migrated": "true",
+ "go.sdk.automatically.set": "true",
+ "last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/keys",
+ "node.js.detected.package.eslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "run.code.analysis.last.selected.profile": "pProject Default",
+ "settings.editor.selected.configurable": "preferences.intentionPowerPack",
+ "ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib",
+ "vue.rearranger.settings.migration": "true"
},
- "keyToStringList": {
- "DatabaseDriversLRU": [
- "postgresql"
+ "keyToStringList": {
+ "DatabaseDriversLRU": [
+ "postgresql"
]
}
-}]]>
+}
@@ -189,7 +154,6 @@
-
@@ -214,7 +178,8 @@
-
+
+
true
diff --git a/pkg/internal/http/api/accounts_api.go b/pkg/internal/http/api/accounts_api.go
index 6298480..5c15d37 100644
--- a/pkg/internal/http/api/accounts_api.go
+++ b/pkg/internal/http/api/accounts_api.go
@@ -60,7 +60,7 @@ func getUserinfo(c *fiber.Ctx) error {
First(&data).Error; err != nil {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
} else {
- data.PermNodes = c.Locals("permissions").(map[string]any)
+ data.PermNodes = user.PermNodes
}
var resp fiber.Map
diff --git a/pkg/internal/http/exts/auth.go b/pkg/internal/http/exts/auth.go
index b4d911f..a2b0e15 100644
--- a/pkg/internal/http/exts/auth.go
+++ b/pkg/internal/http/exts/auth.go
@@ -19,7 +19,7 @@ func EnsureGrantedPerm(c *fiber.Ctx, key string, val any) error {
if err := EnsureAuthenticated(c); err != nil {
return err
}
- perms := c.Locals("permissions").(map[string]any)
+ perms := c.Locals("user").(*sec.UserInfo).PermNodes
if !services.HasPermNode(perms, key, val) {
return fiber.NewError(fiber.StatusForbidden, fmt.Sprintf("missing permission: %s", key))
}