修改:分享增加代理权限
This commit is contained in:
@@ -82,8 +82,15 @@ func (l *QueryGenerateShareLinkLogic) QueryGenerateShareLink(req *types.QueryGen
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成分享链接, 获取用户失败: %v", err)
|
||||
}
|
||||
if user.Inside != 1 {
|
||||
// 检查是否是订单所有者或订单的代理
|
||||
if order.UserId != userId {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成分享链接, 无权操作此订单")
|
||||
isAgent, aerr := IsOrderAgent(l.ctx, l.svcCtx, userId, order.Id)
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
if !isAgent {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成分享链接, 无权操作此订单")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user