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

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

Closed
aravael opened this issue May 9, 2024 · 1 comment
Closed

Comments

@aravael
Copy link

aravael commented May 9, 2024

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.

@JosephSilber
Copy link
Owner

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.

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

2 participants