From 9a6c9489f96697d64e8dafb018db881733aba39e Mon Sep 17 00:00:00 2001 From: xushuhui Date: Thu, 21 Apr 2022 15:52:26 +0800 Subject: [PATCH] fix: (rbac) permission Privilege --- internal/biz/permission.go | 26 +++++++++++++------------- internal/dto/role.go | 6 +++--- model/rbac/role.go | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/biz/permission.go b/internal/biz/permission.go index c954a2f6..d3b1c24f 100644 --- a/internal/biz/permission.go +++ b/internal/biz/permission.go @@ -40,10 +40,10 @@ type ConsolePermisson struct { Menu []Menu `json:"menu"` } type Menu struct { - Id string `json:"id"` - Name string `json:"name"` - Permission []string `json:"permission,omitempty"` - Children []Menu `json:"children,omitempty"` + Id string `json:"id"` + Name string `json:"name"` + Privilege []string `json:"privilege,omitempty"` + Children []Menu `json:"children,omitempty"` } func (r ConsoleRole) ListPermission() interface{} { @@ -68,20 +68,20 @@ func (r ConsoleRole) ListPermission() interface{} { Name: "平台管理", Children: []Menu{ { - Id: "cluster_overview", - Name: "平台概览", - Permission: []string{"none", "write", "read"}, + Id: "cluster_overview", + Name: "平台概览", + Privilege: []string{"none", "write", "read"}, }, { - Id: "cluster_elasticsearch", - Name: "集群监控", - Permission: []string{"none", "write", "read"}, + Id: "cluster_elasticsearch", + Name: "集群监控", + Privilege: []string{"none", "write", "read"}, }, { - Id: "cluster_activities", - Name: "集群动态", - Permission: []string{"none", "write", "read"}, + Id: "cluster_activities", + Name: "集群动态", + Privilege: []string{"none", "write", "read"}, }, }, }, diff --git a/internal/dto/role.go b/internal/dto/role.go index ca5e65e3..9384db71 100644 --- a/internal/dto/role.go +++ b/internal/dto/role.go @@ -11,9 +11,9 @@ type RolePermission struct { Menu []Menu `json:"menu"` } type Menu struct { - Id string `json:"id"` - Name string `json:"name"` - Switch string `json:"switch"` + Id string `json:"id"` + Name string `json:"name"` + Privilege string `json:"privilege"` } type UpdateConsoleRole struct { Description string `json:"description" ` diff --git a/model/rbac/role.go b/model/rbac/role.go index dea4bdf0..1e5f2612 100644 --- a/model/rbac/role.go +++ b/model/rbac/role.go @@ -18,9 +18,9 @@ type ConsolePermission struct { } type Menu struct { - Id string `json:"id"` - Name string `json:"name"` - Permission string `json:"permission"` + Id string `json:"id"` + Name string `json:"name"` + Privilege string `json:"privilege"` } type ElasticsearchPermission struct { Cluster []string `json:"cluster" elastic_mapping:"cluster:{type:object}"`