src/Contao/View/Contao2BackendView/ActionHandler/ToggleHandler.php
private function checkPermission(ActionEvent $event)
    {
        $environment = $event->getEnvironment();

        if (true === $environment->getDataDefinition()->getBasicDefinition()->isEditable()) {
            return true;
        }

        $event->setResponse(
            \sprintf(
                '<div style="text-align:center; font-weight:bold; padding:40px;">
                    You have no permission for toggle %s.
                </div>',
                $this->getOperation($event->getAction(), $environment)->getToggleProperty()
            )
        );

        return false;
    }
private function checkPermission(ActionEvent $event)
    {
        $environment = $event->getEnvironment();

        if (true === $environment->getDataDefinition()->getBasicDefinition()->isEditable()) {
            return true;
        }

        $event->setResponse(
            \sprintf(
                '<div style="text-align:center; font-weight:bold; padding:40px;">
                    You have no permission for toggle %s.
                </div>',
                $this->getOperation($event->getAction(), $environment)->getToggleProperty()
            )
        );

        return false;
    }
private function checkPermission ( ActionEvent $ event ) { $ environment = $ event -> getEnvironment ( ) ; if ( true === $ environment -> getDataDefinition ( ) -> getBasicDefinition ( ) -> isEditable ( ) ) { return true ; } $ event -> setResponse ( \ sprintf ( '<div style="text-align:center; font-weight:bold; padding:40px;">
                    You have no permission for toggle %s.
                </div>' , $ this -> getOperation ( $ event -> getAction ( ) , $ environment ) -> getToggleProperty ( ) ) ) ; return false ; }
Check permission for toggle property.

@param ActionEvent $event The action event.

@return bool
Check permission for toggle property .