Restrict user access to different panels based on roles
I have 2 pannels One is Pharmacy and other is clinic. I have one login page , based on roles I am redirecting to the panels.
9 Replies
And what's the question?!
Sorry to jump on a slightly older post - but I've done this, and implemented the canAcecssPanel method. However, even if it returns false, it still allows the user to see the panel
Is the method called at all?
it is, if I dd() something in there, I see that happen
What happens if you switch env to production? Not 100% sure whether it’s enforced in local but I think it should be
Ah yeah, I did notice that, and change that (not that I cach anything locally in dev, but cleared cache anyway) and still just lets me view the panel
I even just have it return false, and it still works
if i
within that, I get "production" back
ok, so I just went back to my default, and the return false gave me a 403
changed false to true, and it worked
so is there something I need to put on each panel for that to work
Solution
OK, yeah, so I was missing
from my non-default panel