/**
  * @return bool
  */
 public function check()
 {
     $user = \Auth::user();
     $this->user = $user;
     if (!$user || !$user instanceof UserModel || !$user->hasRole('admin')) {
         return redirect()->route('admin::login');
     }
     if (LockController::isLocked()) {
         return redirect()->route('admin::lock');
     }
     if (false == $this->checkPermission(\Route::current(), $user)) {
         return redirect()->route('admin::forbidden');
     }
     return true;
 }
Ejemplo n.º 2
0
 public function logout()
 {
     \Auth::logout();
     LockController::setLocked(false);
     return $this->redirectToMethod('login');
 }