MM-11713: Does not require edit_own_posts to edit_others_posts. (#14787)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Martin Kraft
2020-06-23 16:08:55 -04:00
коммит произвёл GitHub
родитель 53ef4d120b
Коммит 7c4c038a96
2 изменённых файлов: 25 добавлений и 10 удалений

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

@@ -938,6 +938,21 @@ func TestPatchPost(t *testing.T) {
_, resp := th.SystemAdminClient.PatchPost(post.Id, patch)
CheckNoError(t, resp)
})
t.Run("edit others posts permission can function independently of edit own post", func(t *testing.T) {
th.LoginBasic2()
patch := &model.PostPatch{}
_, resp := Client.PatchPost(post.Id, patch)
CheckForbiddenStatus(t, resp)
// Add permission to edit others'
defer th.RestoreDefaultRolePermissions(th.SaveDefaultRolePermissions())
th.RemovePermissionFromRole(model.PERMISSION_EDIT_POST.Id, model.CHANNEL_USER_ROLE_ID)
th.AddPermissionToRole(model.PERMISSION_EDIT_OTHERS_POSTS.Id, model.CHANNEL_USER_ROLE_ID)
_, resp = Client.PatchPost(post.Id, patch)
CheckNoError(t, resp)
})
}
func TestPinPost(t *testing.T) {