This commit is contained in:
@@ -613,14 +613,14 @@ func (s *Service) validateDirectSubordinate(ctx context.Context, operatorShopID
|
||||
return err
|
||||
}
|
||||
|
||||
// 平台/超级管理员可跨级分配到任意店铺(前置已校验目标店铺存在)
|
||||
if operatorShopID == nil {
|
||||
if targetShop.ParentID != nil {
|
||||
return errors.ErrNotDirectSubordinate
|
||||
}
|
||||
} else {
|
||||
if targetShop.ParentID == nil || *targetShop.ParentID != *operatorShopID {
|
||||
return errors.ErrNotDirectSubordinate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 代理仅允许分配给直属下级店铺
|
||||
if targetShop.ParentID == nil || *targetShop.ParentID != *operatorShopID {
|
||||
return errors.ErrNotDirectSubordinate
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user