AuthBackendController: Only show tabs the user is permitted to view

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-27 10:38:35 +02:00
parent d157dec13b
commit 8713f59e66

View File

@ -138,24 +138,30 @@ class AuthBackendController extends Controller
protected function createListTabs() protected function createListTabs()
{ {
$tabs = $this->getTabs(); $tabs = $this->getTabs();
$tabs->add(
'user/list', if ($this->hasPermission('config/application/users/show')) {
array( $tabs->add(
'title' => $this->translate('List users of authentication backends'), 'user/list',
'label' => $this->translate('Users'), array(
'icon' => 'user', 'title' => $this->translate('List users of authentication backends'),
'url' => 'user/list' 'label' => $this->translate('Users'),
) 'icon' => 'user',
); 'url' => 'user/list'
$tabs->add( )
'group/list', );
array( }
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('Groups'), if ($this->hasPermission('config/application/groups/show')) {
'icon' => 'users', $tabs->add(
'url' => 'group/list' 'group/list',
) array(
); 'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);
}
return $tabs; return $tabs;
} }