Support the ongoing development of Laravel.io →
Authentication Security
Last updated 2 years ago.
0

Just change your staff filter:

Route::filter('staff', function()
{
  // Lines of code to get role
 if($role != 'staff' || $role != 'admin') return View::make('errors.401');
 });

I have a filter inGroup, which checks if user has the group or he is an admin he get access otherwise not.

So you don't need to write an extra filter for each role. You have than only one filter inGroup (or for you inRole).

See http://laravel.com/docs/routing#route-filters Filters with parameters

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

andy1992 andy1992 Joined 20 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.