mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
27 lines
561 B
PHP
27 lines
561 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class AdminCheck
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
// Check if user have access to administration settings
|
|
if ( ! Gate::allows('admin-settings')) {
|
|
abort(403, 'You don\'t have access for this operation!');
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|