MM-10007 Send an admin and regular WS events when a user is updated (#8588)

* Add user.DeepCopy() function

* Add omit admins/non-admins to WS broadcast and use for updating users

* Updates per feedback and adding unit test for ShouldSendEvent
Этот коммит содержится в:
Joram Wilander
2018-04-20 08:44:18 -04:00
коммит произвёл GitHub
родитель 7987c95fcd
Коммит 283f34b9c6
9 изменённых файлов: 197 добавлений и 5 удалений

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

@@ -31,6 +31,8 @@ type TestHelper struct {
BasicChannel *model.Channel
BasicPost *model.Post
SystemAdminUser *model.User
tempConfigPath string
tempWorkspace string
pluginHooks map[string]plugin.Hooks
@@ -143,6 +145,14 @@ func (me *TestHelper) InitBasic() *TestHelper {
return me
}
func (me *TestHelper) InitSystemAdmin() *TestHelper {
me.SystemAdminUser = me.CreateUser()
me.App.UpdateUserRoles(me.SystemAdminUser.Id, model.SYSTEM_USER_ROLE_ID+" "+model.SYSTEM_ADMIN_ROLE_ID, false)
me.SystemAdminUser, _ = me.App.GetUser(me.SystemAdminUser.Id)
return me
}
func (me *TestHelper) MakeEmail() string {
return "success_" + model.NewId() + "@simulator.amazonses.com"
}