I'm currently working on a system which uses Roles & Permissions to control its security. I have implemented Bouncer successfully. However, there are times where an user will have access to only one "report" inside the reports submodule of a bigger module. Instead of creating a role with a single permission I have added that permission directly onto the user. And everything works ok. No problem there.
Here is my question. Lets say I have a module call Purchases. Inside Purchases I have Products, Orders, Suppliers, Reports, etc. In my blade I have the following syntax:
@if( $user->isAn('role1', 'role2', 'etc'))
Icon - Orders
Icon - Suppliers
Icon - Reports
The problem now is that my user may only have access to reports directly without needing to be assign to a role. Looking for roles assigned to an user is no longer the best approach.
I found a solution but its to search every single permission at the begging just to paint the main module and the search the submodule individually.
Any ideas will be greatly appreciated and I hope I have explain myself.