mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
feat(keystone): add options to set admin and domain admin role to notify
This commit is contained in:
@@ -131,7 +131,7 @@ func fetchRoleId(name string) (string, error) {
|
||||
}
|
||||
|
||||
func getAdminUserIds() ([]string, error) {
|
||||
return getUserIdsWithRole("admin", "")
|
||||
return getUserIdsWithRole(o.Options.AdminRoleToNotify, "")
|
||||
}
|
||||
|
||||
func getUserIdsWithRole(roleName string, domainId string) ([]string, error) {
|
||||
@@ -152,7 +152,7 @@ func getUserIdsWithRole(roleName string, domainId string) ([]string, error) {
|
||||
}
|
||||
|
||||
func getDomainAdminUserIds(domainId string) ([]string, error) {
|
||||
return getUserIdsWithRole("domainadmin", domainId)
|
||||
return getUserIdsWithRole(o.Options.DomainAdminRoleToNotify, domainId)
|
||||
}
|
||||
|
||||
func (sql *SSQLDriver) Sync(ctx context.Context) error {
|
||||
|
||||
@@ -56,6 +56,9 @@ type SKeystoneOptions struct {
|
||||
AllowJoinProjectsAcrossDomains bool `help:"allow users/groups to join projects across domains" default:"false"`
|
||||
|
||||
DefaultUserLanguage string `help:"default user language, default to zh-CN" default:"zh-CN"`
|
||||
|
||||
DomainAdminRoleToNotify string `help:"domain admin role to notify" default:"domainadmin"`
|
||||
AdminRoleToNotify string `help:"admin role to notify" default:"admin"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user