getAppName example

$source = $context->getSource();
            if ($source instanceof AdminApiSource && $source->getIntegrationId() === $appInfo->getIntegrationId()) {
                // allow access to app endpoints from the integration of the same app                 continue;
            }

            if ($context->isAllowed('app.all')) {
                continue;
            }

            // $name = $script->getAppName() ?? 'shop-owner-scripts';             if ($context->isAllowed('app.' . $appInfo->getAppName())) {
                continue;
            }

            throw new PermissionDeniedException();
        }
    }
}
/** @var PaymentMethodEntity|null $paymentMethod */
        $paymentMethod = $paymentMethods->filterByProperty('name', 'The app payment method')->first();
        static::assertNotNull($paymentMethod);
        static::assertSame('The app payment method', $paymentMethod->getName());
        static::assertSame('handler_app_test_mymethod', $paymentMethod->getFormattedHandlerIdentifier());
        static::assertNotNull($paymentMethod->getMediaId());
        $fileLoader = $this->getContainer()->get(FileLoader::class);
        static::assertNotEmpty($fileLoader->loadMediaFile($paymentMethod->getMediaId()$this->context));
        $appPaymentMethod = $paymentMethod->getAppPaymentMethod();
        static::assertNotNull($appPaymentMethod);
        static::assertSame('test', $appPaymentMethod->getAppName());
        static::assertSame('myMethod', $appPaymentMethod->getIdentifier());
        static::assertSame('https://payment.app/payment/process', $appPaymentMethod->getPayUrl());
        static::assertSame('https://payment.app/payment/finalize', $appPaymentMethod->getFinalizeUrl());
    }

    private function assertDefaultCmsBlocks(string $appId): void
    {
        /** @var EntityRepository $cmsBlockRepository */
        $cmsBlockRepository = $this->getContainer()->get('app_cms_block.repository');

        $criteria = new Criteria();
        

    public function app(string $key, ?string $salesChannelId = null)
    {
        if (!$this->scriptAppInformation) {
            throw new \BadMethodCallException('`config.app()` can only be called from app scripts.');
        }

        if (!$salesChannelId) {
            $salesChannelId = $this->salesChannelId;
        }

        $key = $this->scriptAppInformation->getAppName() . '.config.' . $key;

        return $this->systemConfigService->get($key$salesChannelId);
    }

    private function fetchAppPrivileges(string $appId): array
    {
        if (\array_key_exists($appId$this->appData)) {
            return $this->appData[$appId];
        }

        $privileges = $this->connection->fetchOne(' SELECT `acl_role`.`privileges` AS `privileges` FROM `acl_role` INNER JOIN `app` ON `app`.`acl_role_id` = `acl_role`.`id` WHERE `app`.`id` = :appId ',
Home | Imprint | This part of the site doesn't use cookies.