-
Notifications
You must be signed in to change notification settings - Fork 11
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
expose rbac-a instance #5
Comments
Sure, I think I understand your example. And this is already implemented, actually. This module already exposes
Note: I will release a next major version sometime to support the next koa@2. Will update the docs as well. It's on the todo list 😛 |
@yanickrochon I may spend a little bit of time porting it to Koa v2 if you don't have time in the next couple of weeks, as I need to use it for a project I'm doing. :) |
Sure! I will be starting a new project with koa@2 in a few weeks, but I am still in the process of moving, so I don't have time at the moment. If you want, the changes should be trivial. Thanks! |
Ping. Thanks. |
I will update RBAC-A (hopefully soon!) and will also update this module to close this issue. I know it has been a while, but this is not dead! |
It'd be nice to expose an rbac-a instance so that its config can be applied in one place to use both rbac-a and koa-rbac. Alternatively, exposing some methods similar to the .allow, .deny, .check in koa-rbac but return a Boolean so it can be used inline too.
for example, let's say I have a PostGroup, which includes PostA and PostB, all authorized by rbac. When I share a PostGroup, I want to automatically share a Post to that user as well, but only if I have the 'share:post' permission on that Post. Otherwise, just share the PostGroup and the Posts where I have that permission.
I'd use koa-rbac middleware to check for 'share:postgroup', but I'd need to use rbac .check (share:post) somewhere inside the handler as well. I'd prefer it use the same rbac-a instance to ensure the config is identical.
(hope that example makes sense, I realize it's a bit complicated)
The text was updated successfully, but these errors were encountered: