JosephSilber/bouncer

Is it possible to keep all abilities hardcoded instead of abilities table

aravael opened this issue · 1 comments

I'd like to move all my abilities from a database to the code, is that really possible? Just want to know your opinion since per my check it's not easy to do. @JosephSilber

The idea is to have a class with all the abilities and extend the array of abilities when needed. Since an ability is checked directly in the code when added, it will not have an affect if it's not added to the table. That's why I want to know whether it's even possible to implement.

If you keep everything in code, you don't even need Bouncer. Laravel's Policies is all you need.

If you mean that you want abilities in code, but roles in the DB... Then no, that's not how Bouncer works.