MM-8814: Remove implicit permission grants from post ownership. (#8391)
Этот коммит содержится в:
коммит произвёл
Martin Kraft
родитель
be177caf5f
Коммит
7225abddee
@@ -94,19 +94,6 @@ func (a *App) SessionHasPermissionToUser(session model.Session, userId string) b
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *App) SessionHasPermissionToPost(session model.Session, postId string, permission *model.Permission) bool {
|
||||
post, err := a.GetSinglePost(postId)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if post.UserId == session.UserId {
|
||||
return true
|
||||
}
|
||||
|
||||
return a.SessionHasPermissionToChannel(session, post.ChannelId, permission)
|
||||
}
|
||||
|
||||
func (a *App) HasPermissionTo(askingUserId string, permission *model.Permission) bool {
|
||||
user, err := a.GetUser(askingUserId)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user