MM-11707: Change the default setting for EDIT_OTHERS_POSTS (#9447)

* MM-11707: Removes edit_others_posts permission from the team_admin role in MakeDefaultRoles().

* MM-11707: Tests fix.

* MM-11707: Update test store.

* MM-11707: Allow to change the permission for edit the others posts on TE

* Fixing tests
Этот коммит содержится в:
Jesús Espino
2018-09-24 15:35:39 +02:00
коммит произвёл GitHub
родитель 89cd752aa1
Коммит 847f30a13b
5 изменённых файлов: 15 добавлений и 12 удалений

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

@@ -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) {

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

@@ -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)