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

Ownership access control for action 'read' not works and package still active? #252

Open
leoujz opened this issue Oct 19, 2017 · 0 comments

Comments

@leoujz
Copy link

leoujz commented Oct 19, 2017

This package still active?

By my test,

PermissionService.grant({role:'registered', model:'sth', action:'update', relation:'role'})
PermissionService.grant({role:'registered', model:'sth', action:'update', relation:'owner'})

Then, 'put /sth/:id' can only be accessed by the user who owns the 'sth/:id', it works.

However, I need similar access control for 'get /sth/:id', I want only the owner can access 'get sth/:id'. I tried the following operations:

PermissionService.grant({role:'registered', model:'sth', action:'read', relation:'role'})
PermissionService.grant({role:'registered', model:'sth', action:'read', relation:'owner'})

But it does not work.

PermissionService.grant({role:'registered', model:'sth', action:'read', relation:'role'}), then 'get /sth/' and 'get /sth/:id' can both be accessed by all registered users despite of ownership.
PermissionService.revoke({role:'registered', model:'sth', action:'read', relation:'role'}), then 'get /sth/' and 'get /sth/:id' would both be forbidden for all registered users despite of ownership.
And permission {role:'registered', model:'sth', action:'read', relation:'owner'} seems to have no effect.

I just don't know if it is a designed feature or a bug.

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

1 participant