hi Garbee,
I have this folder to access the CRUD must be logged in
Route::group(array('before' => 'authSentry'), function()
{
Route::resource('areas', 'AreasController');
});
I have this and another filter for access to shares
Route::filter('hasAccess', function($route, $request, $value)
{
$user = Sentry::getUser();
if (!$user->hasAccess($value)) return View::make('no-access');
});
Apparently it only works when it is declared in the constructor and I need it to work in all the methods (create, read, update, delete)
class AreasController extends BaseController {
public function __construct()
{
$this->beforeFilter('hasAccess:areas');
}
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community