src/Contao/View/Contao2BackendView/Subscriber/CheckPermission.php
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()));
            }
        }
    }
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()));
            }
        }
    }
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 ( ) ) ) ; } } }
Check permission for properties by user alexf.

@param BuildDataDefinitionEvent $event The event.

@return void
Check permission for properties by user alexf .