summaryrefslogtreecommitdiffstats
path: root/api4
diff options
context:
space:
mode:
Diffstat (limited to 'api4')
-rw-r--r--api4/post_test.go10
-rw-r--r--api4/role.go1
2 files changed, 9 insertions, 2 deletions
diff --git a/api4/post_test.go b/api4/post_test.go
index 8ccd88a42..3c9875975 100644
--- a/api4/post_test.go
+++ b/api4/post_test.go
@@ -587,6 +587,12 @@ func TestUpdatePost(t *testing.T) {
Client.Logout()
+ th.LoginTeamAdmin()
+ _, resp = Client.UpdatePost(rpost.Id, rpost)
+ CheckForbiddenStatus(t, resp)
+
+ Client.Logout()
+
_, resp = th.SystemAdminClient.UpdatePost(rpost.Id, rpost)
CheckNoError(t, resp)
}
@@ -673,7 +679,7 @@ func TestPatchPost(t *testing.T) {
th.LoginTeamAdmin()
_, resp = Client.PatchPost(post.Id, patch)
- CheckNoError(t, resp)
+ CheckForbiddenStatus(t, resp)
_, resp = th.SystemAdminClient.PatchPost(post.Id, patch)
CheckNoError(t, resp)
@@ -1599,7 +1605,7 @@ func TestSearchPostsWithDateFlags(t *testing.T) {
posts, _ = Client.SearchPosts(th.BasicTeam.Id, "before:2018-08-03 after:2018-08-01", false)
if len(posts.Order) != 1 {
t.Fatalf("wrong number of posts returned %v", len(posts.Order))
- }
+ }
}
func TestGetFileInfosForPost(t *testing.T) {
diff --git a/api4/role.go b/api4/role.go
index 4e367629b..384738c36 100644
--- a/api4/role.go
+++ b/api4/role.go
@@ -104,6 +104,7 @@ func patchRole(c *Context, w http.ResponseWriter, r *http.Request) {
model.PERMISSION_MANAGE_OAUTH.Id,
model.PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH.Id,
model.PERMISSION_MANAGE_EMOJIS.Id,
+ model.PERMISSION_EDIT_OTHERS_POSTS.Id,
}
changedPermissions := model.PermissionsChangedByPatch(oldRole, patch)