Exemplo n.º 1
0
 /**
  * Set the current user of the application.
  * @todo: find a better way of catching whenever a user is resolved, from cookie, at login etc.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @return void
  */
 public function setUser(IlluminateUserInterface $user)
 {
     $this->user = $user;
     // if $user is valid let it add itself to the LaravelAcl however it sees fit
     if (!$this->acl->hasRole($this->user)) {
         $user->attachToAcl($this->acl);
     }
     $this->loggedOut = false;
 }