mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
Merge pull request #9347 from swordqiu/hotfix/qj-perform-public-scope-check
fix(cloudcommon): perform public should check the sharing scope of
This commit is contained in:
@@ -472,6 +472,10 @@ func SharablePerformPublic(model ISharableBaseModel, ctx context.Context, userCr
|
||||
if targetScope.HigherThan(allowScope) {
|
||||
return errors.Wrapf(httperrors.ErrNotSufficientPrivilege, "require %s allow %s", targetScope, allowScope)
|
||||
}
|
||||
requireScope := model.GetPublicScope()
|
||||
if requireScope.HigherThan(allowScope) {
|
||||
return errors.Wrapf(httperrors.ErrNotSufficientPrivilege, "require %s allow %s", requireScope, allowScope)
|
||||
}
|
||||
|
||||
_, err = Update(model, func() error {
|
||||
model.SetShare(targetScope)
|
||||
|
||||
Reference in New Issue
Block a user