public function checkPermissionForProperties(BuildDataDefinitionEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $container          = $event->getContainer();
        $properties         = $container->getPropertiesDefinition();
        $palettesDefinition = $container->getPalettesDefinition();

        foreach ($palettesDefinition->getPalettes() as $palette) {
            foreach ($palette->getProperties() as $property) {
                if (!$properties->hasProperty($name = $property->getName())) {
                    // @codingStandardsIgnoreStart
                    @\trigger_error(
                        \sprintf(
                            'Warning: unknown property "%s" in palette: %s',
                            $name,
                            $palette->getName()
                        ),
                        E_USER_WARNING
                    );
                    // @codingStandardsIgnoreEnd
                    continue;
                }

                $this
                    ->getVisibilityConditionChain($property)
                    ->addCondition(new BooleanCondition(!$properties->getProperty($name)->isExcluded()));
            }
        }
    }