Improve system admin permissions to dms and gms (#29656)

* revert the api4 portion of 57372bd06b

* test: Add system admin channel access tests

* skip a.HasPermissionToTeam for channels without a team

* fix TestPostGetInfo
Этот коммит содержится в:
Jesse Hallam
2024-12-20 12:49:58 -04:00
коммит произвёл GitHub
родитель 812034f5eb
Коммит 9e01424b15
4 изменённых файлов: 203 добавлений и 9 удалений

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

@@ -214,7 +214,7 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = err
return
}
if !c.IsSystemAdmin() && !c.App.SessionHasPermissionToReadChannel(c.AppContext, *c.AppContext.Session(), channel) {
if !c.App.SessionHasPermissionToReadChannel(c.AppContext, *c.AppContext.Session(), channel) {
c.SetPermissionError(model.PermissionReadChannelContent)
return
}