question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

roleSearchPath config doesn't work!

See original GitHub issue

Hello!

I set roleSearchPath but this config is doesn’t work. acl.config({ filename: 'nacl.json', roleSearchPath: 'user.role' });

//express-acl/lib/common.js objectPath.get(req, searchPath) //undefined

But searchPath set is correct 'user.role'

Example req.user: { "profile": { "gender": "", "location": "", "name": "", "website": "" }, "tokens": [], "things": [], "_id": "", "email": "", "password": "", "role": "user" }

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bugaroviccommented, Apr 3, 2019

I have got the same error. Problem is that objectPath.get searches only within direct properties of object. To support shallow (hidden, inherited) properties, objectPath must be created with withInheritedProps. const objectPath = require('object-path').withInheritedProps; I use passport in express, which create req.user property, but I’m not javascript experienced user, so I don’t know if the solution is to use withInheritedProps or use another solution to make req.user properties as own.

0reactions
nyambaticommented, Feb 19, 2019

@smilemoreall Do you mind if we can sync on your issue. I think we may be able to get a solution that way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

setting search_path to role doesn't seem to work in postgres
I've created a backend api that connects to postgres and performs various queries. I've created a specific user (role + can login privilege)...
Read more >
ANSIBLE_ROLES_PATH not set correctly? #3404 - GitHub
When running in CI, if roles are installed, the ANSIBLE_ROLES_PATH points to the roles. ... molecule doesn't find role with ansible-compat == 1.0.0 ......
Read more >
PostgreSQL search_path change not working as advertised
For me the problem was I was trying to set the search path in pgAdmin. For some reason it wasn't applying the changes...
Read more >
Search paths in Ansible
Search paths in Ansible . You can control the paths Ansible searches to find resources on your control node (including configuration, modules,...
Read more >
Configuring Elasticsearch | Elasticsearch Guide [8.5] | Elastic
Run Elasticsearch locally · Configuring Elasticsearch ... For the archive distributions, the config directory location defaults to $ES_HOME/config .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found