From 0e8a6cbe1cb174f9b9a8057d2cf796b76d1c90b6 Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 28 Jun 2021 23:27:21 +0200 Subject: [PATCH] chg: [view] templates added for new permission role - also fixed an issue with the signature of the component import in CRUDcomponent --- src/Controller/Component/CRUDComponent.php | 2 +- templates/Roles/add.php | 5 +++++ templates/Roles/index.php | 6 ++++++ templates/Roles/view.php | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index 86bb1ec..e2e8fbe 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -12,7 +12,7 @@ use Cake\Http\Exception\NotFoundException; class CRUDComponent extends Component { - protected $components = ['RestResponse']; + public $components = ['RestResponse']; public function initialize(array $config): void { diff --git a/templates/Roles/add.php b/templates/Roles/add.php index 2264573..3d874b5 100644 --- a/templates/Roles/add.php +++ b/templates/Roles/add.php @@ -12,6 +12,11 @@ 'type' => 'checkbox', 'label' => 'Full admin privilege' ], + [ + 'field' => 'perm_sync', + 'type' => 'checkbox', + 'label' => 'Sync permission' + ], [ 'field' => 'is_default', 'type' => 'checkbox', diff --git a/templates/Roles/index.php b/templates/Roles/index.php index e3fec85..e5685c3 100644 --- a/templates/Roles/index.php +++ b/templates/Roles/index.php @@ -47,6 +47,12 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'data_path' => 'perm_admin', 'element' => 'boolean' ], + [ + 'name' => __('Sync'), + 'sort' => 'perm_sync', + 'data_path' => 'perm_sync', + 'element' => 'boolean' + ], [ 'name' => 'Default', 'sort' => 'is_default', diff --git a/templates/Roles/view.php b/templates/Roles/view.php index 917fda9..4624868 100644 --- a/templates/Roles/view.php +++ b/templates/Roles/view.php @@ -17,6 +17,11 @@ echo $this->element( 'path' => 'perm_admin', 'type' => 'boolean' ], + [ + 'key' => __('Sync permission'), + 'path' => 'perm_sync', + 'type' => 'boolean' + ], [ 'key' => __('Default role'), 'path' => 'is_default',