chg: [roles:index] Only show `add role` button for users having ACL access

refacto/CRUDComponent
Sami Mokaddem 2023-02-23 14:58:54 +01:00
parent 487670e522
commit a67c6b70d5
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 23 additions and 20 deletions

View File

@ -1,10 +1,7 @@
<?php <?php
echo $this->element('genericElements/IndexTable/index_table', [ $topbarChildren = [];
'data' => [ if (!empty($loggedUser->role->perm_admin)) {
'data' => $data, $topbarChildren[] = [
'top_bar' => [
'children' => [
[
'type' => 'simple', 'type' => 'simple',
'children' => [ 'children' => [
'data' => [ 'data' => [
@ -14,15 +11,21 @@ echo $this->element('genericElements/IndexTable/index_table', [
'popover_url' => '/roles/add' 'popover_url' => '/roles/add'
] ]
] ]
], ];
[ }
$topbarChildren[] = [
'type' => 'search', 'type' => 'search',
'button' => __('Search'), 'button' => __('Search'),
'placeholder' => __('Enter value to search'), 'placeholder' => __('Enter value to search'),
'data' => '', 'data' => '',
'searchKey' => 'value' 'searchKey' => 'value'
] ];
]
echo $this->element('genericElements/IndexTable/index_table', [
'data' => [
'data' => $data,
'top_bar' => [
'children' => $topbarChildren,
], ],
'fields' => [ 'fields' => [
[ [