@zenstackhq/plugin-policy 3.0.0-beta.11 → 3.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -813,7 +813,7 @@ var PolicyHandler = class extends OperationNodeTransformer {
813
813
  if (constCondition === true) {
814
814
  needCheckPreCreate = false;
815
815
  } else if (constCondition === false) {
816
- throw new RejectedByPolicyError(mutationModel);
816
+ throw new RejectedByPolicyError(mutationModel, RejectedByPolicyReason.NO_ACCESS);
817
817
  }
818
818
  }
819
819
  if (needCheckPreCreate) {
@@ -1176,7 +1176,7 @@ var PolicyHandler = class extends OperationNodeTransformer {
1176
1176
  };
1177
1177
  const result = await proceed(preCreateCheck);
1178
1178
  if (!result.rows[0]?.$condition) {
1179
- throw new RejectedByPolicyError(model);
1179
+ throw new RejectedByPolicyError(model, RejectedByPolicyReason.NO_ACCESS);
1180
1180
  }
1181
1181
  }
1182
1182
  unwrapCreateValueRows(node, model, fields, isManyToManyJoinTable) {