[MM-38579] Removing some town square permissions stuff (#18464)

* removing some town square permissions stuff

* fixing error

* adding back in channel leave check

* removing tests

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Этот коммит содержится в:
Ben Cooke
2021-09-27 21:01:16 -04:00
коммит произвёл GitHub
родитель 74054c74bf
Коммит 0332e1545d
5 изменённых файлов: 0 добавлений и 93 удалений

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

@@ -713,13 +713,6 @@ func saveIsPinnedPost(c *Context, w http.ResponseWriter, isPinned bool) {
return
}
// Restrict pinning if the experimental read-only-town-square setting is on.
user, err := c.App.GetUser(c.AppContext.Session().UserId)
if err != nil {
c.Err = err
return
}
post, err := c.App.GetSinglePost(c.Params.PostId)
if err != nil {
c.Err = err
@@ -727,19 +720,6 @@ func saveIsPinnedPost(c *Context, w http.ResponseWriter, isPinned bool) {
}
auditRec.AddMeta("post", post)
channel, err := c.App.GetChannel(post.ChannelId)
if err != nil {
c.Err = err
return
}
if c.App.Srv().License() != nil &&
channel.Name == model.DefaultChannelName &&
!c.App.RolesGrantPermission(user.GetRoles(), model.PermissionManageSystem.Id) {
c.Err = model.NewAppError("saveIsPinnedPost", "api.post.save_is_pinned_post.town_square_read_only", nil, "", http.StatusForbidden)
return
}
patch := &model.PostPatch{}
patch.IsPinned = model.NewBool(isPinned)