Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Error CoreMongooseArray #51

Closed
Zarinia opened this issue Apr 22, 2020 · 2 comments
Closed

Error CoreMongooseArray #51

Zarinia opened this issue Apr 22, 2020 · 2 comments

Comments

@Zarinia
Copy link

Zarinia commented Apr 22, 2020

Hi,
I wrote my grantobject and took it to acl like this, but i had error
const ac = new AccessControl();
ac.setGrants(grantsObject);

Class constructor CoreMongooseArray cannot be invoked without 'new'
(node:11861) UnhandledPromiseRejectionWarning: TypeError: Class constructor CoreMongooseArray cannot be invoked without 'new'
at initCloneArray.........

@Zarinia
Copy link
Author

Zarinia commented Apr 22, 2020

my grantObject like this:

{
  "admin": {
    "grants": [
      {
        "resource": "categories",
        "action": [
          "create"
        ],
        "attributes": [
          "*"
        ]
      }
    ]
  },
  "user": {
    "grants": [
      {
        "resource": "categories",
        "action": [
          "create"
        ],
        "attributes": [
          "*"
        ]
      },
      {
        "resource": "categories",
        "action": [
          "create"
        ],
        "attributes": [
          "*"
        ]
      }
    ]
  }
}

@Zarinia
Copy link
Author

Zarinia commented Apr 22, 2020

i found my problem
i have used resolve json and it destroy json
when use json stringify and parse it fix and run

@Zarinia Zarinia closed this as completed Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant