Skip to content

Commit

Permalink
Update advanced_configuration.rst
Browse files Browse the repository at this point in the history
Add ACL security note on Tab Menu.
  • Loading branch information
webdevilopers committed Apr 23, 2015
1 parent a516465 commit 067c1d7
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions Resources/doc/reference/advanced_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 067c1d7

Please sign in to comment.