Explorar el Código

Update advanced_configuration.rst

Add ACL security note on Tab Menu.
webDEVILopers hace 10 años
padre
commit
067c1d7792
Se han modificado 1 ficheros con 26 adiciones y 2 borrados
  1. 26 2
      Resources/doc/reference/advanced_configuration.rst

+ 26 - 2
Resources/doc/reference/advanced_configuration.rst

@@ -232,8 +232,32 @@ You will just need to change the way forms are configured in order to take into
     }
     }
 
 
 
 
-Dropdowns in Tab Menu
----------------------
+Tab Menu
+--------
+
+ACL
+^^^^^^^^^
+
+Though the route linked my a menu may be protected the Tab Menu will not automatically check the ACl for you.
+The link will still appear unless you manually check it using the `isGranted` method:
+
+.. code-block:: php
+
+    <?php
+    protected function configureTabMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
+    {
+        // Link will always appear even if it is protected by ACL
+        $menu->addChild($this->trans('Show'), array('uri' => $admin->generateUrl('show', array('id' => $id))));
+
+        // Link will only appear if access to ACL protected url is granted
+        if ($this->isGranted('EDIT')) {
+            $menu->addChild($this->trans('Edit'), array('uri' => $admin->generateUrl('edit', array('id' => $id))));
+        }
+    }
+
+
+Dropdowns
+^^^^^^^^^
 
 
 You can use dropdowns inside the Tab Menu by default. This can be achieved by using
 You can use dropdowns inside the Tab Menu by default. This can be achieved by using
 the `"dropdown" => true` attribute:
 the `"dropdown" => true` attribute: