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

mongodump. aclallows_* collections are not included #53

Open
nielswh opened this issue May 20, 2014 · 3 comments
Open

mongodump. aclallows_* collections are not included #53

nielswh opened this issue May 20, 2014 · 3 comments

Comments

@nielswh
Copy link

nielswh commented May 20, 2014

Looks like if we do a mongodump the collection names that start with aclallows_ are not included in the dump.

Can it be because the names includes /?

I have tables that are called for instance
aclallows_/sites/0

Based on MongoDB null and / should not be used in the name of the collection. I would highly suggest that the code be refactored to use a different character besides the /. Consider a legal place holder in the collection name.

@prabhu
Copy link

prabhu commented Dec 7, 2014

Can you share some configuration details? Did you try playing with the useSingle flag at all?

@nielswh
Copy link
Author

nielswh commented Jan 10, 2015

Is it possible to convert an existing project to useSingle flag without having to start over?

@jonmassot
Copy link
Contributor

I think it is due to the fact that adding the resources to the module, the validation with the middleware does not seems to work without including the starting slash.

acl.allow([
    {
        roles:['guest','member'],
        allows:[
            {resources:'blogs', permissions:'get'},
            {resources:['forums','news'], permissions:['get','put','delete']}
        ]
    }
])

and adding the route as follows doesn't work

app.put('/blogs/:id', acl.middleware(), function(req, res, next){…}

I'll get Not allowed get on /blogs by user X, so the solution was to add the starting slash to the resources to make the validation works

acl.allow([
    {
        roles:['guest','member'],
        allows:[
            {resources:'/blogs', permissions:'get'},
            {resources:['/forums','/news'], permissions:['get','put','delete']}
        ]
    }
])

Doing this, means that the collections created in the mongodb will looks like

allows_/blogs
allows_/forums
allows_/news

and then, the mongodump command output the message Cannot dump pup-dev-acl.allows_/blogs. Collection has '/' or null in the collection name., as expected

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

3 participants