MM-53098 Fix for checking bot and user permissions on shared endpoints (#23751)

* temp commit

* update test to allow bot creation

* add bot check to updateUser and deleteUser

* add more unit tests

* lint fixes

* lint fix

* update based on doc

* add more unit tests

* lint fixes

* fix unit tests

* fix unit tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Scott Bishel
2023-07-10 13:28:40 -06:00
коммит произвёл GitHub
родитель 2abcdfe76a
Коммит 30140c0a27
5 изменённых файлов: 251 добавлений и 10 удалений

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

@@ -106,6 +106,7 @@ func TestCreateBot(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableUserAccessTokens = true })
th.AddPermissionToRole(model.PermissionCreateBot.Id, model.TeamUserRoleId)
th.AddPermissionToRole(model.PermissionManageBots.Id, model.TeamUserRoleId)
th.AddPermissionToRole(model.PermissionEditOtherUsers.Id, model.TeamUserRoleId)
th.App.UpdateUserRoles(th.Context, th.BasicUser.Id, model.TeamUserRoleId+" "+model.SystemUserAccessTokenRoleId, false)