Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources with periods cause issues when using mongodb as backend #74

Open
GregTurner opened this issue Oct 7, 2014 · 5 comments
Open

Comments

@GregTurner
Copy link

If you use resource with periods, e.g., /path/myfile.ext, and mongodb, the periods are not encoded before being inserted into the DB. The result is the 'resources' collection that contains document with the resources names spilt on the period. E.g., "/path/myfile"/ext=True. This is causing a problem when trying to remove a resource because I assume the resource can't be found.

Workaround, encode periods with Unicode equivalent "\uff0E" in every caller to ACL api when using resources.

I recommend ACL encodes MongoDB control characters for the caller in mongodb-backend.js functions.

@timneedham
Copy link

Yeah, I'm hitting this one as well.
👍 The recommendation suggested by @GregTurner sounds ideal.

@manast
Copy link
Member

manast commented Oct 14, 2014

we need a patch for this, but I am not able to provide it atm...

@hockeyhabit
Copy link

I'm getting a (similar) problem with periods in the userid field. When calling addUserRoles if the userid contains "[email protected]" the acl_meta collection gets: "bob@bob" : { "com" : true } and it should be "[email protected]": true

prabhu pushed a commit to colearnr/node_acl that referenced this issue Dec 8, 2014
@prabhu
Copy link

prabhu commented Dec 8, 2014

I have fixed this issue here - colearnr@65abef8

Have submitted a PR including my other changes.

@manast
Copy link
Member

manast commented Dec 8, 2014

Looks great. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants