original_string: public function checkUserGroup( \Illuminate\Foundation\Auth\User $user, $groupcodes )
  	{
  		$groups = ( is_array( $groupcodes ) ? implode( ',', $groupcodes ) : $groupcodes );
  
  		if( isset( $this->cache[$user->id][$groups] ) ) {
  			return $this->cache[$user->id][$groups];
  		}
  
  		$this->cache[$user->id][$groups] = false;
  		$context = $this->context->get( false );
  
  		try {
  			$site = \Aimeos\MShop::create( $context, 'locale/site' )->getItem( $user->siteid )->getCode();
  		} catch( \Exception $e ) {
  			$site = ( Route::current() ? Route::input( 'site', Input::get( 'site', 'default' ) ) : 'default' );
  		}
  
  		$context->setLocale( $this->locale->getBackend( $context, $site ) );
  
  		foreach( array_reverse( $context->getLocale()->getSitePath() ) as $siteid )
  		{
  			if( (string) $user->siteid === (string) $siteid ) {
  				$this->cache[$user->id][$groups] = $this->checkGroups( $context, $user->id, $groupcodes );
  			}
  		}
  
  		return $this->cache[$user->id][$groups];
  	}
code: public function checkUserGroup( \Illuminate\Foundation\Auth\User $user, $groupcodes )
  	{
  		$groups = ( is_array( $groupcodes ) ? implode( ',', $groupcodes ) : $groupcodes );
  
  		if( isset( $this->cache[$user->id][$groups] ) ) {
  			return $this->cache[$user->id][$groups];
  		}
  
  		$this->cache[$user->id][$groups] = false;
  		$context = $this->context->get( false );
  
  		try {
  			$site = \Aimeos\MShop::create( $context, 'locale/site' )->getItem( $user->siteid )->getCode();
  		} catch( \Exception $e ) {
  			$site = ( Route::current() ? Route::input( 'site', Input::get( 'site', 'default' ) ) : 'default' );
  		}
  
  		$context->setLocale( $this->locale->getBackend( $context, $site ) );
  
  		foreach( array_reverse( $context->getLocale()->getSitePath() ) as $siteid )
  		{
  			if( (string) $user->siteid === (string) $siteid ) {
  				$this->cache[$user->id][$groups] = $this->checkGroups( $context, $user->id, $groupcodes );
  			}
  		}
  
  		return $this->cache[$user->id][$groups];
  	}
code_tokens: public function checkUserGroup ( \ Illuminate \ Foundation \ Auth \ User $ user , $ groupcodes ) { $ groups = ( is_array ( $ groupcodes ) ? implode ( ',' , $ groupcodes ) : $ groupcodes ) ; if ( isset ( $ this -> cache [ $ user -> id ] [ $ groups ] ) ) { return $ this -> cache [ $ user -> id ] [ $ groups ] ; } $ this -> cache [ $ user -> id ] [ $ groups ] = false ; $ context = $ this -> context -> get ( false ) ; try { $ site = \ Aimeos \ MShop :: create ( $ context , 'locale/site' ) -> getItem ( $ user -> siteid ) -> getCode ( ) ; } catch ( \ Exception $ e ) { $ site = ( Route :: current ( ) ? Route :: input ( 'site' , Input :: get ( 'site' , 'default' ) ) : 'default' ) ; } $ context -> setLocale ( $ this -> locale -> getBackend ( $ context , $ site ) ) ; foreach ( array_reverse ( $ context -> getLocale ( ) -> getSitePath ( ) ) as $ siteid ) { if ( ( string ) $ user -> siteid === ( string ) $ siteid ) { $ this -> cache [ $ user -> id ] [ $ groups ] = $ this -> checkGroups ( $ context , $ user -> id , $ groupcodes ) ; } } return $ this -> cache [ $ user -> id ] [ $ groups ] ; }
docstring: Checks if the user is in the specified group and associatied to the site
  
  @param \Illuminate\Foundation\Auth\User $user Authenticated user
  @param string|array $groupcodes Unique user/customer group codes that are allowed
  @return boolean True if user is part of the group, false if not
docstring_tokens: Checks if the user is in the specified group and associatied to the site