Skip to content

Commit

Permalink
fix: 修复获取帖子的鉴权错误 (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansongxx authored Feb 19, 2024
1 parent ed68f34 commit d925d9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion biz/application/service/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s *PostService) GetPost(ctx context.Context, req *core_api.GetPostReq) (re
}

// 如果该帖子非公开,并且不是他的,那么他没有权限查看
if res.Status != int64(core_api.PostStatus_PrivatePostStatus) && res.UserId != userData.GetUserId() {
if res.Status != int64(core_api.PostStatus_PublicPostStatus) && res.UserId != userData.GetUserId() {
return resp, consts.ErrForbidden
}

Expand Down

0 comments on commit d925d9d

Please sign in to comment.