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

Grant Access to Resource Owner Only #246

Open
alaboudi opened this issue Jul 22, 2017 · 3 comments
Open

Grant Access to Resource Owner Only #246

alaboudi opened this issue Jul 22, 2017 · 3 comments

Comments

@alaboudi
Copy link

Hi,

Is there another way of only allowing resource owners to access a certain resource? The documentation slightly touches on this by saying

Sometimes it may even be useful to create one role per user, to get the finest granularity possible

but this clutter my database and make a collection for every user? Is there no other way of achieving this?

@neuronetio
Copy link

I'm using something like this:

resources:['someResource'],
permissions:['owner-view','other-view','owner-update','other-update']

and in controllers before checking permissions I'm checking who wants to 'view' or 'update' something by session.userId and then get result from db and check who is owner of the record, if session.userId==dbRecord.userId then I'm checking 'owner-view' permissions for this user or else 'other-view' (if admin want to view record or other user)

@he313572052
Copy link

app.put('/blogs/:id', acl.middleware(), function(req, res, next){…}
Is the app in the express getting the object?

@sebastien-savalle
Copy link

Is there any other way to allow access to resource owner ?

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

4 participants