Refactor code

pull/131/head
wenxu12345 3 years ago
parent e39312828c
commit 28ef79f371

@ -513,7 +513,7 @@ func hasAccess(req *pbGroup.SetGroupInfoReq) bool {
return false
}
if groupUserInfo.RoleLevel == constant.GroupAdmin {
if groupUserInfo.RoleLevel == constant.GroupOwner || groupUserInfo.RoleLevel == constant.GroupAdmin {
return true
}
return false
@ -522,7 +522,7 @@ func hasAccess(req *pbGroup.SetGroupInfoReq) bool {
func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) {
log.NewInfo(req.OperationID, "SetGroupInfo args ", req.String())
if !hasAccess(req) {
log.NewError(req.OperationID, "no access ")
log.NewError(req.OperationID, "no access ", req)
return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
}

Loading…
Cancel
Save