Closed slakbal closed 1 year ago
Hello @slakbal,
Those are really good points, actually I thought about these thing while developing the package but for the moment it seemed out of scope and good enough to release as is.
My idea of implementing these enhancements was a bit different though. Since a user can have multiple roles in theory casting a single role is a bit limiting, but here you are correct there has to be some way to append
roles and permissions assigned to the model. For the 2nd point I've thought about it and I honestly kind off regret that I didn't chose polymorphic relationships instead, I have to think about this. The 3rd point could be fixed easily actually, it is just a matter of providing more permissions to check against in one go.
Enhancements:
array
is provided as param.any
model and not just the User
model.I will create some issues for the points above, thank you for your feedback 🙂
The permissions() method in HasRoles
has been implemented in v1.1.0. I will get back on the other requests soon :-)
PR
With the 2nd of the request regarding the performance completed PR I am going to close the issue. The last request of allowing roles to be assigned to any Model needs further thought and careful implementation in order to have backwards compatibility, in time I will create a PR for it as well. Thank you for your feedback and your help :-)
Hi there @eneadm ... loving this simple package.... I have a couple of questions.
Then something like this would be possible:
Query executed 13 times on 1 page.
Do you think something like this would be possible, and how? Glad to help with the implementation.
Thanks!