client/html/src/Client/Html/Account/Download/Standard.php
protected function checkAccess( $id )
	{
		$context = $this->getContext();

		if( ( $customerId = $context->getUserId() ) !== null && $id !== null )
		{
			$manager = \Aimeos\MShop::create( $context, 'order/base' );

			$search = $manager->createSearch();
			$expr = array(
				$search->compare( '==', 'order.base.customerid', $customerId ),
				$search->compare( '==', 'order.base.product.attribute.id', $id ),
			);
			$search->setConditions( $search->combine( '&&', $expr ) );
			$search->setSlice( 0, 1 );

			if( count( $manager->searchItems( $search ) ) > 0 ) {
				return true;
			}
		}

		return false;
	}
protected function checkAccess( $id )
	{
		$context = $this->getContext();

		if( ( $customerId = $context->getUserId() ) !== null && $id !== null )
		{
			$manager = \Aimeos\MShop::create( $context, 'order/base' );

			$search = $manager->createSearch();
			$expr = array(
				$search->compare( '==', 'order.base.customerid', $customerId ),
				$search->compare( '==', 'order.base.product.attribute.id', $id ),
			);
			$search->setConditions( $search->combine( '&&', $expr ) );
			$search->setSlice( 0, 1 );

			if( count( $manager->searchItems( $search ) ) > 0 ) {
				return true;
			}
		}

		return false;
	}
protected function checkAccess ( $ id ) { $ context = $ this -> getContext ( ) ; if ( ( $ customerId = $ context -> getUserId ( ) ) !== null && $ id !== null ) { $ manager = \ Aimeos \ MShop :: create ( $ context , 'order/base' ) ; $ search = $ manager -> createSearch ( ) ; $ expr = array ( $ search -> compare ( '==' , 'order.base.customerid' , $ customerId ) , $ search -> compare ( '==' , 'order.base.product.attribute.id' , $ id ) , ) ; $ search -> setConditions ( $ search -> combine ( '&&' , $ expr ) ) ; $ search -> setSlice ( 0 , 1 ) ; if ( count ( $ manager -> searchItems ( $ search ) ) > 0 ) { return true ; } } return false ; }
Checks if the customer is allowed to download the file

@param string $id Unique order base product attribute ID referencing the download file
@return boolean True if download is allowed, false if not
Checks if the customer is allowed to download the file