getAclRoleId example

$io->error(sprintf('No app with name "%s" installed.', $name));

            return self::FAILURE;
        }

        $keepUserData = $input->getOption('keep-user-data');

        $this->appLifecycle->delete(
            $app->getName(),
            [
                'id' => $app->getId(),
                'roleId' => $app->getAclRoleId(),
            ],
            $context,
            $keepUserData
        );

        $io->success('App uninstalled successfully.');

        return self::SUCCESS;
    }

    protected function configure(): void
    {


    public function uninstallExtension(string $technicalName, Context $context, bool $keepUserData = false): void
    {
        try {
            $app = $this->getAppByName($technicalName$context);
        } catch (ExtensionNotFoundException) {
            return;
        }

        $this->validateExtensionCanBeRemoved($technicalName$app->getId()$context);
        $this->appLifecycle->delete($technicalName['id' => $app->getId(), 'roleId' => $app->getAclRoleId()]$context$keepUserData);
    }

    public function removeExtensionAndCancelSubscription(int $licenseId, string $technicalName, string $id, Context $context): void
    {
        $this->validateExtensionCanBeRemoved($technicalName$id$context);
        $app = $this->getAppById($id$context);
        $this->storeClient->cancelSubscription($licenseId$context);
        $this->appLifecycle->delete($technicalName['id' => $id, 'roleId' => $app->getAclRoleId()]$context);
        $this->deleteExtension($technicalName);
    }

    

        return $this->filterByProperty('eventName', $name);
    }

    /** * @return array<string> */
    public function getAclRoleIdsAsBinary(): array
    {
        return array_values($this->fmap(static function DWebhookEntity $webhook): ?string {
            if ($webhook->getApp()) {
                return Uuid::fromHexToBytes($webhook->getApp()->getAclRoleId());
            }

            return null;
        }));
    }

    protected function getExpectedClass(): string
    {
        return WebhookEntity::class;
    }
}
public function testThemeRemovalOnDelete(bool $keepUserData): void
    {
        $manifest = Manifest::createFromXmlFile(__DIR__ . '/../fixtures/Apps/theme/manifest.xml');
        $this->appLifecycle->install($manifest, true, $this->context);

        $apps = $this->appRepository->search(new Criteria()$this->context)->getEntities();
        static::assertCount(1, $apps);

        $app = [
            'id' => $apps->first()->getId(),
            'name' => $apps->first()->getName(),
            'roleId' => $apps->first()->getAclRoleId(),
        ];

        $themeRepo = $this->getContainer()->get('theme.repository');

        $criteria = new Criteria();
        $criteria->addFilter(new EqualsFilter('technicalName', $app['name']));

        static::assertCount(1, $themeRepo->search($criteria$this->context)->getElements());

        $this->appLifecycle->delete($app['name']$app$this->context, $keepUserData);
        static::assertCount($keepUserData ? 1 : 0, $themeRepo->search($criteria$this->context)->getElements());

        


        // Only app lifecycle hooks can be received if app is deactivated         if (!$app->isActive() && !($event instanceof AppChangedEvent || $event instanceof AppDeletedEvent)) {
            return false;
        }

        if (!($this->privileges[$event->getName()] ?? null)) {
            $this->loadPrivileges($event->getName()$affectedRoles);
        }

        $privileges = $this->privileges[$event->getName()][$app->getAclRoleId()]
            ?? new AclPrivilegeCollection([]);

        if (!$event->isAllowed($app->getId()$privileges)) {
            return false;
        }

        return true;
    }

    /** * @param array<string> $affectedRoleIds */
private function getRegisteredApps(Context $context): array
    {
        /** @var AppCollection $apps */
        $apps = $this->appRepository->search(new Criteria()$context)->getEntities();

        $appData = [];
        foreach ($apps as $app) {
            $appData[$app->getName()] = [
                'id' => $app->getId(),
                'version' => $app->getVersion(),
                'roleId' => $app->getAclRoleId(),
            ];
        }

        return $appData;
    }

    private function deleteNotFoundAndFailedInstallApps(
        array $successfulUpdates,
        AbstractAppLifecycle $appLifecycle,
        Context $context
    ): void {
        
$this->systemConfigService->deleteExtensionConfiguration($app->getName()$config);
                }
            }

            $this->appRepository->delete([['id' => $app->getId()]]$context);

            if ($softDelete) {
                $this->integrationRepository->update([[
                    'id' => $app->getIntegrationId(),
                    'deletedAt' => new \DateTimeImmutable(),
                ]]$context);
                $this->permissionPersister->softDeleteRole($app->getAclRoleId());
            } else {
                $this->integrationRepository->delete([['id' => $app->getIntegrationId()]]$context);
                $this->permissionPersister->removeRole($app->getAclRoleId());
            }

            $this->deleteAclRole($app->getName()$context);
        });
    }

    /** * @param array<string, mixed> $metadata */
static::assertFalse($appEntity->isConfigurable());
        static::assertTrue($appEntity->getAllowDisable());
        /** @var IntegrationEntity $integrationEntity */
        $integrationEntity = $appEntity->getIntegration();
        static::assertNotNull($integrationEntity);
        static::assertFalse($integrationEntity->getAdmin());
        static::assertSame(100, $appEntity->getTemplateLoadPriority());
        static::assertEquals('https://base-url.com', $appEntity->getBaseAppUrl());

        $this->assertDefaultActionButtons();
        $this->assertDefaultModules($appEntity);
        $this->assertDefaultPrivileges($appEntity->getAclRoleId());
        $this->assertDefaultCustomFields($appEntity->getId());
        $this->assertDefaultWebhooks($appEntity->getId());
        $this->assertDefaultTemplate($appEntity->getId());
        $this->assertDefaultScript($appEntity->getId());
        $this->assertDefaultPaymentMethods($appEntity->getId());
        $this->assertDefaultCmsBlocks($appEntity->getId());
        $this->assertAssetExists($appEntity->getName());
        $this->assertFlowActionExists($appEntity->getId());
        $this->assertDefaultHosts($appEntity);
    }

    
Home | Imprint | This part of the site doesn't use cookies.