update permission discount summary

This commit is contained in:
Cihan Şentürk 2025-05-14 16:43:00 +03:00 committed by GitHub
parent 8dc32979ae
commit 155e02d0fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,58 @@
<?php
namespace App\Listeners\Update\V31;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Traits\Permissions;
use Illuminate\Support\Facades\Log;
class Version3119 extends Listener
{
use Permissions;
const ALIAS = 'core';
const VERSION = '3.1.19';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Log::channel('stdout')->info('Updating to 3.1.19 version...');
$this->updatePermissions();
Log::channel('stdout')->info('Done!');
}
/**
* Update permissions.
*
* @return void
*/
public function updatePermissions()
{
$rows = [
'admin' => [
'reports-discount-summary' => 'r'
],
'manager' => [
'reports-discount-summary' => 'r'
],
'accountant' => [
'reports-discount-summary' => 'r'
],
];
$this->attachPermissionsByRoleNames($rows);
}
}

View File

@ -32,6 +32,7 @@ class Event extends Provider
'App\Listeners\Update\V31\Version318',
'App\Listeners\Update\V31\Version3112',
'App\Listeners\Update\V31\Version3115',
'App\Listeners\Update\V31\Version3119',
],
'Illuminate\Routing\Events\PreparingResponse' => [
'App\Listeners\Common\PreparingResponse',