芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/tblonline.org/app/Http/Middleware/Permission.php
user_type; if ($user_type == 'customer') { if (!$request->ajax()) { return redirect('/')->with('error', _lang('Permission denied !')); } else { return new Response('
' . _lang('Permission denied !') . '
'); } } if ($user_type != 'admin') { $route_name = \Request::route()->getName(); /** If User Type = User **/ if ($route_name != '' && $user_type == 'user') { if (explode(".", $route_name)[1] == "update") { $route_name = explode(".", $route_name)[0] . ".edit"; } else if (explode(".", $route_name)[1] == "store") { $route_name = explode(".", $route_name)[0] . ".create"; } if (!has_permission($route_name)) { if (!$request->ajax()) { return back()->with('error', _lang('Permission denied !')); } else { return new Response('
' . _lang('Permission denied !') . '
'); } } } } return $next($request); } }