fix settings and idm admin user id configuration
This commit is contained in:
@@ -23,6 +23,8 @@ type Config struct {
|
||||
DataPath string `yaml:"data_path" env:"SETTINGS_DATA_PATH"`
|
||||
Metadata Metadata `yaml:"metadata_config"`
|
||||
|
||||
AdminUserID string `yaml:"admin_user_id" env:"OCIS_ADMIN_USER_ID;SETTINGS_ADMIN_USER_ID"`
|
||||
|
||||
Asset Asset `yaml:"asset"`
|
||||
TokenManager *TokenManager `yaml:"token_manager"`
|
||||
|
||||
|
||||
@@ -96,6 +96,10 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
if cfg.Metadata.SystemUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" {
|
||||
cfg.Metadata.SystemUserID = cfg.Commons.SystemUserID
|
||||
}
|
||||
|
||||
if cfg.AdminUserID == "" {
|
||||
cfg.AdminUserID = cfg.Commons.AdminUserID
|
||||
}
|
||||
}
|
||||
|
||||
func Sanitize(cfg *config.Config) {
|
||||
|
||||
@@ -539,7 +539,7 @@ func (g Service) defaultRoleAssignments() []*settingsmsg.UserRoleAssignment {
|
||||
AccountUuid: "058bff95-6708-4fe5-91e4-9ea3d377588b", // demo user "moss"
|
||||
RoleId: BundleUUIDRoleAdmin,
|
||||
}, {
|
||||
AccountUuid: g.config.Commons.AdminUserID,
|
||||
AccountUuid: g.config.AdminUserID,
|
||||
RoleId: BundleUUIDRoleAdmin,
|
||||
},
|
||||
// default users with role "user"
|
||||
|
||||
@@ -504,7 +504,7 @@ func DefaultRoleAssignments(cfg *config.Config) []*settingsmsg.UserRoleAssignmen
|
||||
AccountUuid: "058bff95-6708-4fe5-91e4-9ea3d377588b", // demo user "moss"
|
||||
RoleId: BundleUUIDRoleAdmin,
|
||||
}, {
|
||||
AccountUuid: cfg.Commons.AdminUserID,
|
||||
AccountUuid: cfg.AdminUserID,
|
||||
RoleId: BundleUUIDRoleAdmin,
|
||||
},
|
||||
// default users with role "user"
|
||||
|
||||
Reference in New Issue
Block a user