From fe737726a11de8615772cbe80ff61d6d3fe75874 Mon Sep 17 00:00:00 2001 From: tengge1 <930372551@qq.com> Date: Sun, 29 Mar 2020 10:38:11 +0800 Subject: [PATCH] authorities --- ShadowEditor.Server.Go/helper/user.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ShadowEditor.Server.Go/helper/user.go b/ShadowEditor.Server.Go/helper/user.go index b52b730b..6372e60e 100644 --- a/ShadowEditor.Server.Go/helper/user.go +++ b/ShadowEditor.Server.Go/helper/user.go @@ -59,6 +59,15 @@ func GetUser(userID string) (*system.User, error) { user.RoleID = role.ID user.RoleName = role.Name + user.OperatingAuthorities = []string{} + + if role.Name == "Administrator" { + for _, item := range GetAllOperatingAuthorities() { + user.OperatingAuthorities = append(user.OperatingAuthorities, item.ID) + } + } else { + + } } }