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

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

        $inputProvider = $environment->getInputProvider();

        $event->setResponse(
            \sprintf(
                '<div style="text-align:center; font-weight:bold; padding:40px;">
                    You have no permission for edit model %s.
                </div>',
                ModelId::fromSerialized($inputProvider->getParameter('id'))->getSerialized()
            )
        );

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

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

        $inputProvider = $environment->getInputProvider();

        $event->setResponse(
            \sprintf(
                '<div style="text-align:center; font-weight:bold; padding:40px;">
                    You have no permission for edit model %s.
                </div>',
                ModelId::fromSerialized($inputProvider->getParameter('id'))->getSerialized()
            )
        );

        return false;
    }
private function checkPermission ( ActionEvent $ event ) { $ environment = $ event -> getEnvironment ( ) ; if ( true === $ environment -> getDataDefinition ( ) -> getBasicDefinition ( ) -> isEditable ( ) ) { return true ; } $ inputProvider = $ environment -> getInputProvider ( ) ; $ event -> setResponse ( \ sprintf ( '<div style="text-align:center; font-weight:bold; padding:40px;">
                    You have no permission for edit model %s.
                </div>' , ModelId :: fromSerialized ( $ inputProvider -> getParameter ( 'id' ) ) -> getSerialized ( ) ) ) ; return false ; }
Check permission for edit a model.

@param ActionEvent $event The action event.

@return bool
Check permission for edit a model .