MM-11713: Does not require edit_own_posts to edit_others_posts. (#14787)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
53ef4d120b
Коммит
7c4c038a96
@@ -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) {
|
||||
|
||||
Ссылка в новой задаче
Block a user