Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/cmd/server/conf/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ base:
is_demo: false
is_offline: false
is_fxplay: false
is_enterprise: true
is_enterprise: false

log:
level: debug
Expand Down
3 changes: 3 additions & 0 deletions core/app/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 12 additions & 0 deletions core/app/dto/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 2 additions & 2 deletions core/cmd/server/conf/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,4 +15,4 @@ log:
time_zone: Asia/Shanghai
log_name: 1Panel-Core
log_suffix: .log
max_backup: 10
max_backup: 10
Loading