[MM-20061] Add System Admin filter to both LDAP and SAML (#13534)

* promote user to admin upon login

* Add SAML support for admin accounts

* update en.json

* update i18n

* Add tests as per comments

* change function name

* fix config.go

* invalidate cache so its not checking for cache when roles change

* add enable attribute and filter
Этот коммит содержится в:
Hossein Ahmadian-Yazdi
2020-01-13 12:50:01 -05:00
коммит произвёл GitHub
родитель 5f7ca55b13
Коммит dc24c9abe8
6 изменённых файлов: 183 добавлений и 12 удалений

Просмотреть файл

@@ -1435,6 +1435,7 @@ func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent
mlog.Error("Failed during updating user roles", mlog.Err(result.Err))
}
a.InvalidateCacheForUser(user.Id)
a.ClearSessionCacheForUser(user.Id)
if sendWebSocketEvent {
@@ -2313,6 +2314,8 @@ func (a *App) PromoteGuestToUser(user *model.User, requestorId string) *model.Ap
}
}
a.InvalidateCacheForUser(user.Id)
a.ClearSessionCacheForUser(user.Id)
return nil
}
@@ -2354,6 +2357,9 @@ func (a *App) DemoteUserToGuest(user *model.User) *model.AppError {
}
}
a.InvalidateCacheForUser(user.Id)
a.ClearSessionCacheForUser(user.Id)
return nil
}