瀏覽代碼

Merge pull request #2945 from webdevilopers/patch-4

Update advanced_configuration.rst
Thomas 10 年之前
父節點
當前提交
b98f727397
共有 1 個文件被更改,包括 26 次插入2 次删除
  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
 the `"dropdown" => true` attribute: