Auth: Allow to auto-assign empty role (#73326)

Allow to auto-assign empty role
This commit is contained in:
linoman 2023-08-17 18:32:58 +02:00 committed by GitHub
parent f33f3a55a0
commit 2e050f25bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -965,7 +965,7 @@ func TestMetricsUsage(t *testing.T) {
_, usrSvc := createOrgAndUserSvc(t, ss, ss.Cfg)
t.Run("", func(t *testing.T) {
t.Run("Get empty role metrics for an org", func(t *testing.T) {
orgId := int64(1)
// create first user

View File

@ -1680,6 +1680,7 @@ func readUserSettings(iniFile *ini.File, cfg *Cfg) error {
cfg.AutoAssignOrgId = users.Key("auto_assign_org_id").MustInt(1)
cfg.AutoAssignOrgRole = users.Key("auto_assign_org_role").In(
string(roletype.RoleViewer), []string{
string(roletype.RoleNone),
string(roletype.RoleViewer),
string(roletype.RoleEditor),
string(roletype.RoleAdmin)})