feat: actualiza controladores y solicitudes para mejorar la gestión de permisos y validaciones
This commit is contained in:
parent
0faabb3026
commit
ad6b19e9dd
@ -40,8 +40,13 @@ public function all()
|
||||
*/
|
||||
public function allWithPermissions()
|
||||
{
|
||||
$hidden = ['Actividad'];
|
||||
|
||||
return ApiResponse::OK->response([
|
||||
'models' => PermissionType::with('permissions')->orderBy('name')->get()
|
||||
'models' => PermissionType::with('permissions')
|
||||
->whereNotIn('name', $hidden)
|
||||
->orderBy('name')
|
||||
->get()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,8 +103,12 @@ public function destroy(Role $role)
|
||||
*/
|
||||
public function permissions(Role $role)
|
||||
{
|
||||
$permissions = $role->id === 2
|
||||
? $role->permissions->filter(fn($p) => !str_starts_with($p->name, 'activities.'))
|
||||
: $role->permissions;
|
||||
|
||||
return ApiResponse::OK->response([
|
||||
'permissions' => $role->permissions
|
||||
'permissions' => $permissions->values()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
use App\Supports\QuerySupport;
|
||||
use Illuminate\Http\Request;
|
||||
use Notsoweb\ApiResponse\Enums\ApiResponse;
|
||||
use Illuminate\Routing\Controllers\HasMiddleware;
|
||||
|
||||
/**
|
||||
* Controlador de usuarios
|
||||
@ -22,8 +23,20 @@
|
||||
*
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class UserController extends Controller
|
||||
class UserController extends Controller implements HasMiddleware
|
||||
{
|
||||
|
||||
/**
|
||||
* Middleware
|
||||
*/
|
||||
public static function middleware(): array
|
||||
{
|
||||
return [
|
||||
self::can('users.index', ['index']),
|
||||
self::can('users.destroy', ['destroy']),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Listar
|
||||
*/
|
||||
|
||||
@ -12,24 +12,12 @@
|
||||
use App\Models\CatalogCancellationReason;
|
||||
use Illuminate\Http\Request;
|
||||
use Notsoweb\ApiResponse\Enums\ApiResponse;
|
||||
use Illuminate\Routing\Controllers\HasMiddleware;
|
||||
|
||||
/**
|
||||
* Descripción
|
||||
*/
|
||||
class CatalogController extends Controller implements HasMiddleware
|
||||
class CatalogController extends Controller
|
||||
{
|
||||
/**
|
||||
* Middleware
|
||||
*/
|
||||
public static function middleware(): array
|
||||
{
|
||||
return [
|
||||
self::can('catalogs.cancellation_reasons.index', ['index']),
|
||||
self::can('catalogs.cancellation_reasons.show', ['show']),
|
||||
self::can('catalogs.cancellation_reasons.destroy', ['destroy']),
|
||||
];
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
||||
@ -6,22 +6,10 @@
|
||||
use App\Http\Requests\Repuve\CatalogNameImgUpdateRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CatalogNameImg;
|
||||
use Illuminate\Routing\Controllers\HasMiddleware;
|
||||
use Notsoweb\ApiResponse\Enums\ApiResponse;
|
||||
|
||||
class CatalogNameImgController extends Controller implements HasMiddleware
|
||||
class CatalogNameImgController extends Controller
|
||||
{
|
||||
/**
|
||||
* Middleware
|
||||
*/
|
||||
public static function middleware(): array
|
||||
{
|
||||
return [
|
||||
self::can('catalogs.name_img.index', ['index']),
|
||||
self::can('catalogs.name_img.destroy', ['destroy']),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Listar
|
||||
*/
|
||||
|
||||
@ -29,8 +29,8 @@ class InscriptionController extends Controller implements HasMiddleware
|
||||
public static function middleware(): array
|
||||
{
|
||||
return [
|
||||
self::can('repuve.search_records', ['searchRecord']),
|
||||
self::can('repuve.check_stolen', ['stolen']),
|
||||
self::can('inscription.search', ['searchRecord']),
|
||||
self::can('inscription.search.national', ['stolen']),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -21,9 +21,10 @@ class RecordController extends Controller implements HasMiddleware
|
||||
public static function middleware(): array
|
||||
{
|
||||
return [
|
||||
self::can('records.index', ['index']),
|
||||
self::can('records.show', ['show']),
|
||||
self::can('records.generate_pdf', ['generatePdf', 'generatePdfVerification', 'generatePdfConstancia', 'generatePdfImages', 'generatePdfForm']),
|
||||
self::can('records.generate_pdf', ['generatePdf']),
|
||||
self::can('records.generate_pdf_form', ['generatePdfForm']),
|
||||
self::can('records.generate_pdf_constancia', ['generatePdfConstancia']),
|
||||
self::can('records.generate_pdf_verification', ['generatePdfVerification']),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -33,8 +33,9 @@ class UpdateController extends Controller implements HasMiddleware
|
||||
public static function middleware(): array
|
||||
{
|
||||
return [
|
||||
self::can('records.update', ['updateData']),
|
||||
self::can('records.update', ['tagSubstitution']),
|
||||
self::can('updates.vehicle-data', ['vehicleUpdate']),
|
||||
self::can('updates.vehicle-update', ['updateData']),
|
||||
self::can('updates.resend-to-repuve', ['resendToRepuve']),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ class CatalogCancellationReasonStoreRequest extends FormRequest
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->user()->can('catalogs.cancellation_reasons.create');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
|
||||
@ -7,7 +7,7 @@ class CatalogCancellationReasonUpdateRequest extends FormRequest
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->user()->can('catalogs.cancellation_reasons.edit');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
<?php namespace App\Http\Requests\Repuve;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RecordSearchRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->user()->can('repuve.records.search');
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'folio' => ['nullable', 'string', 'max:50'],
|
||||
'niv' => ['nullable', 'string', 'max:50'],
|
||||
'numero_serie' => ['nullable', 'string', 'max:50'],
|
||||
'fecha_desde' => ['nullable', 'date', 'date_format:Y-m-d'],
|
||||
'fecha_hasta' => ['nullable', 'date', 'date_format:Y-m-d', 'after_or_equal:fecha_desde'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'folio.string' => 'El folio debe ser una cadena de texto',
|
||||
'niv.string' => 'El NIV debe ser una cadena de texto',
|
||||
'numero_serie.string' => 'El número de serie debe ser una cadena de texto',
|
||||
'fecha_desde.date' => 'La fecha desde debe ser una fecha válida',
|
||||
'fecha_desde.date_format' => 'La fecha desde debe tener el formato Y-m-d',
|
||||
'fecha_hasta.date' => 'La fecha hasta debe ser una fecha válida',
|
||||
'fecha_hasta.after_or_equal' => 'La fecha hasta debe ser posterior o igual a la fecha desde',
|
||||
];
|
||||
}
|
||||
|
||||
public function withValidator($validator)
|
||||
{
|
||||
$validator->after(function ($validator) {
|
||||
if (!$this->filled('folio') &&
|
||||
!$this->filled('niv') &&
|
||||
!$this->filled('numero_serie') &&
|
||||
!$this->filled('fecha_desde')) {
|
||||
$validator->errors()->add(
|
||||
'search',
|
||||
'Debe proporcionar al menos un criterio de búsqueda (folio, niv o fecha_desde)'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ class VehicleStoreRequest extends FormRequest
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->user()->can('vehicles.create');
|
||||
return auth()->user()->can('inscription.vehicle');
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
|
||||
@ -9,7 +9,7 @@ class VehicleUpdateRequest extends FormRequest
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->user()->can('vehicles.edit');
|
||||
return auth()->user()->can('updates.vehicle-update');
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
|
||||
@ -28,9 +28,8 @@ class RoleSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$users = PermissionType::firstOrCreate([
|
||||
'name' => 'Usuarios'
|
||||
]);
|
||||
// === USUARIOS ===
|
||||
$users = PermissionType::firstOrCreate(['name' => 'Usuarios']);
|
||||
|
||||
[
|
||||
$userIndex,
|
||||
@ -39,11 +38,8 @@ public function run(): void
|
||||
$userDestroy
|
||||
] = $this->onCRUD('users', $users, 'api');
|
||||
|
||||
$userSettings = $this->onPermission('users.settings', 'Configuración de usuarios', $users, 'api');
|
||||
|
||||
$roles = PermissionType::firstOrCreate([
|
||||
'name' => 'Roles'
|
||||
]);
|
||||
// === ROLES ===
|
||||
$roles = PermissionType::firstOrCreate(['name' => 'Roles']);
|
||||
|
||||
[
|
||||
$roleIndex,
|
||||
@ -51,11 +47,11 @@ public function run(): void
|
||||
$roleEdit,
|
||||
$roleDestroy
|
||||
] = $this->onCRUD('roles', $roles, 'api');
|
||||
|
||||
$rolePermissions = $this->onPermission('roles.permissions', 'Permisos de roles', $roles, 'api');
|
||||
|
||||
$modules = PermissionType::firstOrCreate([ // Modulos
|
||||
'name' => 'Módulos'
|
||||
]);
|
||||
// === MÓDULOS ===
|
||||
$modules = PermissionType::firstOrCreate(['name' => 'Módulos']);
|
||||
|
||||
[
|
||||
$moduleIndex,
|
||||
@ -64,16 +60,10 @@ public function run(): void
|
||||
$moduleDestroy
|
||||
] = $this->onCRUD('modules', $modules, 'api');
|
||||
|
||||
$moduleToggleStatus = $this->onPermission(
|
||||
'modules.toggle_status',
|
||||
'Cambiar estado del módulo',
|
||||
$modules,
|
||||
'api'
|
||||
);
|
||||
$moduleToggleStatus = $this->onPermission('modules.toggle_status', 'Cambiar estado del módulo', $modules, 'api');
|
||||
|
||||
$devices = PermissionType::firstOrCreate([ //Dispositivos
|
||||
'name' => 'Dispositivos Móviles'
|
||||
]);
|
||||
// === DISPOSITIVOS MÓVILES ===
|
||||
$devices = PermissionType::firstOrCreate(['name' => 'Dispositivos Móviles']);
|
||||
|
||||
[
|
||||
$deviceIndex,
|
||||
@ -82,103 +72,51 @@ public function run(): void
|
||||
$deviceDestroy
|
||||
] = $this->onCRUD('devices', $devices, 'api');
|
||||
|
||||
$inscriptions = PermissionType::firstOrCreate([ // Inscripciones de vehículos
|
||||
'name' => 'Proceso de Sustitución por primera vez'
|
||||
]);
|
||||
$deviceToggleStatus = $this->onPermission('devices.toggle_status', 'Cambiar estado del dispositivo', $devices, 'api');
|
||||
|
||||
$inscriptionVehicle = $this->onPermission(
|
||||
'inscription.vehicle',
|
||||
'Inscribir vehículo',
|
||||
$inscriptions,
|
||||
'api'
|
||||
);
|
||||
// === INSCRIPCIONES ===
|
||||
$inscriptions = PermissionType::firstOrCreate(['name' => 'Proceso de Sustitución por primera vez']);
|
||||
|
||||
$inscriptionSearch = $this->onPermission(
|
||||
'inscription.search.national',
|
||||
'Buscar en consulta nacional',
|
||||
$inscriptions,
|
||||
'api'
|
||||
);
|
||||
$inscriptionVehicle = $this->onPermission('inscription.vehicle', 'Inscribir vehículo', $inscriptions, 'api');
|
||||
$inscriptionSearchNational = $this->onPermission('inscription.search.national', 'Buscar en consulta nacional', $inscriptions, 'api');
|
||||
$inscriptionSearch = $this->onPermission('inscription.search', 'Buscar en consulta', $inscriptions, 'api');
|
||||
|
||||
$inscriptionBusqueda = $this->onPermission(
|
||||
'inscription.search',
|
||||
'Buscar en consulta',
|
||||
$inscriptions,
|
||||
'api'
|
||||
);
|
||||
// === CANCELACIONES ===
|
||||
$cancellations = PermissionType::firstOrCreate(['name' => 'Cancelaciones']);
|
||||
|
||||
$cancellations = PermissionType::firstOrCreate([
|
||||
'name' => 'Cancelaciones'
|
||||
]);
|
||||
$cancellationTagNoAsignado = $this->onPermission('cancellations.cancel_tag_no_asignado', 'Cancelar constancia no asignada', $cancellations, 'api');
|
||||
|
||||
// === ACTUALIZAR REGISTRO ===
|
||||
$updates = PermissionType::firstOrCreate(['name' => 'Actualizar Registro']);
|
||||
|
||||
$cancellationTagNoAsignado = $this->onPermission(
|
||||
'cancellations.tag_no_asignado',
|
||||
'Cancelar constancia no asignada',
|
||||
$cancellations,
|
||||
'api'
|
||||
);
|
||||
$updateVehicleData = $this->onPermission('updates.vehicle-data', 'Actualizar datos de vehículo por formulario', $updates, 'api');
|
||||
$updateVehicleUpdate = $this->onPermission('updates.vehicle-update', 'Actualizar datos de vehículo', $updates, 'api');
|
||||
$updateResendToRepuve = $this->onPermission('updates.resend-to-repuve', 'Reenviar a REPUVE', $updates, 'api');
|
||||
|
||||
$updates = PermissionType::firstOrCreate([
|
||||
'name' => 'Actualizar Registro'
|
||||
]);
|
||||
// === GENERAR FORMATOS ===
|
||||
$formats = PermissionType::firstOrCreate(['name' => 'Generar Formatos']);
|
||||
|
||||
$updateVehicleData = $this->onPermission(
|
||||
'updates.vehicle-data',
|
||||
'Consultar datos de vehículo',
|
||||
$updates,
|
||||
'api'
|
||||
);
|
||||
$recordGeneratePdf = $this->onPermission('records.generate_pdf', 'Generar Hoja de recepción', $formats, 'api');
|
||||
$recordGeneratePdfForm = $this->onPermission('records.generate_pdf_form', 'Generar solicitud de sustitución', $formats, 'api');
|
||||
$recordGeneratePdfVerification = $this->onPermission('records.generate_pdf_verification', 'Generar Hoja de verificación', $formats, 'api');
|
||||
$recordGeneratePdfConstancia = $this->onPermission('records.generate_pdf_constancia', 'Generar Impresión en la constancia', $formats, 'api');
|
||||
|
||||
$updateVehicleUpdate = $this->onPermission(
|
||||
'updates.vehicle-update',
|
||||
'Actualizar datos de vehículo',
|
||||
$updates,
|
||||
'api'
|
||||
);
|
||||
// === REPORTES ===
|
||||
$reports = PermissionType::firstOrCreate(['name' => 'Reportes - Excel']);
|
||||
|
||||
$records = PermissionType::firstOrCreate([
|
||||
'name' => 'Generar Formatos'
|
||||
]);
|
||||
$reportVehicleUpdates = $this->onPermission('reports.vehicle_updates.index', 'Reporte de actualizaciones', $reports, 'api');
|
||||
$reportSubstitutions = $this->onPermission('reports.substitutions.index', 'Reporte de sustituciones', $reports, 'api');
|
||||
$reportCancellations = $this->onPermission('reports.cancellations.index', 'Reporte de cancelaciones', $reports, 'api');
|
||||
$reportGeneral = $this->onPermission('reports.general.index', 'Reporte general', $reports, 'api');
|
||||
$reportSearchRecords = $this->onPermission('reports.search_records.index', 'Reporte de consulta nacional', $reports, 'api');
|
||||
|
||||
$recordGeneratePdf = $this->onPermission(
|
||||
'records.generate_pdf',
|
||||
'Generar Hoja de recepción',
|
||||
$records,
|
||||
'api'
|
||||
);
|
||||
// === ACTIVIDAD ===
|
||||
$activities = PermissionType::firstOrCreate(['name' => 'Actividad']);
|
||||
|
||||
$recordGeneratePdfVerification = $this->onPermission(
|
||||
'records.generate_pdf_verification',
|
||||
'Generar Hoja de verificación',
|
||||
$records,
|
||||
'api'
|
||||
);
|
||||
$activityIndex = $this->onPermission('activities.index', 'Ver actividad de usuarios', $activities, 'api');
|
||||
|
||||
$recordGeneratePdfConstancia = $this->onPermission(
|
||||
'records.generate_pdf_constancia',
|
||||
'Generar Impresión en la constancia',
|
||||
$records,
|
||||
'api'
|
||||
);
|
||||
|
||||
$recordGeneratePdfSubtitution = $this->onPermission(
|
||||
'records.generate_pdf_substitution',
|
||||
'Generar Solicitud de sustitución',
|
||||
$records,
|
||||
'api'
|
||||
);
|
||||
|
||||
$recordGeneratePdfDamaged = $this->onPermission(
|
||||
'records.generate_pdf_damaged',
|
||||
'Generar PDF constancia dañada',
|
||||
$records,
|
||||
'api'
|
||||
);
|
||||
|
||||
$packages = PermissionType::firstOrCreate([
|
||||
'name' => 'Cajas'
|
||||
]);
|
||||
// === CAJAS ===
|
||||
$packages = PermissionType::firstOrCreate(['name' => 'Cajas']);
|
||||
|
||||
[
|
||||
$packageIndex,
|
||||
@ -187,9 +125,10 @@ public function run(): void
|
||||
$packageDestroy
|
||||
] = $this->onCRUD('packages', $packages, 'api');
|
||||
|
||||
$tags = PermissionType::firstOrCreate([
|
||||
'name' => 'Constancias de Inscripción'
|
||||
]);
|
||||
$packageBoxTags = $this->onPermission('packages.box_tags', 'Ver constancias de caja', $packages, 'api');
|
||||
|
||||
// === CONSTANCIAS DE INSCRIPCIÓN ===
|
||||
$tags = PermissionType::firstOrCreate(['name' => 'Constancias de Inscripción']);
|
||||
|
||||
[
|
||||
$tagIndex,
|
||||
@ -198,125 +137,83 @@ public function run(): void
|
||||
$tagDestroy,
|
||||
] = $this->onCRUD('tags', $tags, 'api');
|
||||
|
||||
$tagAssignToModule = $this->onPermission(
|
||||
'tags.assign_to_module',
|
||||
'Asignar etiquetas a módulo',
|
||||
$tags,
|
||||
'api'
|
||||
);
|
||||
$tagAssignToModule = $this->onPermission('tags.assign_to_module', 'Asignar etiquetas a módulo', $tags, 'api');
|
||||
|
||||
// =========================================================
|
||||
// ROLES
|
||||
// =========================================================
|
||||
|
||||
// Desarrollador
|
||||
Role::updateOrCreate([
|
||||
'name' => 'developer',
|
||||
'description' => 'Desarrollador',
|
||||
'guard_name' => 'api'
|
||||
])->syncPermissions(Permission::all());
|
||||
], ['description' => 'Desarrollador'])->syncPermissions(Permission::all());
|
||||
|
||||
// Administrador
|
||||
Role::updateOrCreate([
|
||||
'name' => 'admin',
|
||||
'description' => 'Administrador',
|
||||
'guard_name' => 'api'
|
||||
])->syncPermissions(
|
||||
$userIndex,
|
||||
$userCreate,
|
||||
$userEdit,
|
||||
$userDestroy,
|
||||
$userSettings,
|
||||
$roleIndex,
|
||||
$roleCreate,
|
||||
$roleEdit,
|
||||
$roleDestroy,
|
||||
$rolePermissions,
|
||||
$moduleIndex, //Módulos
|
||||
$moduleCreate,
|
||||
$moduleEdit,
|
||||
$moduleDestroy,
|
||||
$moduleToggleStatus,
|
||||
$deviceIndex, //Dispositivos
|
||||
$deviceCreate,
|
||||
$deviceEdit,
|
||||
$deviceDestroy,
|
||||
$inscriptionVehicle, //Inscripcion de vehículos
|
||||
$inscriptionSearch,
|
||||
$inscriptionBusqueda,
|
||||
$cancellationTagNoAsignado, //Cancelacion de constancia no asignada
|
||||
$updateVehicleData, //Actualizaciones de vehículo
|
||||
$updateVehicleUpdate,
|
||||
$recordGeneratePdf, //Expedientes
|
||||
$recordGeneratePdfVerification,
|
||||
$recordGeneratePdfConstancia,
|
||||
$recordGeneratePdfSubtitution,
|
||||
$recordGeneratePdfDamaged,
|
||||
$packageIndex, //Paquetes
|
||||
$packageCreate,
|
||||
$packageEdit,
|
||||
$packageDestroy,
|
||||
$tagIndex, //Etiquetas
|
||||
$tagCreate,
|
||||
$tagEdit,
|
||||
$tagDestroy
|
||||
|
||||
], ['description' => 'Administrador'])->syncPermissions(
|
||||
// Usuarios
|
||||
$userIndex, $userCreate, $userEdit, $userDestroy,
|
||||
// Roles
|
||||
$roleIndex, $roleCreate, $roleEdit, $roleDestroy, $rolePermissions,
|
||||
// Módulos
|
||||
$moduleIndex, $moduleCreate, $moduleEdit, $moduleDestroy, $moduleToggleStatus,
|
||||
// Dispositivos
|
||||
$deviceIndex, $deviceCreate, $deviceEdit, $deviceDestroy, $deviceToggleStatus,
|
||||
// Inscripciones
|
||||
$inscriptionVehicle, $inscriptionSearch, $inscriptionSearchNational,
|
||||
// Cancelaciones
|
||||
$cancellationTagNoAsignado,
|
||||
// Actualizaciones
|
||||
$updateVehicleData, $updateVehicleUpdate, $updateResendToRepuve,
|
||||
// Generar formatos
|
||||
$recordGeneratePdf, $recordGeneratePdfVerification, $recordGeneratePdfConstancia, $recordGeneratePdfForm,
|
||||
// Reportes
|
||||
$reportVehicleUpdates, $reportSubstitutions, $reportCancellations,
|
||||
$reportGeneral, $reportSearchRecords,
|
||||
// Cajas
|
||||
$packageIndex, $packageCreate, $packageEdit, $packageDestroy, $packageBoxTags,
|
||||
// Constancias
|
||||
$tagIndex, $tagCreate, $tagEdit, $tagDestroy,
|
||||
);
|
||||
|
||||
// Encargado
|
||||
Role::updateOrCreate([
|
||||
'name' => 'encargado',
|
||||
'description' => 'Encargado',
|
||||
'guard_name' => 'api'
|
||||
])->syncPermissions(
|
||||
$userIndex,
|
||||
$roleIndex,
|
||||
|
||||
$deviceIndex, //Dispositivos
|
||||
$deviceCreate,
|
||||
$deviceEdit,
|
||||
$deviceDestroy,
|
||||
$inscriptionVehicle, //Inscripcion de vehículos
|
||||
$inscriptionSearch,
|
||||
$updateVehicleData, //Actualizaciones de vehículo
|
||||
$updateVehicleUpdate,
|
||||
$recordGeneratePdf, //Expedientes
|
||||
$recordGeneratePdfVerification,
|
||||
$recordGeneratePdfConstancia,
|
||||
$recordGeneratePdfSubtitution,
|
||||
$recordGeneratePdfDamaged,
|
||||
$packageIndex, //Paquetes
|
||||
$packageCreate,
|
||||
$packageEdit,
|
||||
$packageDestroy,
|
||||
$tagIndex, //Etiquetas
|
||||
$tagCreate,
|
||||
$tagEdit,
|
||||
$tagDestroy,
|
||||
$tagAssignToModule
|
||||
);
|
||||
|
||||
// Capturista
|
||||
Role::updateOrCreate([
|
||||
'name' => 'capturista',
|
||||
'description' => 'Capturista',
|
||||
'guard_name' => 'api'
|
||||
])->syncPermissions(
|
||||
$userIndex,
|
||||
$inscriptionVehicle, //Inscripcion de vehículos
|
||||
$inscriptionSearch,
|
||||
$updateVehicleData, //Actualizaciones de vehículo
|
||||
$updateVehicleUpdate,
|
||||
], ['description' => 'Encargado'])->syncPermissions(
|
||||
// Dispositivos
|
||||
$deviceIndex, $deviceCreate, $deviceEdit, $deviceDestroy, $deviceToggleStatus,
|
||||
// Inscripciones
|
||||
$inscriptionVehicle, $inscriptionSearch, $inscriptionSearchNational,
|
||||
// Cancelaciones
|
||||
$cancellationTagNoAsignado,
|
||||
// Actualizaciones
|
||||
$updateVehicleData, $updateVehicleUpdate,
|
||||
// Generar formatos
|
||||
$recordGeneratePdf, $recordGeneratePdfVerification, $recordGeneratePdfConstancia, $recordGeneratePdfForm,
|
||||
// Reportes
|
||||
$reportVehicleUpdates, $reportSubstitutions, $reportCancellations,
|
||||
$reportGeneral, $reportSearchRecords,
|
||||
// Cajas
|
||||
$packageIndex, $packageCreate, $packageEdit, $packageDestroy, $packageBoxTags,
|
||||
// Constancias
|
||||
$tagIndex, $tagCreate, $tagEdit, $tagDestroy, $tagAssignToModule,
|
||||
);
|
||||
|
||||
// Perito
|
||||
Role::updateOrCreate([
|
||||
'name' => 'perito',
|
||||
'description' => 'Perito',
|
||||
'guard_name' => 'api'
|
||||
])->syncPermissions(
|
||||
$userIndex,
|
||||
$inscriptionVehicle, //Inscripcion de vehículos
|
||||
$inscriptionSearch,
|
||||
$updateVehicleData, //Actualizaciones de vehículo
|
||||
$updateVehicleUpdate,
|
||||
], ['description' => 'Perito'])->syncPermissions(
|
||||
// Generar formatos
|
||||
$recordGeneratePdf, $recordGeneratePdfVerification, $recordGeneratePdfConstancia, $recordGeneratePdfForm,
|
||||
// Cajas
|
||||
$packageIndex, $packageBoxTags,
|
||||
// Constancias
|
||||
$tagIndex,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ RUN chown -R www-data:www-data /var/www/repuve-backend-v1/storage /var/www/repuv
|
||||
RUN chmod -R 775 /var/www/repuve-backend-v1/storage /var/www/repuve-backend-v1/bootstrap/cache
|
||||
|
||||
EXPOSE 9000
|
||||
EXPOSE 3306
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint-dev.sh"]
|
||||
CMD ["php-fpm"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user