interface UserSessionStateInterface in RESTful 7.2
Class UserSessionStateInterface.
@package Drupal\restful\Authentication
Hierarchy
- interface \Drupal\restful\Authentication\UserSessionStateInterface
Expanded class hierarchy of UserSessionStateInterface
All classes that implement UserSessionStateInterface
File
- src/
Authentication/ UserSessionStateInterface.php, line 15 - Contains \Drupal\restful\Authentication\UserSessionStateInterface.
Namespace
Drupal\restful\AuthenticationView source
interface UserSessionStateInterface {
/**
* Check if the user has already been switched.
*
* We need this information to perform additional actions the first time a
* user is switched.
*
* @return bool
* TRUE if the user has been switched previously. FALSE otherwise.
*/
public static function isSwitched();
/**
* Make the passed in user to be the account for the Drupal thread.
*
* @param object $account
* The account to switch to.
*/
public function switchUser($account);
/**
* Switch the user to the authenticated user, and back.
*
* This should be called only for an API call. It should not be used for calls
* via the menu system, as it might be a login request, so we avoid switching
* back to the anonymous user.
*/
public function switchUserBack();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UserSessionStateInterface:: |
public static | function | Check if the user has already been switched. | 1 |
UserSessionStateInterface:: |
public | function | Make the passed in user to be the account for the Drupal thread. | 1 |
UserSessionStateInterface:: |
public | function | Switch the user to the authenticated user, and back. | 1 |