diff --git a/model/bot.go b/model/bot.go index 4ea5379bc5..079e1b157b 100644 --- a/model/bot.go +++ b/model/bot.go @@ -169,6 +169,7 @@ func UserFromBot(b *Bot) *User { Username: b.Username, Email: fmt.Sprintf("%s@localhost", strings.ToLower(b.Username)), FirstName: b.DisplayName, + Roles: SYSTEM_USER_ROLE_ID, } } diff --git a/model/bot_test.go b/model/bot_test.go index e8ea3963af..9b1e8a3cb2 100644 --- a/model/bot_test.go +++ b/model/bot_test.go @@ -508,12 +508,14 @@ func TestUserFromBot(t *testing.T) { Username: "username", Email: "username@localhost", FirstName: "display name", + Roles: "system_user", }, UserFromBot(bot1)) assert.Equal(t, &User{ Id: bot2.UserId, Username: "username2", Email: "username2@localhost", FirstName: "display name 2", + Roles: "system_user", }, UserFromBot(bot2)) }