Skip to content

Commit

Permalink
fixed not visit private tweet detail by self error
Browse files Browse the repository at this point in the history
  • Loading branch information
alimy committed Jan 19, 2025
1 parent 91f3db2 commit bb00e79
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/servants/web/loose.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,8 @@ func (s *looseSrv) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, m
// 检测访问权限
// TODO: 提到最前面去检测
switch {
case req.User.ID == postFormated.User.ID:
//fix 如果是自己 直接查看
break
case req.User != nil && req.User.IsAdmin:
case req.User != nil && (req.User.ID == postFormated.User.ID || req.User.IsAdmin):
// read by self of super admin
break
case post.Visibility == core.PostVisitPublic:
break
Expand Down

0 comments on commit bb00e79

Please sign in to comment.