discussion
discussion copied to clipboard
[Improvement] RBAC middleware out of the box
I´m trying to convience my colleagues to use this framework , so far it meets allmost all the requierments. One really important thing that is missing is a RBAC out of the box, I know that we could develop our own middleware for this purpose, but we think thar for any framework, having an RBAC out of the box is a plus in the desicion making of which one to use for the sake of productiveness and time saving.
It would be awesome to have it impleted just like auth middleware for securing routes, and have something like:
const namedMiddleware = {
auth: 'Adonis/Middleware/Auth',
rbac: 'Adonis/Middleware/RBAC'
}
So no comments on this matter?
I believe Laravel doesn't have it inbuilt so @thetutlage didn't think adonis should. Plus mostly people use their custom RBAs.
Also someone previously asked: https://github.com/adonisjs/adonis-framework/issues/242
It has nothing to do with Laravel, I don't have a PHP to Node.js converter so that I am only converting code written in Laravel codebase.
Back to the issue
The RBAC is something that needs more work before a middleware can be written. It is in my pipeline but the priority is low. There are other things pending like. Testing framework, Cache and Job Queues
Sorry @thetutlage I did not mean that. I meant the concept as in Laravel also doesn't support RBAC out of the box.
@thetutlage Thanks for responding, I´m glad to hear that you have RBAC in your pipeline (looking forward to see it). I understand those priorities, in the meantime I will use Adonis for minor projects as RBAC is key for big bussiness projects.
Hello @tecnolocoEdan & @thetutlage !
I don't know if you are still interested but you can use my custom solution for ACL. Perhaps you can take it like a base code to continue your own projects... AdonisJS ACL
Cheers.
Nice work @dguzman1012! This is great :-D
@sloan58 Thanks!
I know this topic was created a while ago, but Laravel does now have built in Authorization and maybe we could look into having Adonis handle it in a similar manner.
Something will come out soon to handle ACL within Adonis.
@dguzman1012 A lot of thanks for this great example, it's very usefull for me and I love that you include manager on UI xP