You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var permission = ac.can(userRole).readAny('customers');
I am getting this error: (userRole is ADMIN)
Debug: internal, implementation, error
TypeError: Uncaught error: Cannot read property '$extend' of undefined
at /apps/node-apps/figgojs-live/node_modules/accesscontrol/lib/utils.js:58:35
at Array.forEach (native)
at Object.getFlatRoles (/apps/node-apps/figgojs-live/node_modules/accesscontrol/lib/utils.js:56:15)
at Object.getUnionAttrsOfRoles (/apps/node-apps/figgojs-live/node_modules/accesscontrol/lib/utils.js:224:27)
at new Permission (/apps/node-apps/figgojs-live/node_modules/accesscontrol/lib/core/Permission.js:52:45)
at Query._getPermission (/apps/node-apps/figgojs-live/node_modules/accesscontrol/lib/core/Query.js:266:16)
at Query.readAny (/apps/node-apps/figgojs-live/node_modules/accesscontrol/lib/core/Query.js:152:21)
at /apps/node-apps/figgojs-live/Routes/AdminRoute.js:100:41
at /apps/node-apps/figgojs-live/Utils/UniversalFunctions.js:589:13
at /apps/node-apps/figgojs-live/node_modules/jsonwebtoken/index.js:155:18
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
The text was updated successfully, but these errors were encountered:
When I test var permission = ac.can('ADMIN').readAny('customers');, this works with the grants you've given. See this test on runkit.
Are you sure your variable userRole is actually set to "ADMIN"? Can you do console.log(userRole) right before the line where you check for permission and see?
It seems you're calling for a non-existing role.
Also, make sure you're using the latest version (v1.5.2 as of now).
This is what I am getting:
But when I do
var permission = ac.can(userRole).readAny('customers');
I am getting this error: (userRole is ADMIN)
The text was updated successfully, but these errors were encountered: