From a1f7eb44764bfe0c8b9372e2cc8904629b2db230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 5 Oct 2020 15:30:44 +0300 Subject: [PATCH] missing update permission added. --- app/Listeners/Update/V20/Version2024.php | 54 ++++++++++++++++++++++++ app/Providers/Event.php | 1 + 2 files changed, 55 insertions(+) create mode 100644 app/Listeners/Update/V20/Version2024.php diff --git a/app/Listeners/Update/V20/Version2024.php b/app/Listeners/Update/V20/Version2024.php new file mode 100644 index 000000000..4d252a036 --- /dev/null +++ b/app/Listeners/Update/V20/Version2024.php @@ -0,0 +1,54 @@ +skipThisUpdate($event)) { + return; + } + + $this->updateDatabase(); + + $this->updatePermissions(); + } + + public function updateDatabase() + { + Artisan::call('migrate', ['--force' => true]); + } + + public function updatePermissions() + { + $this->attachPermissionsByRoleNames([ + 'admin' => [ + 'banking-transactions' => 'c,r,u,d', + 'common-notifications' => 'c,r,u,d', + 'common-uploads' => 'r,d', + ], + 'manager' => [ + 'banking-transactions' => 'c,r,u,d', + 'common-notifications' => 'c,r,u,d', + ], + ]); + } +} diff --git a/app/Providers/Event.php b/app/Providers/Event.php index 79dd8b10d..85cdd486e 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -24,6 +24,7 @@ class Event extends Provider 'App\Listeners\Update\V20\Version2017', 'App\Listeners\Update\V20\Version2020', 'App\Listeners\Update\V20\Version2023', + 'App\Listeners\Update\V20\Version2024', ], 'Illuminate\Auth\Events\Login' => [ 'App\Listeners\Auth\Login',