chg: [roles:index] Only show `add role` button for users having ACL access
parent
487670e522
commit
a67c6b70d5
|
@ -1,28 +1,31 @@
|
|||
<?php
|
||||
$topbarChildren = [];
|
||||
if (!empty($loggedUser->role->perm_admin)) {
|
||||
$topbarChildren[] = [
|
||||
'type' => 'simple',
|
||||
'children' => [
|
||||
'data' => [
|
||||
'type' => 'simple',
|
||||
'text' => __('Add role'),
|
||||
'class' => 'btn btn-primary',
|
||||
'popover_url' => '/roles/add'
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
$topbarChildren[] = [
|
||||
'type' => 'search',
|
||||
'button' => __('Search'),
|
||||
'placeholder' => __('Enter value to search'),
|
||||
'data' => '',
|
||||
'searchKey' => 'value'
|
||||
];
|
||||
|
||||
echo $this->element('genericElements/IndexTable/index_table', [
|
||||
'data' => [
|
||||
'data' => $data,
|
||||
'top_bar' => [
|
||||
'children' => [
|
||||
[
|
||||
'type' => 'simple',
|
||||
'children' => [
|
||||
'data' => [
|
||||
'type' => 'simple',
|
||||
'text' => __('Add role'),
|
||||
'class' => 'btn btn-primary',
|
||||
'popover_url' => '/roles/add'
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'type' => 'search',
|
||||
'button' => __('Search'),
|
||||
'placeholder' => __('Enter value to search'),
|
||||
'data' => '',
|
||||
'searchKey' => 'value'
|
||||
]
|
||||
]
|
||||
'children' => $topbarChildren,
|
||||
],
|
||||
'fields' => [
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue