mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-19 20:14:09 -08:00
e3e0d57f56
* Add IDE Helper files * Cleanup imports - Alphabetises imports - Removes unused imports * Add Platform requirements * Move filling asset into block where asset exists * Remove duplicate array keys
38 lines
668 B
PHP
38 lines
668 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Gate;
|
|
|
|
class CheckPermissions
|
|
{
|
|
/**
|
|
* Handle the ACLs for permissions.
|
|
*
|
|
* The $section variable is passed via the route middleware,
|
|
* 'middleware' => [authorize:superadmin']
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @param string|null $section
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next, $section = null)
|
|
{
|
|
|
|
|
|
if (Gate::allows($section)) {
|
|
return $next($request);
|
|
}
|
|
|
|
return response()->view('layouts/basic', [
|
|
'content' => view('errors/403')
|
|
]);
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|