diff --git a/agent/cmd/server/conf/app.yaml b/agent/cmd/server/conf/app.yaml index a4f52b67be92..3cddcfca35ea 100644 --- a/agent/cmd/server/conf/app.yaml +++ b/agent/cmd/server/conf/app.yaml @@ -4,7 +4,7 @@ base: is_demo: false is_offline: false is_fxplay: false - is_enterprise: true + is_enterprise: false log: level: debug diff --git a/core/app/auth/auth.go b/core/app/auth/auth.go index 7a386fec8a45..3ae56db90f1d 100644 --- a/core/app/auth/auth.go +++ b/core/app/auth/auth.go @@ -250,6 +250,9 @@ func GetCurrentUserInfo() (*dto.CurrentUserInfo, error) { info.MFAInterval, _ = strconv.Atoi(settingMap["MFAInterval"]) info.ApiKeyValidityTime, _ = strconv.Atoi(settingMap["ApiKeyValidityTime"]) info.Name = settingMap["UserName"] + info.Role = "ADMIN" + info.Permissions = []string{} + info.NodeRoles = []dto.CurrentUserNodeRole{} return &info, nil } func UpdateCurrentUserInfo(c *gin.Context, req dto.CurrentUserUpdate) error { diff --git a/core/app/dto/auth.go b/core/app/dto/auth.go index 02eee5471323..aa2051dba353 100644 --- a/core/app/dto/auth.go +++ b/core/app/dto/auth.go @@ -73,7 +73,19 @@ type CurrentUserInfo struct { ApiKey string `json:"apiKey"` IpWhiteList string `json:"ipWhiteList"` ApiKeyValidityTime int `json:"apiKeyValidityTime"` + + Role string `json:"role"` + Permissions []string `json:"permissions"` + NodeRoles []CurrentUserNodeRole `json:"nodeRoles"` +} + +type CurrentUserNodeRole struct { + NodeID uint `json:"nodeId"` + NodeName string `json:"nodeName"` + RoleID uint `json:"roleId"` + RoleName string `json:"roleName"` } + type CurrentUserUpdate struct { Name string `json:"name" validate:"required"` Password string `json:"password"` diff --git a/core/cmd/server/conf/app.yaml b/core/cmd/server/conf/app.yaml index f3ffa80e7f22..a1a166a29faa 100644 --- a/core/cmd/server/conf/app.yaml +++ b/core/cmd/server/conf/app.yaml @@ -4,7 +4,7 @@ base: is_demo: false is_offline: false is_fxplay: false - is_enterprise: true + is_enterprise: false port: 9999 username: admin password: admin123 @@ -15,4 +15,4 @@ log: time_zone: Asia/Shanghai log_name: 1Panel-Core log_suffix: .log - max_backup: 10 \ No newline at end of file + max_backup: 10