Prado\Security\TUserManager::switchToGuest PHP Méthode

switchToGuest() public méthode

User name is changed as guest name, and roles are emptied.
public switchToGuest ( $user )
    public function switchToGuest($user)
    {
        $user->setIsGuest(true);
    }

Usage Example

Exemple #1
0
 public function testSwitchToGuest()
 {
     $userManager = new TUserManager();
     $userManager->init(self::$config);
     $user = $userManager->getUser('joe');
     $userManager->switchToGuest($user);
     self::assertTrue($user->getIsGuest());
 }