Class humhub\modules\user\components\User

Inheritancehumhub\modules\user\components\User » yii\web\User

Description of User


Hide inherited constants

ConstantValueDescriptionDefined By
EVENT_BEFORE_SWITCH_IDENTITY 'beforeSwitchIdentity' humhub\modules\user\components\User

Property Details

$permissionManager protected property

Method Details

afterLogin() public method

public void afterLogin ( $identity, $cookieBased, $duration )
can() public method (available since version 1.2)

Verifies global GroupPermissions of this User component.

The following example checks if this User is granted the GroupPermission

if(Yii::$app->user->can(MyGroupPermission::class) {
  // ...

See also humhub\modules\user\components\PermissionManager::can().

public boolean can ( $permission, $params = [], $allowCaching true )
$permission string|string[]|\humhub\modules\user\components\BasePermission
canChangeEmail() public method

Determines if this user is able to change the email address.

public boolean canChangeEmail ( )
canChangePassword() public method

Determines if this user is able to change the password.

public boolean canChangePassword ( )
canDeleteAccount() public method

Determines if this user is able to delete his account.

public boolean canDeleteAccount ( )
getAuthClients() public method

public void getAuthClients ( )
getCurrentAuthClient() public method

public void getCurrentAuthClient ( )
getGuid() public method

public void getGuid ( )
getLanguage() public method

public void getLanguage ( )
getPermissionManager() public method

public humhub\modules\user\components\PermissionManager getPermissionManager ( )
return humhub\modules\user\components\PermissionManager

Instance with the related identity instance as permission subject.

getTimeZone() public method

public void getTimeZone ( )
isAdmin() public method

public void isAdmin ( )
isGuestAccessEnabled() public static method

Checks if the system configuration allows access for guests

public static boolean isGuestAccessEnabled ( )
return boolean

Is guest access enabled and allowed

setCurrentAuthClient() public method

public void setCurrentAuthClient ( \yii\authclient\ClientInterface $authClient )
switchIdentity() public method

public void switchIdentity ( $identity, $duration 0 )