web\User getIdentity()

getIdentity() public method Returns the identity object associated with the currently logged-in user. When $enableSession is true, this method may attempt to read the user's authentication data stored in session and reconstruct the corresponding identity object, if it has not done so before. See also: login() logout() public yii\web\IdentityInterface|null getIdentity ( $autoRenew = true )$autoRenew boolean Whether to automatically renew authentication status if it has not been done so be

web\User getId()

getId() public method Returns a value that uniquely represents the user. See also getIdentity(). public string|integer getId ( )return string|integer The unique identifier for the user. If null, it means the user is a guest.

web\User getAuthManager()

getAuthManager() protected method (available since version 2.0.6) Returns auth manager associated with the user component. By default this is the authManager application component. You may override this method to return a different auth manager instance if needed. protected yii\rbac\ManagerInterface getAuthManager ( )

web\User getAccessChecker()

getAccessChecker() protected method (available since version 2.0.9) Returns the access checker used for checking access. protected yii\rbac\CheckAccessInterface getAccessChecker ( )

web\User checkRedirectAcceptable()

checkRedirectAcceptable() protected method (available since version 2.0.8) Checks if the Accept header contains a content type that allows redirection to the login page. The login page is assumed to serve text/html or application/xhtml+xml by default. You can change acceptable content types by modifying $acceptableRedirectTypes property. See also $acceptableRedirectTypes. protected boolean checkRedirectAcceptable ( )return boolean Whether this request may be redirected to the login page.

web\User can()

can() public method Checks if the user can perform the operation as specified by the given permission. Note that you must configure "authManager" application component in order to use this method. Otherwise it will always return false. public boolean can ( $permissionName, $params = [], $allowCaching = true )$permissionName string The name of the permission (e.g. "edit post") that needs access check. $params array Name-value pairs that would be passed to the rules associated with the r

web\User beforeLogout()

beforeLogout() protected method This method is invoked when calling logout() to log out a user. The default implementation will trigger the EVENT_BEFORE_LOGOUT event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected boolean beforeLogout ( $identity )$identity yii\web\IdentityInterface The user identity information return boolean Whether the user should continue to be logged out

web\User beforeLogin()

beforeLogin() protected method This method is called before logging in a user. The default implementation will trigger the EVENT_BEFORE_LOGIN event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected boolean beforeLogin ( $identity, $cookieBased, $duration )$identity yii\web\IdentityInterface The user identity information $cookieBased boolean Whether the login is cookie-based $duration integer Number of seconds that the

web\User afterLogout()

afterLogout() protected method This method is invoked right after a user is logged out via logout(). The default implementation will trigger the EVENT_AFTER_LOGOUT event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected void afterLogout ( $identity )$identity yii\web\IdentityInterface The user identity information

web\User afterLogin()

afterLogin() protected method This method is called after the user is successfully logged in. The default implementation will trigger the EVENT_AFTER_LOGIN event. If you override this method, make sure you call the parent implementation so that the event is triggered. protected void afterLogin ( $identity, $cookieBased, $duration )$identity yii\web\IdentityInterface The user identity information $cookieBased boolean Whether the login is cookie-based $duration integer Number of second