adonisjs / discussion

Discussing about new features and sharing random thoughts: ⚠️ Not every request will be accepted
51 stars 5 forks source link

[Improvement] RBAC middleware out of the box #31

Open tecnoloco opened 7 years ago

tecnoloco commented 7 years ago

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'
}
tecnoloco commented 7 years ago

So no comments on this matter?

princenaman commented 7 years ago

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

thetutlage commented 7 years ago

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

princenaman commented 7 years ago

Sorry @thetutlage I did not mean that. I meant the concept as in Laravel also doesn't support RBAC out of the box.

tecnoloco commented 7 years ago

@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.

dguzman1012 commented 7 years ago

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.

sloan58 commented 7 years ago

Nice work @dguzman1012! This is great :-D

dguzman1012 commented 7 years ago

@sloan58 Thanks!

watzon commented 6 years ago

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.

RomainLanz commented 6 years ago

Something will come out soon to handle ACL within Adonis.

MitsuhaKitsune commented 6 years ago

@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