missing update permission added.
This commit is contained in:
parent
b1d3f0bb8b
commit
a1f7eb4476
54
app/Listeners/Update/V20/Version2024.php
Normal file
54
app/Listeners/Update/V20/Version2024.php
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners\Update\V20;
|
||||||
|
|
||||||
|
use App\Abstracts\Listeners\Update as Listener;
|
||||||
|
use App\Events\Install\UpdateFinished as Event;
|
||||||
|
use App\Traits\Permissions;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
|
||||||
|
class Version2024 extends Listener
|
||||||
|
{
|
||||||
|
use Permissions;
|
||||||
|
|
||||||
|
const ALIAS = 'core';
|
||||||
|
|
||||||
|
const VERSION = '2.0.24';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*
|
||||||
|
* @param $event
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function handle(Event $event)
|
||||||
|
{
|
||||||
|
if ($this->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',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,7 @@ class Event extends Provider
|
|||||||
'App\Listeners\Update\V20\Version2017',
|
'App\Listeners\Update\V20\Version2017',
|
||||||
'App\Listeners\Update\V20\Version2020',
|
'App\Listeners\Update\V20\Version2020',
|
||||||
'App\Listeners\Update\V20\Version2023',
|
'App\Listeners\Update\V20\Version2023',
|
||||||
|
'App\Listeners\Update\V20\Version2024',
|
||||||
],
|
],
|
||||||
'Illuminate\Auth\Events\Login' => [
|
'Illuminate\Auth\Events\Login' => [
|
||||||
'App\Listeners\Auth\Login',
|
'App\Listeners\Auth\Login',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user