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:
Zexi Li
2020-12-10 20:37:43 +08:00
committed by GitHub
+4
View File
@@ -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)