MM-13512 Prevent getting a user by email based on privacy settings (#10021)

* MM-13512 Prevent getting a user by email based on privacy settings

* Add additional config settings to tests
Этот коммит содержится в:
Harrison Healey
2018-12-18 16:04:25 -05:00
коммит произвёл GitHub
родитель 8b2ceaff8b
Коммит f639c7c617
4 изменённых файлов: 118 добавлений и 50 удалений

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

@@ -930,13 +930,19 @@ func (a *App) UpdateActive(user *model.User, active bool) (*model.User, *model.A
return ruser, nil
}
func (a *App) SanitizeProfile(user *model.User, asAdmin bool) {
func (a *App) GetSanitizeOptions(asAdmin bool) map[string]bool {
options := a.Config().GetSanitizeOptions()
if asAdmin {
options["email"] = true
options["fullname"] = true
options["authservice"] = true
}
return options
}
func (a *App) SanitizeProfile(user *model.User, asAdmin bool) {
options := a.GetSanitizeOptions(asAdmin)
user.SanitizeProfile(options)
}