src/Contao/View/Contao2BackendView/Subscriber/CheckPermission.php
public function checkPermissionIsEditable(BuildDataDefinitionEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $container = $event->getContainer();

        if ($container->getBasicDefinition()->isEditable()) {
            return;
        }

        $view          = $container->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $modelCommands = $view->getModelCommands();

        $this->disableCommandByActionName($modelCommands, 'edit');
        $this->disableCommandByActionName($modelCommands, 'cut');
        $this->disableToggleCommand($modelCommands);
    }
public function checkPermissionIsEditable(BuildDataDefinitionEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $container = $event->getContainer();

        if ($container->getBasicDefinition()->isEditable()) {
            return;
        }

        $view          = $container->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $modelCommands = $view->getModelCommands();

        $this->disableCommandByActionName($modelCommands, 'edit');
        $this->disableCommandByActionName($modelCommands, 'cut');
        $this->disableToggleCommand($modelCommands);
    }
public function checkPermissionIsEditable ( BuildDataDefinitionEvent $ event ) { if ( ! $ this -> scopeDeterminator -> currentScopeIsBackend ( ) ) { return ; } $ container = $ event -> getContainer ( ) ; if ( $ container -> getBasicDefinition ( ) -> isEditable ( ) ) { return ; } $ view = $ container -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; $ modelCommands = $ view -> getModelCommands ( ) ; $ this -> disableCommandByActionName ( $ modelCommands , 'edit' ) ; $ this -> disableCommandByActionName ( $ modelCommands , 'cut' ) ; $ this -> disableToggleCommand ( $ modelCommands ) ; }
Check permission is editable.

@param BuildDataDefinitionEvent $event The event.

@return void
Check permission is editable .