mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-27 14:39:49 -08:00
cea255995c
* refactor to clean up LDAP login, and make the login method easier to handle. * Login refactor cleanup * Google 2FA package * Adds Google Authenticator two-factor * Removed unused blade * Added optin setting in profile * Removed dumb comments * Made lock_passwords check more consistent * Additional two factor strings * Lock passwords check * Display feature disabled text if in demo mode * Two factor admin reset options * Translation strings
40 lines
691 B
PHP
40 lines
691 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Config;
|
|
use Route;
|
|
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')
|
|
]);
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|