@aeriajs/security 0.0.200 → 0.0.201

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.
@@ -26,9 +26,6 @@ const checkImmutability = async (docId, props, context) => {
26
26
  };
27
27
  const checkImmutabilityRead = async (props, context, next) => {
28
28
  const { payload: originalPayload } = props.result;
29
- if (Array.isArray(originalPayload.filters)) {
30
- return props;
31
- }
32
29
  if (!(originalPayload.filters._id instanceof mongodb_1.ObjectId)) {
33
30
  throw new Error;
34
31
  }
@@ -22,9 +22,6 @@ const checkImmutability = async (docId, props, context) => {
22
22
  };
23
23
  export const checkImmutabilityRead = async (props, context, next) => {
24
24
  const { payload: originalPayload } = props.result;
25
- if (Array.isArray(originalPayload.filters)) {
26
- return props;
27
- }
28
25
  if (!(originalPayload.filters._id instanceof ObjectId)) {
29
26
  throw new Error();
30
27
  }
@@ -5,9 +5,6 @@ const types_1 = require("@aeriajs/types");
5
5
  const checkOwnershipRead = async (props, context, next) => {
6
6
  const { token, description } = context;
7
7
  const { payload } = props.result;
8
- if (Array.isArray(payload.filters)) {
9
- return props;
10
- }
11
8
  if (token.authenticated && description.owned && description.owned !== 'on-write') {
12
9
  if (!token.roles.includes('root')) {
13
10
  payload.filters.owner = token.sub;
@@ -3,9 +3,6 @@ import { Result, ACError } from "@aeriajs/types";
3
3
  export const checkOwnershipRead = async (props, context, next) => {
4
4
  const { token, description } = context;
5
5
  const { payload } = props.result;
6
- if (Array.isArray(payload.filters)) {
7
- return props;
8
- }
9
6
  if (token.authenticated && description.owned && description.owned !== "on-write") {
10
7
  if (!token.roles.includes("root")) {
11
8
  payload.filters.owner = token.sub;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/security",
3
- "version": "0.0.200",
3
+ "version": "0.0.201",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,9 +28,9 @@
28
28
  "mongodb": "^6.5.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "@aeriajs/core": "^0.0.200",
32
- "@aeriajs/common": "^0.0.121",
33
- "@aeriajs/types": "^0.0.103",
31
+ "@aeriajs/core": "^0.0.201",
32
+ "@aeriajs/common": "^0.0.122",
33
+ "@aeriajs/types": "^0.0.104",
34
34
  "mongodb": "^6.5.0"
35
35
  },
36
36
  "scripts": {