chg: [navigation:tags] Updated UI to reflect users' permissions
parent
bde01882d9
commit
01356824a2
|
@ -10,7 +10,8 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'data' => [
|
||||
'type' => 'simple',
|
||||
'text' => __('Add tag'),
|
||||
'popover_url' => '/tags/add'
|
||||
'popover_url' => '/tags/add',
|
||||
'requirement' => !empty($loggedUser['role']['perm_admin']),
|
||||
]
|
||||
]
|
||||
],
|
||||
|
@ -65,12 +66,14 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
[
|
||||
'open_modal' => '/tags/edit/[onclick_params_data_path]',
|
||||
'modal_params_data_path' => 'id',
|
||||
'icon' => 'edit'
|
||||
'icon' => 'edit',
|
||||
'requirement' => !empty($loggedUser['role']['perm_admin']),
|
||||
],
|
||||
[
|
||||
'open_modal' => '/tags/delete/[onclick_params_data_path]',
|
||||
'modal_params_data_path' => 'id',
|
||||
'icon' => 'trash'
|
||||
'icon' => 'trash',
|
||||
'requirement' => !empty($loggedUser['role']['perm_admin']),
|
||||
],
|
||||
]
|
||||
]
|
||||
|
|
|
@ -5,4 +5,21 @@ require_once(APP . 'Controller' . DS . 'Component' . DS . 'Navigation' . DS . 'b
|
|||
|
||||
class TagsNavigation extends BaseNavigation
|
||||
{
|
||||
public function addLinks()
|
||||
{
|
||||
$controller = 'Tags';
|
||||
if (empty($this->viewVars['loggedUser']['role']['perm_admin'])) {
|
||||
$this->bcf->removeLink($controller, 'view', $controller, 'edit');
|
||||
$this->bcf->removeLink($controller, 'edit', $controller, 'edit');
|
||||
}
|
||||
}
|
||||
|
||||
public function addActions()
|
||||
{
|
||||
$controller = 'Tags';
|
||||
if (empty($this->viewVars['loggedUser']['role']['perm_admin'])) {
|
||||
$this->bcf->removeAction($controller, 'view', $controller, 'delete');
|
||||
$this->bcf->removeAction($controller, 'edit', $controller, 'delete');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue