Skip to content

Commit

Permalink
fix: improve condition check. (openimsdk#2815)
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et authored Oct 31, 2024
1 parent 61fc9bf commit 269dd71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/rpc/group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,6 @@ func (g *groupServer) GetSpecifiedUserGroupRequestInfo(ctx context.Context, req
}

if req.UserID != opUserID {
req.UserID = mcontext.GetOpUserID(ctx)
adminIDs, err := g.db.GetGroupRoleLevelMemberIDs(ctx, req.GroupID, constant.GroupAdmin)
if err != nil {
return nil, err
Expand All @@ -1820,10 +1819,11 @@ func (g *groupServer) GetSpecifiedUserGroupRequestInfo(ctx context.Context, req
adminIDs = append(adminIDs, owners[0].UserID)
adminIDs = append(adminIDs, g.config.Share.IMAdminUserID...)

if !datautil.Contain(req.UserID, adminIDs...) {
if !datautil.Contain(opUserID, adminIDs...) {
return nil, errs.ErrNoPermission.WrapMsg("opUser no permission")
}
}

requests, err := g.db.FindGroupRequests(ctx, req.GroupID, []string{req.UserID})
if err != nil {
return nil, err
Expand Down

0 comments on commit 269dd71

Please sign in to comment.