common/models/entities/User.php
public function getRole() {

		$roleTable			= CoreTables::getTableName( CoreTables::TABLE_ROLE );
		$siteTable			= CoreTables::getTableName( CoreTables::TABLE_SITE );
		$siteMemberTable	= CoreTables::getTableName( CoreTables::TABLE_SITE_MEMBER );

		// TODO: Check why it's not working without appending one() after recent Yii Upgrade
		return Role::find()
			->leftJoin( $siteMemberTable, "$siteMemberTable.roleId = $roleTable.id" )
			->leftJoin( $siteTable, "$siteTable.id = $siteMemberTable.siteId" )
			->where( "$siteMemberTable.userId=:id AND $siteTable.slug=:slug", [ ':id' => $this->id, ':slug' => Yii::$app->core->getSiteSlug() ] )
			->one();
	}
public function getRole() {

		$roleTable			= CoreTables::getTableName( CoreTables::TABLE_ROLE );
		$siteTable			= CoreTables::getTableName( CoreTables::TABLE_SITE );
		$siteMemberTable	= CoreTables::getTableName( CoreTables::TABLE_SITE_MEMBER );

		// TODO: Check why it's not working without appending one() after recent Yii Upgrade
		return Role::find()
			->leftJoin( $siteMemberTable, "$siteMemberTable.roleId = $roleTable.id" )
			->leftJoin( $siteTable, "$siteTable.id = $siteMemberTable.siteId" )
			->where( "$siteMemberTable.userId=:id AND $siteTable.slug=:slug", [ ':id' => $this->id, ':slug' => Yii::$app->core->getSiteSlug() ] )
			->one();
	}
public function getRole ( ) { $ roleTable = CoreTables :: getTableName ( CoreTables :: TABLE_ROLE ) ; $ siteTable = CoreTables :: getTableName ( CoreTables :: TABLE_SITE ) ; $ siteMemberTable = CoreTables :: getTableName ( CoreTables :: TABLE_SITE_MEMBER ) ; // TODO: Check why it's not working without appending one() after recent Yii Upgrade return Role :: find ( ) -> leftJoin ( $ siteMemberTable , "$siteMemberTable.roleId = $roleTable.id" ) -> leftJoin ( $ siteTable , "$siteTable.id = $siteMemberTable.siteId" ) -> where ( "$siteMemberTable.userId=:id AND $siteTable.slug=:slug" , [ ':id' => $ this -> id , ':slug' => Yii :: $ app -> core -> getSiteSlug ( ) ] ) -> one ( ) ; }
Returns role assigned to user for active site.

@return Role Assigned to User.
Returns role assigned to user for active site .