Add Document/Transaction/Contact types to the config

This commit is contained in:
Burak Çakırel
2021-01-05 23:22:38 +03:00
parent 1deff6e5b4
commit 3aa94bc9e2
14 changed files with 130 additions and 147 deletions

View File

@@ -2,7 +2,6 @@
namespace App\Traits;
use App\Events\Auth\ApiPermissionsAssigning;
use App\Models\Auth\Permission;
use App\Models\Auth\Role;
use App\Utilities\Reports;
@@ -406,12 +405,7 @@ trait Permissions
// Fire event to find the proper controller for common API endpoints
if (in_array($table, ['contacts', 'documents', 'transactions'])) {
$p = new \stdClass();
$p->controller = '';
event(new ApiPermissionsAssigning($p, $table, request()->get('type')));
$controller = $p->controller;
$controller = config('type.' . request()->get('type') . '.permission_name');
} else {
$route = app(Route::class);