feat: agregar gestión de paquetes de permisos en RoleSeeder y definir rutas para bundles
This commit is contained in:
parent
7a68c458b8
commit
897f59211d
@ -187,6 +187,16 @@ public function run(): void
|
|||||||
$supplierEdit = $this->onEdit('suppliers', 'Actualizar registro', $suppliers, 'api');
|
$supplierEdit = $this->onEdit('suppliers', 'Actualizar registro', $suppliers, 'api');
|
||||||
$supplierDestroy = $this->onDestroy('suppliers', 'Eliminar registro', $suppliers, 'api');
|
$supplierDestroy = $this->onDestroy('suppliers', 'Eliminar registro', $suppliers, 'api');
|
||||||
|
|
||||||
|
$bundles = PermissionType::firstOrCreate([
|
||||||
|
'name' => 'Paquetes de permisos'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$bundleIndex = $this->onIndex('bundles', 'Mostrar datos', $bundles, 'api');
|
||||||
|
$bundleShow = $this->onPermission('bundles.show', 'Ver detalles', $bundles, 'api');
|
||||||
|
$bundleCreate = $this->onCreate('bundles', 'Crear registros', $bundles, 'api');
|
||||||
|
$bundleEdit = $this->onEdit('bundles', 'Actualizar registro', $bundles, 'api');
|
||||||
|
$bundleDestroy = $this->onDestroy('bundles', 'Eliminar registro', $bundles, 'api');
|
||||||
|
$bundleCheck = $this->onPermission('bundles.check', 'Verificar permisos incluidos', $bundles, 'api');
|
||||||
// ==================== ROLES ====================
|
// ==================== ROLES ====================
|
||||||
|
|
||||||
// Desarrollador
|
// Desarrollador
|
||||||
@ -260,7 +270,13 @@ public function run(): void
|
|||||||
$supplierIndex,
|
$supplierIndex,
|
||||||
$supplierCreate,
|
$supplierCreate,
|
||||||
$supplierEdit,
|
$supplierEdit,
|
||||||
$supplierDestroy
|
$supplierDestroy,
|
||||||
|
$bundleIndex,
|
||||||
|
$bundleShow,
|
||||||
|
$bundleCreate,
|
||||||
|
$bundleEdit,
|
||||||
|
$bundleDestroy,
|
||||||
|
$bundleCheck
|
||||||
);
|
);
|
||||||
|
|
||||||
//Operador PDV (solo permisos de operación de caja y ventas)
|
//Operador PDV (solo permisos de operación de caja y ventas)
|
||||||
|
|||||||
@ -77,12 +77,8 @@
|
|||||||
Route::resource('categorias', CategoryController::class);
|
Route::resource('categorias', CategoryController::class);
|
||||||
|
|
||||||
//BUNDLES/KITS
|
//BUNDLES/KITS
|
||||||
|
Route::resource('bundles', BundleController::class);
|
||||||
Route::prefix('bundles')->group(function () {
|
Route::prefix('bundles')->group(function () {
|
||||||
Route::get('/', [BundleController::class, 'index']);
|
|
||||||
Route::get('/{bundle}', [BundleController::class, 'show']);
|
|
||||||
Route::post('/', [BundleController::class, 'store']);
|
|
||||||
Route::put('/{bundle}', [BundleController::class, 'update']);
|
|
||||||
Route::delete('/{bundle}', [BundleController::class, 'destroy']);
|
|
||||||
Route::get('/{bundle}/check-stock', [BundleController::class, 'checkStock']);
|
Route::get('/{bundle}/check-stock', [BundleController::class, 'checkStock']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user