Testing Alpha
This commit is contained in:
0
database/data/apis/apis.json
Normal file
0
database/data/apis/apis.json
Normal file
4
database/data/fixtures/users.csv
Normal file
4
database/data/fixtures/users.csv
Normal file
@ -0,0 +1,4 @@
|
||||
name,email,password,roles,avatar_path
|
||||
Koneko Admin,sadmin@koneko.mx,LAdmin123,"[""SuperAdmin""]",vendor/vuexy-admin/img/logo/koneko-02.png
|
||||
Administrador,admin@koneko.mx,LAdmin123,"[""Admin""]",vendor/vuexy-admin/img/logo/koneko-03.png
|
||||
Auditor,auditor@koneko.mx,LAdmin123,"[""Auditor""]",vendor/vuexy-admin/img/logo/koneko-03.png
|
|
@ -1,510 +0,0 @@
|
||||
{
|
||||
"roles": {
|
||||
"SuperAdmin" : {
|
||||
"style": "dark",
|
||||
"permissions" : [
|
||||
"admin.core.general-settings.allow",
|
||||
"admin.core.cache-manager.view",
|
||||
"admin.core.smtp-settings.allow",
|
||||
"admin.store-manager.company.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.finance.banxico.allow",
|
||||
"admin.finance.banking.allow",
|
||||
"admin.sales.ticket-config.allow",
|
||||
"admin.billing.csds-settings.allow",
|
||||
"admin.billing.stamping-package.allow",
|
||||
"admin.billing.smtp-settings.allow",
|
||||
"admin.billing.mass-cfdi-download.allow",
|
||||
"admin.core.users.view",
|
||||
"admin.core.roles.view",
|
||||
"admin.core.permissions.view",
|
||||
"admin.core.import-sat-catalogs.allow",
|
||||
"admin.ai.dashboard.view",
|
||||
"admin.ai.content.create",
|
||||
"admin.ai.analytics.view",
|
||||
"admin.chatbot.config.view",
|
||||
"admin.chatbot.flows.manage",
|
||||
"admin.chatbot.history.view",
|
||||
"admin.iot.devices.view",
|
||||
"admin.iot.sensors.manage",
|
||||
"admin.iot.monitoring.view",
|
||||
"admin.facial-recognition.profiles.manage",
|
||||
"admin.facial-recognition.live.verify",
|
||||
"admin.facial-recognition.history.view",
|
||||
"admin.print.queue.view",
|
||||
"admin.print.history.view",
|
||||
"admin.print.settings.manage",
|
||||
"admin.website.general-settings.allow",
|
||||
"admin.website.legal.view",
|
||||
"admin.website.faq.view",
|
||||
"admin.blog.categories.view",
|
||||
"admin.blog.tags.view",
|
||||
"admin.blog.articles.view",
|
||||
"admin.blog.comments.view",
|
||||
"admin.contacts.contacts.view",
|
||||
"admin.contacts.employees.view",
|
||||
"admin.contacts.employees.create",
|
||||
"admin.rrhh.jobs.view",
|
||||
"admin.rrhh.organization.view",
|
||||
"admin.recruitment.jobs.view",
|
||||
"admin.recruitment.candidates.view",
|
||||
"admin.recruitment.interviews.view",
|
||||
"admin.payroll.contracts.view",
|
||||
"admin.payroll.process.view",
|
||||
"admin.payroll.receipts.view",
|
||||
"admin.payroll.reports.view",
|
||||
"admin.attendance.records.view",
|
||||
"admin.attendance.biometric.view",
|
||||
"admin.attendance.absences.view",
|
||||
"admin.inventory.product-categories.view",
|
||||
"admin.inventory.product-catalogs.view",
|
||||
"admin.products.products.view",
|
||||
"admin.products.products.create",
|
||||
"admin.sales.dashboard.allow",
|
||||
"admin.contacts.customers.view",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.quotes.view",
|
||||
"admin.sales.sales.create",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.remissions.create",
|
||||
"admin.sales.remissions.view",
|
||||
"admin.sales.remissions.view",
|
||||
"admin.sales.credit-notes.create",
|
||||
"admin.sales.credit-notes.view",
|
||||
"admin.sales.credit-notes.view",
|
||||
"admin.accounting.dashboard.view",
|
||||
"admin.accounting.charts.view",
|
||||
"admin.finance.accounts-payable.view",
|
||||
"admin.finance.accounts-receivable.view",
|
||||
"admin.accounting.balance.view",
|
||||
"admin.accounting.income-statement.view",
|
||||
"admin.accounting.ledger.view",
|
||||
"admin.accounting.entries.view",
|
||||
"admin.expenses.dashboard.view",
|
||||
"admin.expenses.expenses.create",
|
||||
"admin.expenses.expenses.view",
|
||||
"admin.expenses.categories.view",
|
||||
"admin.expenses.history.view",
|
||||
"admin.billing.dashboard.allow",
|
||||
"admin.billing.ingresos.create",
|
||||
"admin.billing.ingresos.view",
|
||||
"admin.billing.ingresos.view",
|
||||
"admin.billing.egresos.create",
|
||||
"admin.billing.egresos.view",
|
||||
"admin.billing.egresos.view",
|
||||
"admin.billing.pagos.created",
|
||||
"admin.billing.pagos.view",
|
||||
"admin.billing.nomina.view",
|
||||
"admin.billing.verify-cfdi.allow",
|
||||
"admin.contacts.suppliers.view",
|
||||
"admin.purchase-orders.orders.view",
|
||||
"admin.purchase-orders.reception.view",
|
||||
"admin.purchase-orders.materials.view",
|
||||
"admin.inventory.warehouse.view",
|
||||
"admin.inventory.stock.view",
|
||||
"admin.inventory.movements.view",
|
||||
"admin.inventory.transfers.view",
|
||||
"admin.shipping.orders.view",
|
||||
"admin.shipping.tracking.view",
|
||||
"admin.shipping.carriers.view",
|
||||
"admin.shipping.rates.view",
|
||||
"admin.assets.assets.view",
|
||||
"admin.assets.maintenance.view",
|
||||
"admin.assets.lifecycle.view",
|
||||
"admin.assets.assignments.view",
|
||||
"admin.projects.dashboard.view",
|
||||
"admin.projects.view",
|
||||
"admin.projects.create",
|
||||
"admin.projects.tasks.view",
|
||||
"admin.projects.history.view",
|
||||
"admin.production.orders.view",
|
||||
"admin.production.orders.create",
|
||||
"admin.production.process.view",
|
||||
"admin.production.history.view",
|
||||
"admin.quality.inspections.view",
|
||||
"admin.quality.inspections.create",
|
||||
"admin.quality.reports.view",
|
||||
"admin.quality.history.view",
|
||||
"admin.workflows.view",
|
||||
"admin.workflows.create",
|
||||
"admin.workflows.automations.view",
|
||||
"admin.workflows.history.view",
|
||||
"admin.contracts.view",
|
||||
"admin.contracts.sign",
|
||||
"admin.contracts.automated.view",
|
||||
"admin.contracts.history.view",
|
||||
"admin.ticketing.dashboard.view",
|
||||
"admin.ticketing.tickets.view",
|
||||
"admin.ticketing.tickets.create",
|
||||
"admin.ticketing.categories.view",
|
||||
"admin.ticketing.analytics.view"
|
||||
]
|
||||
},
|
||||
"Admin" : {
|
||||
"style": "primary",
|
||||
"permissions" : [
|
||||
"admin.core.general-settings.allow",
|
||||
"admin.core.cache-manager.view",
|
||||
"admin.core.smtp-settings.allow",
|
||||
"admin.website.general-settings.allow",
|
||||
"admin.website.legal.view",
|
||||
"admin.store-manager.company.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.core.users.view",
|
||||
"admin.core.roles.view",
|
||||
"admin.core.permissions.view",
|
||||
"admin.core.import-sat-catalogs.allow",
|
||||
"admin.contacts.contacts.view",
|
||||
"admin.contacts.contacts.create",
|
||||
"admin.contacts.employees.view",
|
||||
"admin.contacts.employees.create",
|
||||
"admin.contacts.customers.view",
|
||||
"admin.contacts.customers.create",
|
||||
"admin.rrhh.jobs.view",
|
||||
"admin.rrhh.organization.view",
|
||||
"admin.inventory.product-categories.view",
|
||||
"admin.inventory.product-catalogs.view",
|
||||
"admin.products.products.view",
|
||||
"admin.products.products.create",
|
||||
"admin.contacts.suppliers.view",
|
||||
"admin.contacts.suppliers.create",
|
||||
"admin.inventory.warehouse.view",
|
||||
"admin.purchase-orders.orders.view",
|
||||
"admin.purchase-orders.reception.view",
|
||||
"admin.purchase-orders.materials.view",
|
||||
"admin.inventory.stock.view",
|
||||
"admin.inventory.movements.view",
|
||||
"admin.inventory.transfers.view",
|
||||
"admin.assets.assets.view",
|
||||
"admin.assets.maintenance.view",
|
||||
"admin.assets.lifecycle.view",
|
||||
"admin.assets.assignments.view"
|
||||
]
|
||||
},
|
||||
"Administrador Web" : {
|
||||
"style": "primary",
|
||||
"permissions" : []
|
||||
},
|
||||
"Editor" : {
|
||||
"style": "primary",
|
||||
"permissions" : []
|
||||
},
|
||||
"Almacenista" : {
|
||||
"style": "success",
|
||||
"permissions" : [
|
||||
"admin.inventory.product-categories.view",
|
||||
"admin.inventory.product-catalogs.view",
|
||||
"admin.products.products.view",
|
||||
"admin.products.products.create",
|
||||
"admin.inventory.warehouse.view",
|
||||
"admin.inventory.stock.view",
|
||||
"admin.inventory.movements.view",
|
||||
"admin.inventory.transfers.view"
|
||||
]
|
||||
},
|
||||
"Productos y servicios" : {
|
||||
"style": "info",
|
||||
"permissions" : []
|
||||
},
|
||||
"Recursos humanos" : {
|
||||
"style": "success",
|
||||
"permissions" : []
|
||||
},
|
||||
"Nómina" : {
|
||||
"style": "success",
|
||||
"permissions" : []
|
||||
},
|
||||
"Activos fijos" : {
|
||||
"style": "secondary",
|
||||
"permissions" : []
|
||||
},
|
||||
"Compras y gastos" : {
|
||||
"style": "info",
|
||||
"permissions" : []
|
||||
},
|
||||
"CRM" : {
|
||||
"style": "warning",
|
||||
"permissions" : []
|
||||
},
|
||||
"Vendedor" : {
|
||||
"style": "info",
|
||||
"permissions" : []
|
||||
},
|
||||
"Gerente" : {
|
||||
"style": "danger",
|
||||
"permissions" : []
|
||||
},
|
||||
"Facturación" : {
|
||||
"style": "info",
|
||||
"permissions" : []
|
||||
},
|
||||
"Facturación avanzado" : {
|
||||
"style": "danger",
|
||||
"permissions" : []
|
||||
},
|
||||
"Finanzas" : {
|
||||
"style": "info",
|
||||
"permissions" : []
|
||||
},
|
||||
"Auditor" : {
|
||||
"style": "dark",
|
||||
"permissions" : [
|
||||
"admin.core.cache-manager.view",
|
||||
"admin.store-manager.company.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.core.users.view",
|
||||
"admin.core.roles.view",
|
||||
"admin.core.permissions.view",
|
||||
"admin.ai.dashboard.view",
|
||||
"admin.ai.analytics.view",
|
||||
"admin.chatbot.config.view",
|
||||
"admin.chatbot.history.view",
|
||||
"admin.iot.devices.view",
|
||||
"admin.iot.monitoring.view",
|
||||
"admin.facial-recognition.history.view",
|
||||
"admin.print.queue.view",
|
||||
"admin.print.history.view",
|
||||
"admin.website.legal.view",
|
||||
"admin.website.faq.view",
|
||||
"admin.blog.categories.view",
|
||||
"admin.blog.tags.view",
|
||||
"admin.blog.articles.view",
|
||||
"admin.blog.comments.view",
|
||||
"admin.contacts.contacts.view",
|
||||
"admin.crm.marketing-campaigns.view",
|
||||
"admin.crm.leads.view",
|
||||
"admin.crm.newsletter.view",
|
||||
"admin.contacts.employees.view",
|
||||
"admin.rrhh.jobs.view",
|
||||
"admin.rrhh.organization.view",
|
||||
"admin.recruitment.jobs.view",
|
||||
"admin.recruitment.candidates.view",
|
||||
"admin.recruitment.interviews.view",
|
||||
"admin.payroll.contracts.view",
|
||||
"admin.payroll.process.view",
|
||||
"admin.payroll.receipts.view",
|
||||
"admin.payroll.reports.view",
|
||||
"admin.attendance.records.view",
|
||||
"admin.attendance.biometric.view",
|
||||
"admin.attendance.absences.view",
|
||||
"admin.inventory.product-categories.view",
|
||||
"admin.inventory.product-catalogs.view",
|
||||
"admin.products.products.view",
|
||||
"admin.contacts.customers.view",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.quotes.view",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.remissions.view",
|
||||
"admin.sales.remissions.view",
|
||||
"admin.sales.credit-notes.view",
|
||||
"admin.sales.credit-notes.view",
|
||||
"admin.accounting.dashboard.view",
|
||||
"admin.accounting.charts.view",
|
||||
"admin.finance.accounts-payable.view",
|
||||
"admin.finance.accounts-receivable.view",
|
||||
"admin.accounting.balance.view",
|
||||
"admin.accounting.income-statement.view",
|
||||
"admin.accounting.ledger.view",
|
||||
"admin.accounting.entries.view",
|
||||
"admin.expenses.dashboard.view",
|
||||
"admin.expenses.expenses.view",
|
||||
"admin.expenses.categories.view",
|
||||
"admin.expenses.history.view",
|
||||
"admin.billing.ingresos.view",
|
||||
"admin.billing.ingresos.view",
|
||||
"admin.billing.egresos.view",
|
||||
"admin.billing.egresos.view",
|
||||
"admin.billing.pagos.view",
|
||||
"admin.billing.nomina.view",
|
||||
"admin.contacts.suppliers.view",
|
||||
"admin.purchase-orders.orders.view",
|
||||
"admin.purchase-orders.reception.view",
|
||||
"admin.purchase-orders.materials.view",
|
||||
"admin.inventory.warehouse.view",
|
||||
"admin.inventory.stock.view",
|
||||
"admin.inventory.movements.view",
|
||||
"admin.inventory.transfers.view",
|
||||
"admin.shipping.orders.view",
|
||||
"admin.shipping.tracking.view",
|
||||
"admin.shipping.carriers.view",
|
||||
"admin.shipping.rates.view",
|
||||
"admin.assets.assets.view",
|
||||
"admin.assets.maintenance.view",
|
||||
"admin.assets.lifecycle.view",
|
||||
"admin.assets.assignments.view",
|
||||
"admin.projects.dashboard.view",
|
||||
"admin.projects.view",
|
||||
"admin.projects.tasks.view",
|
||||
"admin.projects.history.view",
|
||||
"admin.production.orders.view",
|
||||
"admin.production.process.view",
|
||||
"admin.production.history.view",
|
||||
"admin.quality.inspections.view",
|
||||
"admin.quality.reports.view",
|
||||
"admin.quality.history.view",
|
||||
"admin.workflows.view",
|
||||
"admin.workflows.automations.view",
|
||||
"admin.workflows.history.view",
|
||||
"admin.contracts.view",
|
||||
"admin.contracts.automated.view",
|
||||
"admin.contracts.history.view",
|
||||
"admin.ticketing.dashboard.view",
|
||||
"admin.ticketing.tickets.view",
|
||||
"admin.ticketing.categories.view",
|
||||
"admin.ticketing.analytics.view"
|
||||
]
|
||||
}
|
||||
},
|
||||
"permissions": [
|
||||
"admin.core.general-settings.allow",
|
||||
"admin.core.cache-manager.view",
|
||||
"admin.core.smtp-settings.allow",
|
||||
"admin.store-manager.company.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.store-manager.stores.view",
|
||||
"admin.finance.banxico.allow",
|
||||
"admin.finance.banking.allow",
|
||||
"admin.sales.ticket-config.allow",
|
||||
"admin.billing.csds-settings.allow",
|
||||
"admin.billing.stamping-package.allow",
|
||||
"admin.billing.smtp-settings.allow",
|
||||
"admin.billing.mass-cfdi-download.allow",
|
||||
"admin.core.users.view",
|
||||
"admin.core.roles.view",
|
||||
"admin.core.permissions.view",
|
||||
"admin.core.import-sat-catalogs.allow",
|
||||
"admin.ai.dashboard.view",
|
||||
"admin.ai.content.create",
|
||||
"admin.ai.analytics.view",
|
||||
"admin.chatbot.config.view",
|
||||
"admin.chatbot.flows.manage",
|
||||
"admin.chatbot.history.view",
|
||||
"admin.iot.devices.view",
|
||||
"admin.iot.sensors.manage",
|
||||
"admin.iot.monitoring.view",
|
||||
"admin.facial-recognition.profiles.manage",
|
||||
"admin.facial-recognition.live.verify",
|
||||
"admin.facial-recognition.history.view",
|
||||
"admin.print.queue.view",
|
||||
"admin.print.history.view",
|
||||
"admin.print.settings.manage",
|
||||
"admin.website.general-settings.allow",
|
||||
"admin.website.legal.view",
|
||||
"admin.website.faq.view",
|
||||
"admin.blog.categories.view",
|
||||
"admin.blog.tags.view",
|
||||
"admin.blog.articles.view",
|
||||
"admin.blog.comments.view",
|
||||
"admin.contacts.contacts.view",
|
||||
"admin.contacts.contacts.create",
|
||||
"admin.crm.marketing-campaigns.view",
|
||||
"admin.crm.leads.view",
|
||||
"admin.crm.newsletter.view",
|
||||
"admin.contacts.employees.view",
|
||||
"admin.contacts.employees.create",
|
||||
"admin.rrhh.jobs.view",
|
||||
"admin.rrhh.organization.view",
|
||||
"admin.recruitment.jobs.view",
|
||||
"admin.recruitment.candidates.view",
|
||||
"admin.recruitment.interviews.view",
|
||||
"admin.payroll.contracts.view",
|
||||
"admin.payroll.process.view",
|
||||
"admin.payroll.receipts.view",
|
||||
"admin.payroll.reports.view",
|
||||
"admin.attendance.records.view",
|
||||
"admin.attendance.biometric.view",
|
||||
"admin.attendance.absences.view",
|
||||
"admin.inventory.product-categories.view",
|
||||
"admin.inventory.product-catalogs.view",
|
||||
"admin.products.products.view",
|
||||
"admin.products.products.create",
|
||||
"admin.sales.dashboard.allow",
|
||||
"admin.contacts.customers.view",
|
||||
"admin.contacts.customers.create",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.quotes.view",
|
||||
"admin.sales.sales.create",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.sales.view",
|
||||
"admin.sales.remissions.create",
|
||||
"admin.sales.remissions.view",
|
||||
"admin.sales.remissions.view",
|
||||
"admin.sales.credit-notes.create",
|
||||
"admin.sales.credit-notes.view",
|
||||
"admin.sales.credit-notes.view",
|
||||
"admin.accounting.dashboard.view",
|
||||
"admin.accounting.charts.view",
|
||||
"admin.finance.accounts-payable.view",
|
||||
"admin.finance.accounts-receivable.view",
|
||||
"admin.accounting.balance.view",
|
||||
"admin.accounting.income-statement.view",
|
||||
"admin.accounting.ledger.view",
|
||||
"admin.accounting.entries.view",
|
||||
"admin.expenses.dashboard.view",
|
||||
"admin.expenses.expenses.create",
|
||||
"admin.expenses.expenses.view",
|
||||
"admin.expenses.categories.view",
|
||||
"admin.expenses.history.view",
|
||||
"admin.billing.dashboard.allow",
|
||||
"admin.billing.ingresos.create",
|
||||
"admin.billing.ingresos.view",
|
||||
"admin.billing.ingresos.view",
|
||||
"admin.billing.egresos.create",
|
||||
"admin.billing.egresos.view",
|
||||
"admin.billing.egresos.view",
|
||||
"admin.billing.pagos.created",
|
||||
"admin.billing.pagos.view",
|
||||
"admin.billing.nomina.view",
|
||||
"admin.billing.verify-cfdi.allow",
|
||||
"admin.contacts.suppliers.view",
|
||||
"admin.contacts.suppliers.create",
|
||||
"admin.purchase-orders.orders.view",
|
||||
"admin.purchase-orders.reception.view",
|
||||
"admin.purchase-orders.materials.view",
|
||||
"admin.inventory.warehouse.view",
|
||||
"admin.inventory.stock.view",
|
||||
"admin.inventory.movements.view",
|
||||
"admin.inventory.transfers.view",
|
||||
"admin.shipping.orders.view",
|
||||
"admin.shipping.tracking.view",
|
||||
"admin.shipping.carriers.view",
|
||||
"admin.shipping.rates.view",
|
||||
"admin.assets.assets.view",
|
||||
"admin.assets.maintenance.view",
|
||||
"admin.assets.lifecycle.view",
|
||||
"admin.assets.assignments.view",
|
||||
"admin.projects.dashboard.view",
|
||||
"admin.projects.view",
|
||||
"admin.projects.create",
|
||||
"admin.projects.tasks.view",
|
||||
"admin.projects.history.view",
|
||||
"admin.production.orders.view",
|
||||
"admin.production.orders.create",
|
||||
"admin.production.process.view",
|
||||
"admin.production.history.view",
|
||||
"admin.quality.inspections.view",
|
||||
"admin.quality.inspections.create",
|
||||
"admin.quality.reports.view",
|
||||
"admin.quality.history.view",
|
||||
"admin.workflows.view",
|
||||
"admin.workflows.create",
|
||||
"admin.workflows.automations.view",
|
||||
"admin.workflows.history.view",
|
||||
"admin.contracts.view",
|
||||
"admin.contracts.sign",
|
||||
"admin.contracts.automated.view",
|
||||
"admin.contracts.history.view",
|
||||
"admin.ticketing.dashboard.view",
|
||||
"admin.ticketing.tickets.view",
|
||||
"admin.ticketing.tickets.create",
|
||||
"admin.ticketing.categories.view",
|
||||
"admin.ticketing.analytics.view"
|
||||
]
|
||||
}
|
||||
|
||||
|
892
database/data/rbac/permissions.json
Normal file
892
database/data/rbac/permissions.json
Normal file
@ -0,0 +1,892 @@
|
||||
{
|
||||
"module": "admin.core",
|
||||
"name": {
|
||||
"es": "Koneko Vuexy Admin",
|
||||
"en": "Koneko Vuexy Admin"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de ajustes de sistema",
|
||||
"en": "Permissions for managing system settings"
|
||||
},
|
||||
"icon": "ti ti-adjustments-alt"
|
||||
},
|
||||
"priority": "first",
|
||||
"groups": {
|
||||
"system-settings":{
|
||||
"name": {
|
||||
"es": "Ajustes de sistema",
|
||||
"en": "System settings"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de ajustes de sistema",
|
||||
"en": "Permissions for managing system settings"
|
||||
},
|
||||
"icon": "ti ti-adjustments-alt"
|
||||
},
|
||||
"priority": "first",
|
||||
"sub_groups": {
|
||||
"web-interface": {
|
||||
"name": {
|
||||
"es": "Interfaz Web",
|
||||
"en": "Web Interface"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la configuración de la interfaz web",
|
||||
"en": "Permissions for configuring the web interface"
|
||||
},
|
||||
"icon": "ti ti-device-desktop-cog"
|
||||
},
|
||||
"priority": 100,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver configuración de interfaz web",
|
||||
"en": "View web interface settings"
|
||||
},
|
||||
"key": "settings.web-interface.view"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Modificar configuración de interfaz web",
|
||||
"en": "Update web interface settings"
|
||||
},
|
||||
"key": "settings.web-interface.update"
|
||||
}
|
||||
]
|
||||
},
|
||||
"vuexy-interface": {
|
||||
"name": {
|
||||
"es": "Interfaz Vuexy",
|
||||
"en": "Vuexy Interface"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la configuración de la interfaz Vuexy",
|
||||
"en": "Permissions for configuring the Vuexy interface"
|
||||
},
|
||||
"icon": "ti ti-template"
|
||||
},
|
||||
"priority": 200,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver configuración de interfaz Vuexy",
|
||||
"en": "View Vuexy interface settings"
|
||||
},
|
||||
"key": "settings.vuexy-interface.view"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Modificar configuración de interfaz Vuexy",
|
||||
"en": "Update Vuexy interface settings"
|
||||
},
|
||||
"key": "settings.vuexy-interface.update"
|
||||
}
|
||||
]
|
||||
},
|
||||
"smtp": {
|
||||
"name": {
|
||||
"es": "Servidor SMTP",
|
||||
"en": "SMTP Server"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la configuración del servidor SMTP",
|
||||
"en": "Permissions for configuring the SMTP server"
|
||||
},
|
||||
"icon": "ti ti-mail-cog"
|
||||
},
|
||||
"priority": 300,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver configuración de servidor SMTP",
|
||||
"en": "View SMTP server settings"
|
||||
},
|
||||
"key": "settings.smtp.view"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Modificar configuración de servidor SMTP",
|
||||
"en": "Update SMTP server settings"
|
||||
},
|
||||
"key": "settings.smtp.update"
|
||||
}
|
||||
]
|
||||
},
|
||||
"apis": {
|
||||
"name": {
|
||||
"es": "APIs",
|
||||
"en": "APIs"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de APIs e integraciones",
|
||||
"en": "Permissions for managing APIs and integrations"
|
||||
},
|
||||
"icon": "ti ti-plug-connected"
|
||||
},
|
||||
"priority": 400,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver configuración de APIs",
|
||||
"en": "View APIs configuration"
|
||||
},
|
||||
"key": "settings.apis.view"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Modificar configuración de APIs",
|
||||
"en": "Update APIs configuration"
|
||||
},
|
||||
"key": "settings.apis.update"
|
||||
}
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"name": {
|
||||
"es": "Variables de entorno",
|
||||
"en": "Environment Variables"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de variables de entorno",
|
||||
"en": "Permissions for managing environment variables"
|
||||
},
|
||||
"icon": "ti ti-settings-code"
|
||||
},
|
||||
"priority": 500,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver variables de entorno",
|
||||
"en": "View environment variables"
|
||||
},
|
||||
"key": "settings.env.view"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Modificar variables de entorno",
|
||||
"en": "Update environment variables"
|
||||
},
|
||||
"key": "settings.env.update"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"users-rbac": {
|
||||
"name": {
|
||||
"es": "Usuarios y control de Acceso",
|
||||
"en": "Users and Access Control"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de usuarios y permisos de control de acceso (RBAC)",
|
||||
"en": "Permissions for managing users and access control (RBAC)"
|
||||
},
|
||||
"icon": "ti ti-lock-access"
|
||||
},
|
||||
"priority": 100,
|
||||
"sub_groups": {
|
||||
"users": {
|
||||
"name": {
|
||||
"es": "Usuarios de sistema",
|
||||
"en": "System users"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de usuarios de sistema",
|
||||
"en": "Permissions for managing system users"
|
||||
},
|
||||
"icon": "__MENU__"
|
||||
},
|
||||
"priority": 100,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver listado de usuarios",
|
||||
"en": "View user list"
|
||||
},
|
||||
"key": "users.users.view"
|
||||
},
|
||||
{
|
||||
"action": "create",
|
||||
"label": {
|
||||
"es": "Crear usuario",
|
||||
"en": "Create user"
|
||||
},
|
||||
"key": "users.users.create"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Editar usuario",
|
||||
"en": "Update user"
|
||||
},
|
||||
"key": "users.users.update"
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"label": {
|
||||
"es": "Eliminar usuario",
|
||||
"en": "Delete user"
|
||||
},
|
||||
"key": "users.users.delete"
|
||||
},
|
||||
{
|
||||
"action": "export",
|
||||
"label": {
|
||||
"es": "Exportar listado de usuarios",
|
||||
"en": "Export userlist"
|
||||
},
|
||||
"key": "users.users.export"
|
||||
},
|
||||
{
|
||||
"action": "assign",
|
||||
"label": {
|
||||
"es": "Asignar roles",
|
||||
"en": "Assign roles"
|
||||
},
|
||||
"key": "users.users-role.assign"
|
||||
}
|
||||
]
|
||||
},
|
||||
"roles": {
|
||||
"name": {
|
||||
"es": "Roles",
|
||||
"en": "Roles"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de roles",
|
||||
"en": "Permissions for managing roles"
|
||||
},
|
||||
"icon": "ti ti-lock-access"
|
||||
},
|
||||
"priority": 200,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver roles",
|
||||
"en": "View roles"
|
||||
},
|
||||
"key": "rbac.roles.view"
|
||||
},
|
||||
{
|
||||
"action": "create",
|
||||
"label": {
|
||||
"es": "Crear rol",
|
||||
"en": "Create role"
|
||||
},
|
||||
"key": "rbac.roles.create"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Editar rol",
|
||||
"en": "Update role"
|
||||
},
|
||||
"key": "rbac.roles.update"
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"label": {
|
||||
"es": "Eliminar rol",
|
||||
"en": "Delete role"
|
||||
},
|
||||
"key": "rbac.roles.delete"
|
||||
},
|
||||
{
|
||||
"action": "duplicate",
|
||||
"label": {
|
||||
"es": "Duplicar rol",
|
||||
"en": "Duplicate role"
|
||||
},
|
||||
"key": "rbac.roles.duplicate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"permissions": {
|
||||
"name": {
|
||||
"es": "Permisos",
|
||||
"en": "Permissions"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de permisos",
|
||||
"en": "Permissions for managing permissions"
|
||||
},
|
||||
"icon": "ti ti-lock-access",
|
||||
"flags": {
|
||||
"is_development": true
|
||||
}
|
||||
},
|
||||
"priority": 300,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver permisos",
|
||||
"en": "View permissions"
|
||||
},
|
||||
"key": "rbac.permissions.view"
|
||||
},
|
||||
{
|
||||
"action": "create",
|
||||
"label": {
|
||||
"es": "Crear permiso",
|
||||
"en": "Create permission"
|
||||
},
|
||||
"key": "rbac.permissions.create"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Editar permiso",
|
||||
"en": "Update permission"
|
||||
},
|
||||
"key": "rbac.permissions.update"
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"label": {
|
||||
"es": "Eliminar permiso",
|
||||
"en": "Delete permission"
|
||||
},
|
||||
"key": "rbac.permissions.delete"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"tools": {
|
||||
"name": {
|
||||
"es": "Herramientas de sistema",
|
||||
"en": "System Tools"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para tareas programadas, caché, monitoreo y notificaciones del sistema",
|
||||
"en": "Permissions for scheduled tasks, cache, monitoring and system notifications"
|
||||
},
|
||||
"icon": "ti ti-tool"
|
||||
},
|
||||
"priority": 200,
|
||||
"sub_groups": {
|
||||
"scheduler": {
|
||||
"name": {
|
||||
"es": "Tareas programadas",
|
||||
"en": "Scheduled Tasks"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Supervisa y gestiona tareas periódicas, workers y ejecución en cola.",
|
||||
"en": "Monitor and manage periodic tasks, workers, and queued execution."
|
||||
},
|
||||
"icon": "ti ti-clock"
|
||||
},
|
||||
"priority": 100,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver panel general",
|
||||
"en": "View scheduler dashboard"
|
||||
},
|
||||
"key": "scheduler.dashboard.view"
|
||||
},
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver tareas programadas",
|
||||
"en": "View scheduled tasks"
|
||||
},
|
||||
"key": "scheduler.cron.view"
|
||||
},
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver jobs en cola",
|
||||
"en": "View queued jobs"
|
||||
},
|
||||
"key": "scheduler.queued-jobs.view"
|
||||
},
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver historial de ejecución",
|
||||
"en": "View execution history"
|
||||
},
|
||||
"key": "scheduler.history.view"
|
||||
},
|
||||
{
|
||||
"action": "configure",
|
||||
"label": {
|
||||
"es": "Configurar scheduler",
|
||||
"en": "Configure scheduler"
|
||||
},
|
||||
"key": "scheduler.settings.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"cache": {
|
||||
"name": {
|
||||
"es": "Gestión de Caché",
|
||||
"en": "Cache Management"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Limpieza y configuración de caché del sistema",
|
||||
"en": "System cache cleaning and configuration"
|
||||
},
|
||||
"icon": "ti ti-cpu"
|
||||
},
|
||||
"priority": 200,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "clean",
|
||||
"label": {
|
||||
"es": "Limpiar caché Redis",
|
||||
"en": "Clean Redis cache"
|
||||
},
|
||||
"key": "cache.redis.view"
|
||||
},
|
||||
{
|
||||
"action": "clean",
|
||||
"label": {
|
||||
"es": "Limpiar caché Memcache",
|
||||
"en": "Clean Memcache cache"
|
||||
},
|
||||
"key": "cache.memcache.view"
|
||||
},
|
||||
{
|
||||
"action": "clean",
|
||||
"label": {
|
||||
"es": "Limpiar sesiones",
|
||||
"en": "Clear sessions"
|
||||
},
|
||||
"key": "cache.sessions.view"
|
||||
},
|
||||
{
|
||||
"action": "clean",
|
||||
"label": {
|
||||
"es": "Limpiar caché Laravel",
|
||||
"en": "Clean Laravel cache"
|
||||
},
|
||||
"key": "cache.laravel.view"
|
||||
},
|
||||
{
|
||||
"action": "clean",
|
||||
"label": {
|
||||
"es": "Limpiar caché Vuexy",
|
||||
"en": "Clean Vuexy cache"
|
||||
},
|
||||
"key": "cache.vuexy.view"
|
||||
},
|
||||
{
|
||||
"action": "clean",
|
||||
"label": {
|
||||
"es": "Limpiar assets generados",
|
||||
"en": "Clean Vite assets"
|
||||
},
|
||||
"key": "cache.vite-assets.view"
|
||||
},
|
||||
{
|
||||
"action": "configure",
|
||||
"label": {
|
||||
"es": "Ajustar TTLs",
|
||||
"en": "Adjust TTLs"
|
||||
},
|
||||
"key": "cache.ttls.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"notifications": {
|
||||
"name": {
|
||||
"es": "Centro de Notificaciones",
|
||||
"en": "Notification Center"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Notificaciones globales, personales y configuración del centro",
|
||||
"en": "Global, personal notifications and alert center settings"
|
||||
},
|
||||
"icon": "ti ti-bell"
|
||||
},
|
||||
"priority": 300,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver notificaciones globales",
|
||||
"en": "View global notifications"
|
||||
},
|
||||
"key": "notifications.system.view"
|
||||
},
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver notificaciones personales",
|
||||
"en": "View personal notifications"
|
||||
},
|
||||
"key": "notifications.personal.view"
|
||||
},
|
||||
{
|
||||
"action": "configure",
|
||||
"label": {
|
||||
"es": "Configurar centro de alertas",
|
||||
"en": "Configure alert center"
|
||||
},
|
||||
"key": "notifications.settings.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"monitoring": {
|
||||
"name": {
|
||||
"es": "Monitoreo del Sistema",
|
||||
"en": "System Monitoring"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Supervisión de sesiones activas y uso del sistema",
|
||||
"en": "Active session and system usage monitoring"
|
||||
},
|
||||
"icon": "ti ti-heart-rate-monitor"
|
||||
},
|
||||
"priority": 400,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver sesiones activas",
|
||||
"en": "View active sessions"
|
||||
},
|
||||
"key": "monitor.sessions.view"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"vuexy-admin": {
|
||||
"name": {
|
||||
"es": "Koneko Vuexy Admin",
|
||||
"en": "Koneko Vuexy Admin"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de Koneko Vuexy Admin",
|
||||
"en": "Permissions for managing Koneko Vuexy Admin"
|
||||
},
|
||||
"icon": "ti ti-lock-access"
|
||||
},
|
||||
"priority": 300,
|
||||
"sub_groups": {
|
||||
"plugins": {
|
||||
"name": {
|
||||
"es": "Librerías y plugins",
|
||||
"en": "Libraries and plugins"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Gestiona las librerías y plugins del módulo Vuexy Admin.",
|
||||
"en": "Manage libraries and plugins in the Vuexy Admin module."
|
||||
},
|
||||
"icon": "ti ti-plug"
|
||||
},
|
||||
"priority": 100,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver plugins",
|
||||
"en": "View plugins"
|
||||
},
|
||||
"key": "modules.plugins.view"
|
||||
},
|
||||
{
|
||||
"action": "install",
|
||||
"label": {
|
||||
"es": "Instalar plugins",
|
||||
"en": "Install plugins"
|
||||
},
|
||||
"key": "modules.plugins.install"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Actualizar plugins",
|
||||
"en": "Update plugins"
|
||||
},
|
||||
"key": "modules.plugins.update"
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"label": {
|
||||
"es": "Eliminar plugins",
|
||||
"en": "Delete plugins"
|
||||
},
|
||||
"key": "modules.plugins.delete"
|
||||
}
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"name": {
|
||||
"es": "Configuración de módulos",
|
||||
"en": "Modules configuration"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Administra la configuración avanzada de módulos y paquetes instalados.",
|
||||
"en": "Manage advanced configuration of installed modules and packages."
|
||||
},
|
||||
"icon": "ti ti-puzzle"
|
||||
},
|
||||
"priority": 200,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver configuración",
|
||||
"en": "View configuration"
|
||||
},
|
||||
"key": "modules.config.view"
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"label": {
|
||||
"es": "Editar configuración",
|
||||
"en": "Edit configuration"
|
||||
},
|
||||
"key": "modules.config.update"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"audit": {
|
||||
"name": {
|
||||
"es": "Auditoría",
|
||||
"en": "Audit"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Permisos para la gestión de auditoría",
|
||||
"en": "Permissions for managing audit"
|
||||
},
|
||||
"icon": "ti ti-bell"
|
||||
},
|
||||
"priority": 400,
|
||||
"sub_groups": {
|
||||
"access": {
|
||||
"name": {
|
||||
"es": "Eventos de Acceso",
|
||||
"en": "Access Events"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Historial de inicios de sesión y cierres por usuario.",
|
||||
"en": "Login and logout history per user."
|
||||
},
|
||||
"icon": "ti ti-user-shield"
|
||||
},
|
||||
"priority": 100,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver logs de acceso",
|
||||
"en": "View access logs"
|
||||
},
|
||||
"key": "audit.access.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"security-events": {
|
||||
"name": {
|
||||
"es": "Eventos de Seguridad",
|
||||
"en": "Security Events"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Registros enriquecidos con geolocalización, IP, dispositivos y actividad sospechosa.",
|
||||
"en": "Logs enriched with geolocation, IP, devices, and suspicious activity."
|
||||
},
|
||||
"icon": "ti ti-shield"
|
||||
},
|
||||
"priority": 200,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver eventos de seguridad",
|
||||
"en": "View security events"
|
||||
},
|
||||
"key": "audit.security-events.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"user-interactions": {
|
||||
"name": {
|
||||
"es": "Interacciones de Usuario",
|
||||
"en": "User Interactions"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Registro detallado de acciones ejecutadas por usuarios en la interfaz.",
|
||||
"en": "Detailed log of user interface actions."
|
||||
},
|
||||
"icon": "ti ti-user-check"
|
||||
},
|
||||
"priority": 300,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver interacciones de usuario",
|
||||
"en": "View user interactions"
|
||||
},
|
||||
"key": "audit.user-interactions.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"file-logs": {
|
||||
"name": {
|
||||
"es": "Logs del Sistema",
|
||||
"en": "System Logs"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Visualiza logs generados por Laravel u otros sistemas locales.",
|
||||
"en": "View logs generated by Laravel or other local systems."
|
||||
},
|
||||
"icon": "ti ti-file-text"
|
||||
},
|
||||
"priority": 400,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver logs del sistema",
|
||||
"en": "View system logs"
|
||||
},
|
||||
"key": "audit.file-logs.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"db-logs": {
|
||||
"name": {
|
||||
"es": "Logs de Base de Datos",
|
||||
"en": "Database Logs"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Consulta los logs persistidos en la base de datos estructurados por tipo y nivel.",
|
||||
"en": "Query logs stored in the database by type and level."
|
||||
},
|
||||
"icon": "ti ti-database-search"
|
||||
},
|
||||
"priority": 500,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver logs de base de datos",
|
||||
"en": "View database logs"
|
||||
},
|
||||
"key": "audit.db-logs.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"modules": {
|
||||
"name": {
|
||||
"es": "Logs por Módulo",
|
||||
"en": "Module Logs"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Visualiza logs agrupados por componente o módulo.",
|
||||
"en": "View logs grouped by component or module."
|
||||
},
|
||||
"icon": "ti ti-box-multiple"
|
||||
},
|
||||
"priority": 600,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver logs por módulo",
|
||||
"en": "View module logs"
|
||||
},
|
||||
"key": "audit.modules.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"alerts": {
|
||||
"name": {
|
||||
"es": "Alertas y Reportes",
|
||||
"en": "Alerts and Reports"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Configura alertas automáticas, condiciones críticas y reportes periódicos.",
|
||||
"en": "Configure automatic alerts, critical conditions, and periodic reports."
|
||||
},
|
||||
"icon": "ti ti-bell"
|
||||
},
|
||||
"priority": 950,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver alertas y reportes",
|
||||
"en": "View alerts and reports"
|
||||
},
|
||||
"key": "audit.alerts.view"
|
||||
}
|
||||
]
|
||||
},
|
||||
"logging-settings": {
|
||||
"name": {
|
||||
"es": "Configuración de Logging",
|
||||
"en": "Logging Configuration"
|
||||
},
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Configuración avanzada del sistema de logging y auditoría.",
|
||||
"en": "Advanced configuration of the logging and audit system."
|
||||
},
|
||||
"icon": "ti ti-settings"
|
||||
},
|
||||
"priority": 999,
|
||||
"permissions": [
|
||||
{
|
||||
"action": "view",
|
||||
"label": {
|
||||
"es": "Ver configuración de logging",
|
||||
"en": "View logging configuration"
|
||||
},
|
||||
"key": "audit.logging-settings.view"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
205
database/data/rbac/roles.json
Normal file
205
database/data/rbac/roles.json
Normal file
@ -0,0 +1,205 @@
|
||||
{
|
||||
"SuperAdmin": {
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Rol con acceso total a todo el sistema, configuración, seguridad y módulos.",
|
||||
"en": "Role with full access to the system, configuration, security, and modules."
|
||||
},
|
||||
"icon": "ti ti-shield-lock",
|
||||
"style": "dark"
|
||||
},
|
||||
"permissions" : [
|
||||
"admin.core.settings.web-interface.view",
|
||||
"admin.core.settings.web-interface.update",
|
||||
"admin.core.settings.vuexy-interface.view",
|
||||
"admin.core.settings.vuexy-interface.update",
|
||||
"admin.core.settings.smtp.view",
|
||||
"admin.core.settings.smtp.update",
|
||||
"admin.core.settings.apis.view",
|
||||
"admin.core.settings.apis.update",
|
||||
"admin.core.settings.env.view",
|
||||
"admin.core.settings.env.update",
|
||||
"admin.core.users.users.view",
|
||||
"admin.core.users.users.create",
|
||||
"admin.core.users.users.update",
|
||||
"admin.core.users.users.delete",
|
||||
"admin.core.users.users.export",
|
||||
"admin.core.users.users-role.assign",
|
||||
"admin.core.rbac.roles.view",
|
||||
"admin.core.rbac.roles.create",
|
||||
"admin.core.rbac.roles.update",
|
||||
"admin.core.rbac.roles.delete",
|
||||
"admin.core.rbac.roles.duplicate",
|
||||
"admin.core.rbac.permissions.view",
|
||||
"admin.core.rbac.permissions.create",
|
||||
"admin.core.rbac.permissions.update",
|
||||
"admin.core.rbac.permissions.delete",
|
||||
"admin.core.scheduler.dashboard.view",
|
||||
"admin.core.scheduler.cron.view",
|
||||
"admin.core.scheduler.queued-jobs.view",
|
||||
"admin.core.scheduler.history.view",
|
||||
"admin.core.scheduler.settings.view",
|
||||
"admin.core.cache.redis.view",
|
||||
"admin.core.cache.memcache.view",
|
||||
"admin.core.cache.sessions.view",
|
||||
"admin.core.cache.laravel.view",
|
||||
"admin.core.cache.vuexy.view",
|
||||
"admin.core.cache.vite-assets.view",
|
||||
"admin.core.cache.ttls.view",
|
||||
"admin.core.notifications.system.view",
|
||||
"admin.core.notifications.personal.view",
|
||||
"admin.core.notifications.settings.view",
|
||||
"admin.core.monitor.sessions.view",
|
||||
"admin.core.modules.plugins.view",
|
||||
"admin.core.modules.plugins.install",
|
||||
"admin.core.modules.plugins.update",
|
||||
"admin.core.modules.plugins.delete",
|
||||
"admin.core.modules.config.view",
|
||||
"admin.core.modules.config.update",
|
||||
"admin.core.audit.access.view",
|
||||
"admin.core.audit.security-events.view",
|
||||
"admin.core.audit.user-interactions.view",
|
||||
"admin.core.audit.file-logs.view",
|
||||
"admin.core.audit.db-logs.view",
|
||||
"admin.core.audit.modules.view",
|
||||
"admin.core.audit.alerts.view",
|
||||
"admin.core.audit.logging-settings.view"
|
||||
]
|
||||
},
|
||||
"Admin": {
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Acceso total a configuración del sistema, usuarios, módulos y caché.",
|
||||
"en": "Full access to system configuration, users, modules, and cache."
|
||||
},
|
||||
"icon": "ti ti-settings",
|
||||
"style": "dark"
|
||||
},
|
||||
"permissions" : [
|
||||
"admin.core.settings.web-interface.view",
|
||||
"admin.core.settings.web-interface.update",
|
||||
"admin.core.settings.vuexy-interface.view",
|
||||
"admin.core.settings.vuexy-interface.update",
|
||||
"admin.core.settings.smtp.view",
|
||||
"admin.core.settings.smtp.update",
|
||||
"admin.core.settings.apis.view",
|
||||
"admin.core.settings.apis.update",
|
||||
"admin.core.settings.env.view",
|
||||
"admin.core.settings.env.update",
|
||||
"admin.core.users.users.view",
|
||||
"admin.core.users.users.create",
|
||||
"admin.core.users.users.update",
|
||||
"admin.core.users.users.delete",
|
||||
"admin.core.users.users.export",
|
||||
"admin.core.users.users-role.assign",
|
||||
"admin.core.rbac.roles.view",
|
||||
"admin.core.rbac.roles.create",
|
||||
"admin.core.rbac.roles.update",
|
||||
"admin.core.rbac.roles.delete",
|
||||
"admin.core.rbac.roles.duplicate",
|
||||
"admin.core.scheduler.dashboard.view",
|
||||
"admin.core.scheduler.cron.view",
|
||||
"admin.core.scheduler.queued-jobs.view",
|
||||
"admin.core.scheduler.history.view",
|
||||
"admin.core.scheduler.settings.view",
|
||||
"admin.core.cache.redis.view",
|
||||
"admin.core.cache.memcache.view",
|
||||
"admin.core.cache.sessions.view",
|
||||
"admin.core.cache.laravel.view",
|
||||
"admin.core.cache.vuexy.view",
|
||||
"admin.core.cache.vite-assets.view",
|
||||
"admin.core.cache.ttls.view",
|
||||
"admin.core.notifications.system.view",
|
||||
"admin.core.notifications.personal.view",
|
||||
"admin.core.notifications.settings.view",
|
||||
"admin.core.monitor.sessions.view",
|
||||
"admin.core.modules.plugins.view",
|
||||
"admin.core.modules.plugins.install",
|
||||
"admin.core.modules.plugins.update",
|
||||
"admin.core.modules.plugins.delete",
|
||||
"admin.core.modules.config.view",
|
||||
"admin.core.modules.config.update",
|
||||
"admin.core.audit.access.view",
|
||||
"admin.core.audit.security-events.view",
|
||||
"admin.core.audit.user-interactions.view",
|
||||
"admin.core.audit.file-logs.view",
|
||||
"admin.core.audit.db-logs.view",
|
||||
"admin.core.audit.modules.view",
|
||||
"admin.core.audit.alerts.view",
|
||||
"admin.core.audit.logging-settings.view"
|
||||
]
|
||||
},
|
||||
"UserAdmin": {
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Gestiona usuarios, roles y permisos del sistema.",
|
||||
"en": "Manages system users, roles, and permissions."
|
||||
},
|
||||
"icon": "ti ti-users",
|
||||
"style": "secondary"
|
||||
},
|
||||
"permissions": [
|
||||
"admin.core.users.users.view",
|
||||
"admin.core.users.users.create",
|
||||
"admin.core.users.users.update",
|
||||
"admin.core.users.users.delete",
|
||||
"admin.core.users.users.export",
|
||||
"admin.core.users.users-role.assign",
|
||||
"admin.core.rbac.roles.view",
|
||||
"admin.core.rbac.roles.create",
|
||||
"admin.core.rbac.roles.update",
|
||||
"admin.core.rbac.roles.delete",
|
||||
"admin.core.rbac.roles.duplicate",
|
||||
"admin.core.rbac.permissions.view",
|
||||
"admin.core.rbac.permissions.create",
|
||||
"admin.core.rbac.permissions.update",
|
||||
"admin.core.rbac.permissions.delete"
|
||||
]
|
||||
},
|
||||
"Auditor": {
|
||||
"_meta": {
|
||||
"description": {
|
||||
"es": "Visualiza logs, interacciones y auditorías del sistema.",
|
||||
"en": "Views logs, interactions, and system audits."
|
||||
},
|
||||
"icon": "ti ti-report-analytics",
|
||||
"style": "info"
|
||||
},
|
||||
"permissions" : [
|
||||
"admin.core.settings.web-interface.view",
|
||||
"admin.core.settings.vuexy-interface.view",
|
||||
"admin.core.settings.smtp.view",
|
||||
"admin.core.settings.apis.view",
|
||||
"admin.core.settings.env.view",
|
||||
"admin.core.users.users.view",
|
||||
"admin.core.rbac.roles.view",
|
||||
"admin.core.rbac.permissions.view",
|
||||
"admin.core.scheduler.dashboard.view",
|
||||
"admin.core.scheduler.cron.view",
|
||||
"admin.core.scheduler.queued-jobs.view",
|
||||
"admin.core.scheduler.history.view",
|
||||
"admin.core.scheduler.settings.view",
|
||||
"admin.core.cache.redis.view",
|
||||
"admin.core.cache.memcache.view",
|
||||
"admin.core.cache.sessions.view",
|
||||
"admin.core.cache.laravel.view",
|
||||
"admin.core.cache.vuexy.view",
|
||||
"admin.core.cache.vite-assets.view",
|
||||
"admin.core.cache.ttls.view",
|
||||
"admin.core.notifications.system.view",
|
||||
"admin.core.notifications.personal.view",
|
||||
"admin.core.notifications.settings.view",
|
||||
"admin.core.monitor.sessions.view",
|
||||
"admin.core.modules.plugins.view",
|
||||
"admin.core.modules.config.view",
|
||||
"admin.core.audit.access.view",
|
||||
"admin.core.audit.security-events.view",
|
||||
"admin.core.audit.user-interactions.view",
|
||||
"admin.core.audit.file-logs.view",
|
||||
"admin.core.audit.db-logs.view",
|
||||
"admin.core.audit.modules.view",
|
||||
"admin.core.audit.alerts.view",
|
||||
"admin.core.audit.logging-settings.view"
|
||||
]
|
||||
}
|
||||
}
|
4
database/data/seeder_samples/users.csv
Normal file
4
database/data/seeder_samples/users.csv
Normal file
@ -0,0 +1,4 @@
|
||||
name,email,password,roles,avatar_path
|
||||
Koneko Admin,sadmin@koneko.mx,LAdmin123,"[""SuperAdmin""]",vendor/vuexy-admin/img/logo/koneko-02.png
|
||||
Administrador,admin@koneko.mx,LAdmin123,"[""Admin""]",vendor/vuexy-admin/img/logo/koneko-03.png
|
||||
Auditor,auditor@koneko.mx,LAdmin123,"[""Auditor""]",vendor/vuexy-admin/img/logo/koneko-03.png
|
|
45
database/data/seeder_samples/users.json
Normal file
45
database/data/seeder_samples/users.json
Normal file
@ -0,0 +1,45 @@
|
||||
[
|
||||
{
|
||||
"name": "Cliente de prueba",
|
||||
"email": "cliente@koneko.mx",
|
||||
"password": "cliente123",
|
||||
"rfc": "XAXX010101000",
|
||||
"roles": ["SuperAdmin"]
|
||||
},
|
||||
{
|
||||
"name": "Proveedor Koneko",
|
||||
"email": "proveedor@koneko.mx",
|
||||
"password": "proveedor123",
|
||||
"tipo_persona": 2,
|
||||
"curp": "GOML850927MOCSRN09",
|
||||
"roles": ["SuperAdmin", "Auditor"]
|
||||
},
|
||||
{
|
||||
"code": "U002",
|
||||
"parent_id": 1,
|
||||
"agent_id": 2,
|
||||
"name": "Usuario Completo",
|
||||
"last_name": "Pérez López",
|
||||
"email": "usuario.completo@example.com",
|
||||
"company": "Empresa de Prueba S.A. de C.V.",
|
||||
"c_pais": "MEX",
|
||||
"birth_date": "1990-06-15",
|
||||
"hire_date": "2022-01-10",
|
||||
"curp": "LOPJ900615HDFRNS03",
|
||||
"nss": "12345678901",
|
||||
"rfc": "LOPJ900615ABC",
|
||||
"nombre_fiscal": "López Pérez Juan",
|
||||
"tipo_persona": 1,
|
||||
"c_regimen_fiscal": 601,
|
||||
"domicilio_fiscal": 64000,
|
||||
"enable_credit": 1,
|
||||
"credit_days": 30,
|
||||
"credit_limit": "15000.00",
|
||||
"license_number": "A123456789",
|
||||
"policy_format": "NOM035",
|
||||
"special_requirements": "Ninguno",
|
||||
"password": "proveedor123",
|
||||
"notes": "Este usuario tiene todos los campos completados.",
|
||||
"status": 1
|
||||
}
|
||||
]
|
@ -1,14 +0,0 @@
|
||||
name,email,role,password
|
||||
Administrador Web,webadmin@koneko.test,Administrador Web,LAdmin123
|
||||
Productos y servicios,productos@koneko.test,Productos y servicios,LAdmin123
|
||||
Recursos humanos,rrhh@koneko.test,Recursos humanos,LAdmin123
|
||||
Nómina,nomina@koneko.test,Nómina,LAdmin123
|
||||
Activos fijos,activos@koneko.test,Activos fijos,LAdmin123
|
||||
Compras y gastos,compras@koneko.test,Compras y gastos,LAdmin123
|
||||
CRM,crm@koneko.test,CRM,LAdmin123
|
||||
Vendedor,vendedor@koneko.test,Vendedor,LAdmin123
|
||||
Gerente,gerente@koneko.test,Gerente,LAdmin123
|
||||
Facturación,facturacion@koneko.test,Facturación,LAdmin123
|
||||
Facturación avanzado,facturacion_avanzado@koneko.test,Facturación avanzado,LAdmin123
|
||||
Finanzas,finanzas@koneko.test,Finanzas,LAdmin123
|
||||
Almacenista,almacenista@koneko.test,Almacenista,LAdmin123
|
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Koneko\VuexyAdmin\Database\factories;
|
||||
|
||||
use Koneko\VuexyAdmin\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\Koneko\VuexyAdmin\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'two_factor_secret' => null,
|
||||
'two_factor_recovery_codes' => null,
|
||||
'remember_token' => Str::random(10),
|
||||
'profile_photo_path' => null,
|
||||
'status' => fake()->randomElement([User::STATUS_ENABLED, User::STATUS_DISABLED])
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn(array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Koneko\VuexyAdmin\Models\User;
|
||||
use Illuminate\Support\Facades\{DB,Schema};
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
@ -19,9 +18,12 @@ return new class extends Migration
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('last_name', 100)->nullable()->comment('Apellidos')->index()->after('name');
|
||||
$table->string('profile_photo_path', 2048)->nullable()->after('remember_token');
|
||||
$table->unsignedTinyInteger('status')->default(User::STATUS_DISABLED)->after('profile_photo_path');
|
||||
$table->boolean('status')->default(1)->after('profile_photo_path');
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index()->after('status');
|
||||
|
||||
// Auditoria
|
||||
$table->softDeletes();
|
||||
|
||||
// Definir la relación con created_by
|
||||
$table->foreign('created_by')->references('id')->on('users')->onUpdate('restrict')->onDelete('restrict');
|
||||
});
|
||||
@ -35,10 +37,5 @@ return new class extends Migration
|
||||
DB::statement('ALTER TABLE `users` MODIFY `id` MEDIUMINT UNSIGNED NOT NULL;');
|
||||
DB::statement('ALTER TABLE `users` DROP PRIMARY KEY;');
|
||||
DB::statement('ALTER TABLE `users` MODIFY `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`id`);');
|
||||
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn(['last_name', 'profile_photo_path', 'status', 'created_by']);
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Koneko\VuexyAdmin\Application\Enums\User\UserBaseFlags;
|
||||
use Koneko\VuexyAdmin\Support\Traits\Migrations\HandlesGeneratedColumns;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
use HandlesGeneratedColumns;
|
||||
|
||||
public function up()
|
||||
{
|
||||
// Añadir columna contenedora si no existe
|
||||
if (!Schema::hasColumn('users', 'flags')) {
|
||||
Schema::table('users', function ($table) {
|
||||
$table->json('flags')
|
||||
->nullable()
|
||||
->after('profile_photo_path')
|
||||
->comment('Dynamic flags storage');
|
||||
});
|
||||
}
|
||||
|
||||
// Añadir columnas generadas
|
||||
$this->addGeneratedColumns('users', UserBaseFlags::cases());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Eliminar columnas generadas
|
||||
$this->dropGeneratedColumns('users', UserBaseFlags::cases());
|
||||
|
||||
// Eliminar columna flags (opcional)
|
||||
Schema::table('users', function ($table) {
|
||||
$table->dropColumnIfExists('flags');
|
||||
});
|
||||
}
|
||||
};
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('user_logins', function (Blueprint $table) {
|
||||
$table->integerIncrements('id');
|
||||
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index();
|
||||
$table->ipAddress('ip_address')->nullable();
|
||||
$table->string('user_agent')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Elimina tablas solo si existen
|
||||
Schema::dropIfExists('user_logins');
|
||||
}
|
||||
};
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('permission_groups', function (Blueprint $table) {
|
||||
$table->smallIncrements('id');
|
||||
|
||||
$table->string("module_register")->index(); // Nombre del módulo registrado
|
||||
$table->unsignedSmallInteger('parent_id')->nullable()->index(); // ID del grupo padre
|
||||
|
||||
$table->string('type', 16)->default('root_group'); // Enum: root_group, sub_group, external_group
|
||||
$table->string("module", 32)->index();
|
||||
$table->string("grupo", 32)->nullable()->index();
|
||||
$table->string("sub_grupo", 32)->nullable()->index();
|
||||
|
||||
$table->json('name')->nullable(); // Nombre i18n
|
||||
$table->json('ui_metadata')->nullable(); // icon, description i18n, flags, ...
|
||||
|
||||
$table->string('priority', 16)->nullable()->index();
|
||||
|
||||
// Auditoría
|
||||
$table->timestamps();
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('parent_id')->references('id')->on('permission_groups')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('permission_groups');
|
||||
}
|
||||
};
|
@ -27,49 +27,69 @@ return new class extends Migration
|
||||
|
||||
Schema::create($tableNames['permissions'], function (Blueprint $table) {
|
||||
//$table->engine('InnoDB');
|
||||
$table->bigIncrements('id'); // permission id
|
||||
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||
$table->string('group_name')->nullable()->index();
|
||||
$table->string('sub_group_name')->nullable()->index();
|
||||
$table->string('action')->nullable()->index();
|
||||
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||
$table->smallIncrements('id');
|
||||
|
||||
// Permiso Spatie
|
||||
$table->string('name')->unique(); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||
|
||||
// Metadata
|
||||
$table->unsignedSmallInteger('group_id')->nullable()->index();
|
||||
$table->json('label')->nullable(); // Nombre del permiso i18n
|
||||
$table->json('ui_metadata')->nullable(); // helperText, floatLabel
|
||||
|
||||
// Acción
|
||||
$table->string('action', 16)->nullable()->index(); // enum PermissionAction: view, create, update, delete, install, clean
|
||||
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||
|
||||
// Auditoría
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['name', 'guard_name']);
|
||||
$table->unique(['group_name', 'sub_group_name', 'action', 'guard_name']);
|
||||
// Relaciones
|
||||
$table->foreign('group_id')
|
||||
->references('id')
|
||||
->on('permission_groups')
|
||||
->restrictOnDelete()
|
||||
->cascadeOnUpdate();
|
||||
});
|
||||
|
||||
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
|
||||
//$table->engine('InnoDB');
|
||||
$table->bigIncrements('id'); // role id
|
||||
$table->smallIncrements('id'); // role id
|
||||
|
||||
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
|
||||
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
|
||||
$table->unsignedSmallInteger($columnNames['team_foreign_key'])->nullable();
|
||||
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
|
||||
}
|
||||
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||
$table->string('style')->nullable();
|
||||
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||
|
||||
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||
$table->json('ui_metadata')->nullable(); // Tailwind classes, icon, helperText, floatLabel
|
||||
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||
|
||||
// Auditoría
|
||||
$table->timestamps();
|
||||
|
||||
if ($teams || config('permission.testing')) {
|
||||
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
|
||||
|
||||
} else {
|
||||
$table->unique(['name', 'guard_name']);
|
||||
}
|
||||
});
|
||||
|
||||
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
|
||||
$table->unsignedBigInteger($pivotPermission);
|
||||
$table->unsignedSmallInteger($pivotPermission);
|
||||
|
||||
$table->string('model_type');
|
||||
$table->unsignedBigInteger($columnNames['model_morph_key']);
|
||||
$table->unsignedSmallInteger($columnNames['model_morph_key']);
|
||||
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
|
||||
|
||||
$table->foreign($pivotPermission)
|
||||
->references('id') // permission id
|
||||
->on($tableNames['permissions'])
|
||||
->onDelete('cascade');
|
||||
|
||||
if ($teams) {
|
||||
$table->unsignedBigInteger($columnNames['team_foreign_key']);
|
||||
$table->unsignedSmallInteger($columnNames['team_foreign_key']);
|
||||
$table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
|
||||
|
||||
$table->primary(
|
||||
@ -85,18 +105,19 @@ return new class extends Migration
|
||||
});
|
||||
|
||||
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
|
||||
$table->unsignedBigInteger($pivotRole);
|
||||
$table->unsignedSmallInteger($pivotRole);
|
||||
|
||||
$table->string('model_type');
|
||||
$table->unsignedBigInteger($columnNames['model_morph_key']);
|
||||
$table->unsignedSmallInteger($columnNames['model_morph_key']);
|
||||
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
|
||||
|
||||
$table->foreign($pivotRole)
|
||||
->references('id') // role id
|
||||
->on($tableNames['roles'])
|
||||
->onDelete('cascade');
|
||||
|
||||
if ($teams) {
|
||||
$table->unsignedBigInteger($columnNames['team_foreign_key']);
|
||||
$table->unsignedSmallInteger($columnNames['team_foreign_key']);
|
||||
$table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
|
||||
|
||||
$table->primary(
|
||||
@ -112,8 +133,8 @@ return new class extends Migration
|
||||
});
|
||||
|
||||
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
|
||||
$table->unsignedBigInteger($pivotPermission);
|
||||
$table->unsignedBigInteger($pivotRole);
|
||||
$table->unsignedSmallInteger($pivotPermission);
|
||||
$table->unsignedSmallInteger($pivotRole);
|
||||
|
||||
$table->foreign($pivotPermission)
|
||||
->references('id') // permission id
|
||||
|
@ -13,16 +13,35 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->smallIncrements('id');
|
||||
$table->mediumIncrements('id');
|
||||
|
||||
// Clave del setting
|
||||
$table->string('key')->index();
|
||||
$table->string('key')->index(); // Clave del setting
|
||||
|
||||
// Categoría (opcional pero recomendable)
|
||||
$table->string('category')->nullable()->index();
|
||||
$table->string('namespace', 8)->index(); // Namespace del setting
|
||||
$table->string('environment', 7)->default('prod')->index(); // Entorno de aplicación (prod, dev, test, staging), permite sobrescribir valores según ambiente.
|
||||
$table->string('scope', 6)->default('global')->index(); // Define el alcance: global, tenant, branch, user, etc. Útil en arquitecturas multicliente.
|
||||
|
||||
// Usuario (null para globales)
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index();
|
||||
$table->string('component', 16)->index(); // Nombre de Componente o proyecto
|
||||
$table->string('module')->nullable()->index(); // composerName de módulo Autocalculado
|
||||
$table->string('group', 16)->index(); // Grupo de configuraciones
|
||||
$table->string('sub_group', 16)->index(); // Sub grupo de configuraciones
|
||||
$table->string('key_name', 24)->index(); // Nombre de la clave de configuraciones
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index(); // Usuario (null para globales)
|
||||
|
||||
$table->boolean('is_system')->default(false)->index(); // Indica si es un setting de sistema
|
||||
$table->boolean('is_encrypted')->default(false)->index(); // Si el valor está cifrado (para secretos, tokens, passwords).
|
||||
$table->boolean('is_sensitive')->default(false)->index(); // Marca datos sensibles (ej. datos personales, claves API). Puede ocultarse en UI o logs.
|
||||
$table->boolean('is_editable')->default(true)->index(); // Permite o bloquea edición desde la UI (útil para settings de solo lectura).
|
||||
$table->boolean('is_active')->default(true)->index(); // Permite activar/desactivar la aplicación de un setting sin eliminarlo.
|
||||
|
||||
$table->string('encryption_key', 64)->nullable()->index(); // Identificador de la clave usada (ej. 'ssl_cert_2025')
|
||||
$table->string('encryption_algorithm', 16)->nullable(); // Ej. 'AES-256-CBC'
|
||||
$table->timestamp('encryption_rotated_at')->nullable(); // Fecha de última rotación de clave
|
||||
|
||||
$table->string('description')->nullable();
|
||||
$table->string('hint')->nullable();
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->integer('usage_count')->default(0)->index();
|
||||
|
||||
// Valores segmentados por tipo para mejor rendimiento
|
||||
$table->string('value_string')->nullable();
|
||||
@ -35,28 +54,47 @@ return new class extends Migration
|
||||
$table->string('file_name')->nullable();
|
||||
|
||||
// Auditoría
|
||||
$table->timestamps();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable();
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
// Unique constraint para evitar duplicados
|
||||
$table->unique(['key', 'user_id', 'category']);
|
||||
$table->timestamps();
|
||||
$table->softDeletes(); // THIS ONE
|
||||
|
||||
// Índice de Unicidad Principal (para consultas y updates rápidos)
|
||||
$table->unique(
|
||||
['namespace', 'environment', 'scope', 'component', 'group', 'sub_group', 'key_name', 'user_id'],
|
||||
'uniq_settings_full_context'
|
||||
);
|
||||
|
||||
// Búsqueda rápida por componente
|
||||
$table->index(['namespace', 'component'], 'idx_settings_ns_component');
|
||||
|
||||
// Listar grupos de un componente por scope
|
||||
$table->index(['namespace', 'scope', 'component', 'group'], 'idx_settings_ns_scope_component_group');
|
||||
|
||||
// Listar subgrupos por grupo y componente en un scope
|
||||
$table->index(['namespace', 'scope', 'component', 'group', 'sub_group'], 'idx_settings_ns_scope_component_sg');
|
||||
|
||||
// Consultas por entorno y usuario
|
||||
$table->index(['namespace', 'environment', 'user_id'], 'idx_settings_ns_env_user');
|
||||
|
||||
// Consultas por scope y usuario
|
||||
$table->index(['namespace', 'scope', 'user_id'], 'idx_settings_ns_scope_user');
|
||||
|
||||
// Consultas por estado de actividad o sistema
|
||||
$table->index(['namespace', 'is_active'], 'idx_settings_ns_is_active');
|
||||
$table->index(['namespace', 'is_system'], 'idx_settings_ns_is_system');
|
||||
|
||||
// Consultas por estado de cifrado y usuario
|
||||
$table->index(['namespace', 'is_encrypted', 'user_id'], 'idx_settings_encrypted_user');
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
|
||||
$table->foreign('user_id')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('created_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
|
||||
// Agregar columna virtual unificada
|
||||
DB::statement("ALTER TABLE settings ADD COLUMN value VARCHAR(255) GENERATED ALWAYS AS (
|
||||
CASE
|
||||
WHEN value_string IS NOT NULL THEN value_string
|
||||
WHEN value_integer IS NOT NULL THEN CAST(value_integer AS CHAR)
|
||||
WHEN value_boolean IS NOT NULL THEN IF(value_boolean, 'true', 'false')
|
||||
WHEN value_float IS NOT NULL THEN CAST(value_float AS CHAR)
|
||||
WHEN value_text IS NOT NULL THEN LEFT(value_text, 255)
|
||||
WHEN value_binary IS NOT NULL THEN '[binary_data]'
|
||||
ELSE NULL
|
||||
END
|
||||
) VIRTUAL");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::connection('vault')->create('vault_keys', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
// Contexto de clave
|
||||
$table->string('alias', 64)->unique()->index();
|
||||
$table->string('owner_project', 64)->index();
|
||||
$table->string('environment', 10)->default('prod')->index(); // prod, dev, staging
|
||||
$table->string('namespace', 32)->default('core')->index();
|
||||
$table->string('scope', 16)->default('global')->index(); // global, tenant, user
|
||||
|
||||
// Datos de la clave
|
||||
$table->string('algorithm', 32)->default('AES-256-CBC');
|
||||
$table->binary('key_material');
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->boolean('is_sensitive')->default(true);
|
||||
|
||||
// Control de rotación
|
||||
$table->timestamp('rotated_at')->nullable();
|
||||
$table->unsignedInteger('rotation_count')->default(0);
|
||||
|
||||
// Auditoría
|
||||
$table->unsignedBigInteger('created_by')->nullable()->index();
|
||||
$table->unsignedBigInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Índices adicionales
|
||||
$table->index(['owner_project', 'environment', 'namespace', 'scope', 'is_active'], 'idx_full_context');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::connection('vault')->dropIfExists('settings');
|
||||
}
|
||||
|
||||
};
|
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('external_apis', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// Identidad y relación
|
||||
$table->string('slug')->unique(); // api-google-analytics
|
||||
$table->string('name'); // Google Analytics
|
||||
$table->string('module')->index(); // vuexy-website-admin
|
||||
$table->string('provider')->nullable()->index(); // Google, Twitter, Banxico
|
||||
|
||||
// Autenticación y alcance
|
||||
$table->string('auth_type', 16)->nullable()->index(); // api_key, oauth2, jwt, none
|
||||
$table->json('credentials')->nullable(); // api_key, secret, token, etc.
|
||||
$table->json('scopes')->nullable(); // ['read', 'write', 'analytics']
|
||||
|
||||
// Conectividad
|
||||
$table->string('base_url')->nullable(); // https://api.example.com
|
||||
$table->string('doc_url')->nullable(); // https://docs.example.com
|
||||
|
||||
// Estado y entorno
|
||||
$table->string('environment')->default('production')->index(); // dev, staging, prod
|
||||
$table->boolean('is_active')->default(true)->index(); // toggle global
|
||||
|
||||
// Extensión dinámica
|
||||
$table->json('metadata')->nullable(); // libre: headers extra, tags, categorías
|
||||
$table->json('config')->nullable(); // libre: UI params, rate limits, etc.
|
||||
|
||||
// Auditoría
|
||||
$table->timestamps();
|
||||
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('created_by')->references('id')->on('users')->nullOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('external_apis');
|
||||
}
|
||||
};
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('user_logins', function (Blueprint $table) {
|
||||
$table->integerIncrements('id');
|
||||
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index();
|
||||
|
||||
$table->ipAddress('ip_address')->nullable()->index();
|
||||
$table->string('user_agent')->nullable();
|
||||
$table->string('device_type')->nullable();
|
||||
$table->string('browser')->nullable();
|
||||
$table->string('browser_version')->nullable();
|
||||
$table->string('os')->nullable();
|
||||
$table->string('os_version')->nullable();
|
||||
$table->string('country')->nullable()->index();
|
||||
$table->string('region')->nullable();
|
||||
$table->string('city')->nullable();
|
||||
$table->decimal('lat', 10, 8)->nullable();
|
||||
$table->decimal('lng', 11, 8)->nullable();
|
||||
$table->boolean('is_proxy')->default(false)->index();
|
||||
$table->boolean('login_success')->default(true)->index();
|
||||
$table->timestamp('logout_at')->nullable();
|
||||
$table->string('logout_reason')->nullable();
|
||||
$table->json('additional_info')->nullable();
|
||||
|
||||
// Auditoría
|
||||
$table->timestamps();
|
||||
|
||||
// Indices
|
||||
$table->index(['user_id', 'login_success']);
|
||||
$table->index(['user_id', 'logout_at']);
|
||||
$table->index(['user_id', 'logout_at', 'login_success']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Elimina tablas solo si existen
|
||||
Schema::dropIfExists('user_logins');
|
||||
}
|
||||
};
|
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('security_events', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->string('module')->nullable()->index(); // Modulo (opcional pero recomendable)
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index(); // Usuario
|
||||
|
||||
// Información básica del evento
|
||||
$table->string('event_type')->index();
|
||||
$table->string('status')->default('new')->index();
|
||||
|
||||
// Información de acceso
|
||||
$table->ipAddress('ip_address')->nullable()->index();
|
||||
$table->string('user_agent')->nullable();
|
||||
$table->string('device_type', 100)->nullable();
|
||||
$table->string('browser', 100)->nullable();
|
||||
$table->string('browser_version')->nullable();
|
||||
$table->string('os', 100)->nullable();
|
||||
$table->string('os_version', 100)->nullable();
|
||||
|
||||
// Información GeoIP (geoip2)
|
||||
$table->string('country')->nullable()->index();
|
||||
$table->string('region')->nullable();
|
||||
$table->string('city')->nullable();
|
||||
$table->decimal('lat', 10, 8)->nullable();
|
||||
$table->decimal('lng', 11, 8)->nullable();
|
||||
|
||||
// Información adicional del evento
|
||||
$table->boolean('is_proxy')->default(false)->index();
|
||||
$table->string('url')->nullable();
|
||||
$table->string('http_method', 10)->nullable();
|
||||
|
||||
// JSON payload del evento para análisis avanzado
|
||||
$table->json('payload')->nullable();
|
||||
|
||||
// Auditoría
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['event_type', 'status', 'user_id']);
|
||||
$table->index(['user_id', 'event_type']);
|
||||
$table->index(['user_id', 'event_type', 'status']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('set null');
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Elimina tablas solo si existen
|
||||
Schema::dropIfExists('user_logins');
|
||||
}
|
||||
};
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('system_logs', function (Blueprint $table) {
|
||||
$table->integerIncrements('id');
|
||||
|
||||
// Relación polimórfica: puede ser un pedido, una factura, etc.
|
||||
$table->unsignedMediumInteger('loggable_id')->index();
|
||||
$table->string('loggable_type')->index();
|
||||
|
||||
$table->string('module')->nullable()->index(); // Modulo (opcional pero recomendable)
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index(); // Usuario
|
||||
|
||||
$table->string('level', 16)->index(); // info, warning, error
|
||||
$table->text('message');
|
||||
$table->json('context')->nullable(); // datos estructurados
|
||||
|
||||
$table->string('trigger_type', 16)->index(); // user, cronjob, webhook, etc.
|
||||
$table->unsignedMediumInteger('trigger_id')->nullable()->index(); // user_id, job_id, etc.
|
||||
|
||||
// Auditoría
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Índices
|
||||
$table->index(['loggable_id', 'loggable_type']);
|
||||
$table->index(['loggable_type', 'user_id']);
|
||||
$table->index(['loggable_type', 'level']);
|
||||
$table->index(['trigger_type', 'level']);
|
||||
$table->index(['loggable_type', 'user_id', 'level']);
|
||||
$table->index(['trigger_type', 'user_id', 'level']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('restrict');
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Elimina tablas solo si existen
|
||||
Schema::dropIfExists('system_logs');
|
||||
}
|
||||
};
|
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('user_interactions', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->string('module')->nullable()->index(); // Modulo (opcional pero recomendable)
|
||||
$table->unsignedMediumInteger('user_id')->index(); // Usuario
|
||||
|
||||
$table->string('livewire_component')->nullable()->index(); // ejemplo: inventory.products
|
||||
$table->string('action')->index(); // ejemplo: view, update, export
|
||||
$table->string('security_level')->default('normal')->index(); // normal, sensible, crítico
|
||||
|
||||
$table->ipAddress('ip_address')->nullable();
|
||||
$table->string('user_agent')->nullable();
|
||||
$table->json('context')->nullable();
|
||||
|
||||
// 🛡️ Flags de auditoría administrativa
|
||||
$table->json('user_flags')->nullable(); // snapshot de is_admin, is_client, etc.
|
||||
$table->json('user_roles')->nullable(); // ["admin", "manager"]
|
||||
|
||||
$table->mediumText('notes')->nullable(); // comentarios internos de admin
|
||||
$table->json('chat_thread')->nullable(); // [{user_id:1, msg:"...", at:"..."}, ...]
|
||||
|
||||
$table->boolean('is_reviewed')->default(false)->index();
|
||||
$table->boolean('is_flagged')->default(false)->index();
|
||||
$table->boolean('is_escalated')->default(false)->index();
|
||||
$table->unsignedMediumInteger('reviewed_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('flagged_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('escalated_by')->nullable()->index();
|
||||
|
||||
// Auditoria
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['user_id', 'is_reviewed', 'security_level']);
|
||||
$table->index(['user_id', 'is_flagged', 'security_level']);
|
||||
$table->index(['user_id', 'is_escalated', 'security_level']);
|
||||
$table->index(['user_id', 'is_reviewed', 'is_flagged', 'is_escalated', 'security_level'])->name('user_interactions_user_id_is_reviewed_flagged_escalated_sec_lev_index');
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('restrict');
|
||||
$table->foreign('reviewed_by')->references('id')->on('users')->onDelete('restrict');
|
||||
$table->foreign('flagged_by')->references('id')->on('users')->onDelete('restrict');
|
||||
$table->foreign('escalated_by')->references('id')->on('users')->onDelete('restrict');
|
||||
$table->foreign('updated_by')->references('id')->on('users')->onDelete('restrict');
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->onDelete('restrict');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('user_interactions');
|
||||
}
|
||||
};
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('device_tokens', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->unsignedMediumInteger('user_id')->nullable()->index();
|
||||
$table->string('token')->unique(); // Token del dispositivo
|
||||
$table->string('platform', 32)->nullable()->index(); // Plataforma: ios, android, web, desktop, etc.
|
||||
$table->string('client')->nullable(); // Navegador o cliente usado
|
||||
$table->mediumText('device_info')->nullable(); // Información extendida del dispositivo
|
||||
$table->string('location', 128)->nullable(); // Ubicación del dispositivo (opcional)
|
||||
$table->timestamp('last_used_at')->nullable(); // Último uso
|
||||
|
||||
$table->boolean('is_active')->default(true);
|
||||
|
||||
// Auditoria
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['user_id', 'platform']);
|
||||
$table->index(['user_id', 'is_active']);
|
||||
$table->index(['user_id', 'is_active', 'platform']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('created_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('device_tokens');
|
||||
}
|
||||
};
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('system_notifications', function (Blueprint $table) {
|
||||
$table->mediumIncrements('id');
|
||||
|
||||
$table->string('scope', 16)->default('both')->index(); // enum 'admin', 'frontend', 'both'
|
||||
$table->string('type', 16)->default('info')->index(); // enum 'info', 'success', 'warning', 'danger', 'promo'
|
||||
|
||||
$table->string('title')->index();
|
||||
$table->text('message');
|
||||
|
||||
$table->string('channel', 32)->default('toast')->index(); // toast | push | websocket | etc.
|
||||
|
||||
$table->string('style', 16)->default('banner')->index(); // enum 'toast', 'banner', 'modal', 'inline'
|
||||
$table->string('priority', 16)->default('medium')->index(); // Enum 'low', 'medium', 'high', 'critical'
|
||||
|
||||
$table->boolean('requires_confirmation')->default(false)->index();
|
||||
|
||||
$table->string('target_area', 32)->nullable()->comment('Ej: header, sidebar, checkout, etc.')->index();
|
||||
$table->json('tags')->nullable();
|
||||
$table->json('roles')->nullable();
|
||||
$table->json('user_flags')->nullable();
|
||||
|
||||
$table->boolean('is_active')->default(true)->index();
|
||||
$table->timestamp('starts_at')->nullable();
|
||||
$table->timestamp('ends_at')->nullable();
|
||||
|
||||
// Auditoría
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['scope', 'type']);
|
||||
$table->index(['is_active', 'starts_at', 'ends_at']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('created_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('system_notifications');
|
||||
}
|
||||
};
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('system_notification_user', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->unsignedMediumInteger('system_notification_id')->index();
|
||||
$table->unsignedMediumInteger('user_id')->index();
|
||||
|
||||
$table->string('channel', 32)->default('toast')->index(); // toast | push | websocket | etc.
|
||||
|
||||
$table->boolean('is_read')->default(false)->index();
|
||||
$table->timestamp('read_at')->nullable()->index();
|
||||
|
||||
$table->boolean('is_dismissed')->default(false)->index();
|
||||
$table->timestamp('dismissed_at')->nullable()->index();
|
||||
|
||||
$table->boolean('is_confirmed')->default(false)->comment('Confirmación explícita si se requiere')->index();
|
||||
$table->timestamp('confirmed_at')->nullable()->index();
|
||||
$table->text('confirmation_notes')->nullable();
|
||||
|
||||
// Auditoria
|
||||
$table->timestamps();
|
||||
|
||||
// Indices
|
||||
$table->unique(['system_notification_id', 'user_id']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('system_notification_id')->references('id')->on('system_notifications')->cascadeOnDelete();
|
||||
$table->foreign('user_id')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('system_notification_user');
|
||||
}
|
||||
};
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('module')->nullable()->index(); // Modulo (opcional pero recomendable)
|
||||
$table->unsignedMediumInteger('user_id')->index(); // Usuario
|
||||
|
||||
$table->string('channel', 32)->default('toast')->index(); // toast | push | websocket | etc.
|
||||
|
||||
$table->string('type', 16)->default('info')->index(); // Enum: info, success, danger, warning, system
|
||||
$table->string('title')->index();
|
||||
$table->text('body')->nullable();
|
||||
$table->json('data')->nullable();
|
||||
$table->string('action_url')->nullable();
|
||||
|
||||
$table->boolean('is_read')->default(false)->index();
|
||||
$table->timestamp('read_at')->nullable();
|
||||
|
||||
// Auditoria
|
||||
$table->timestamps();
|
||||
$table->boolean('is_dismissed')->default(false)->index();
|
||||
$table->boolean('is_deleted')->default(false)->index();
|
||||
$table->unsignedMediumInteger('emitted_by')->nullable()->index();
|
||||
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['type', 'title']);
|
||||
$table->index(['is_read', 'user_id']);
|
||||
$table->index(['user_id', 'is_read', 'is_deleted']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('user_id')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('emitted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
};
|
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('module_packages', function (Blueprint $table) {
|
||||
$table->smallIncrements('id');
|
||||
|
||||
$table->string('name')->unique();
|
||||
$table->string('display_name');
|
||||
$table->text('description')->nullable();
|
||||
$table->jsonb('keywords')->nullable();
|
||||
|
||||
$table->string('author_name')->nullable();
|
||||
$table->string('author_email')->nullable();
|
||||
|
||||
$table->string('source_url', 500)->nullable();
|
||||
$table->string('composer_url', 500)->nullable();
|
||||
|
||||
$table->string('cover_image', 500)->nullable();
|
||||
$table->string('readme_path', 500)->nullable();
|
||||
|
||||
$table->string('source_type', 16)->default(false); // Enum
|
||||
$table->boolean('zip_available')->default(false);
|
||||
|
||||
$table->json('composer')->nullable(); // dump completo del composer.json
|
||||
|
||||
$table->string('repository_type', 16)->default('public')->index();
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
// Auditoría
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['name', 'display_name']);
|
||||
$table->index(['repository_type', 'active']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('created_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Elimina tablas solo si existen
|
||||
Schema::dropIfExists('module_packages');
|
||||
}
|
||||
};
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('installed_modules', function (Blueprint $table) {
|
||||
$table->smallIncrements('id');
|
||||
|
||||
$table->unsignedSmallInteger('module_package_id')->index(); // Relación con module_packages
|
||||
$table->string('slug')->unique(); // Ej: vuexy-website-admin
|
||||
$table->string('name'); // Ej: koneko/laravel-vuexy-website-admin
|
||||
$table->string('version')->nullable(); // Versión instalada
|
||||
$table->string('install_path')->nullable(); // Path en vendor/ o custom
|
||||
$table->boolean('enabled')->default(true); // Activado para el sistema
|
||||
|
||||
// Control
|
||||
$table->json('install_options')->nullable(); // flags de instalación zip, git, etc.
|
||||
|
||||
// Auditoría y estado
|
||||
$table->timestamp('installed_at')->nullable();
|
||||
$table->timestamp('last_checked_at')->nullable(); // Sincronización con fuente
|
||||
|
||||
// Auditoría
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['module_package_id', 'enabled']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('module_package_id')->references('id')->on('module_packages')->onDelete('cascade');
|
||||
$table->foreign('created_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('installed_modules');
|
||||
}
|
||||
};
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('vuexy_modules', function (Blueprint $table) {
|
||||
$table->string('slug')->primary(); // Ej. koneko-vuexy-contacts
|
||||
$table->string('name'); // Nombre completo del módulo
|
||||
$table->string('vendor')->nullable(); // koneko-st, vendor de composer
|
||||
|
||||
$table->unsignedSmallInteger('installed_module_id')->nullable()->index();
|
||||
$table->string('version')->nullable(); // 1.0.0
|
||||
$table->string('build_version')->nullable(); // 20250429223531
|
||||
$table->string('type')->default('plugin'); // core, plugin, theme, etc.
|
||||
$table->string('provider')->nullable();
|
||||
$table->json('tags')->nullable();
|
||||
$table->json('metadata')->nullable(); // json libre para UI, etc.
|
||||
|
||||
// Auditoria
|
||||
$table->boolean('is_enabled')->default(true)->index(); // Para activar/desactivar
|
||||
$table->boolean('is_installed')->default(false)->index(); // Para trackear instalación
|
||||
|
||||
$table->unsignedMediumInteger('created_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('updated_by')->nullable()->index();
|
||||
$table->unsignedMediumInteger('deleted_by')->nullable()->index();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indices
|
||||
$table->index(['is_enabled', 'is_installed']);
|
||||
|
||||
// Relaciones
|
||||
$table->foreign('installed_module_id')->references('id')->on('installed_modules')->onDelete('set null');
|
||||
$table->foreign('created_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('updated_by')->references('id')->on('users')->restrictOnDelete();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->restrictOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Elimina tablas solo si existen
|
||||
Schema::dropIfExists('vuexy_modules');
|
||||
}
|
||||
};
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Koneko\VuexyAdmin\Services\RBACService;
|
||||
|
||||
class PermissionSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
RBACService::loadRolesAndPermissions();
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Koneko\VuexyAdmin\Models\User;
|
||||
use Koneko\VuexyAdmin\Services\AvatarImageService;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// Define el disco y la carpeta
|
||||
$disk = 'public';
|
||||
$directory = 'profile-photos';
|
||||
|
||||
// Verifica si la carpeta existe
|
||||
if (Storage::disk($disk)->exists($directory))
|
||||
Storage::disk($disk)->deleteDirectory($directory);
|
||||
|
||||
//
|
||||
$avatarImageService = new AvatarImageService();
|
||||
|
||||
// Super admin
|
||||
$user = User::create([
|
||||
'name' => 'Koneko Admin',
|
||||
'email' => 'sadmin@koneko.mx',
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt('LAdmin123'),
|
||||
'status' => User::STATUS_ENABLED,
|
||||
])->assignRole('SuperAdmin');
|
||||
|
||||
// Actualizamos la foto
|
||||
$avatarImageService->updateProfilePhoto($user, new UploadedFile(
|
||||
'public/vendor/vuexy-admin/img/logo/koneko-02.png',
|
||||
'koneko-02.png'
|
||||
));
|
||||
|
||||
|
||||
// admin
|
||||
$user = User::create([
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@koneko.mx',
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt('LAdmin123'),
|
||||
'status' => User::STATUS_ENABLED,
|
||||
])->assignRole('Admin');
|
||||
|
||||
$avatarImageService->updateProfilePhoto($user, new UploadedFile(
|
||||
'public/vendor/vuexy-admin/img/logo/koneko-03.png',
|
||||
'koneko-03.png'
|
||||
));
|
||||
|
||||
// Auditor
|
||||
$user = User::create([
|
||||
'name' => 'Auditor',
|
||||
'email' => 'auditor@koneko.mx',
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt('LAdmin123'),
|
||||
'status' => User::STATUS_ENABLED,
|
||||
])->assignRole('Auditor');
|
||||
|
||||
$avatarImageService->updateProfilePhoto($user, new UploadedFile(
|
||||
'public/vendor/vuexy-admin/img/logo/koneko-03.png',
|
||||
'koneko-03.png'
|
||||
));
|
||||
|
||||
|
||||
// Usuarios CSV
|
||||
$csvFile = fopen(base_path("database/data/users.csv"), "r");
|
||||
|
||||
$firstline = true;
|
||||
|
||||
while (($data = fgetcsv($csvFile, 2000, ",")) !== FALSE) {
|
||||
if (!$firstline) {
|
||||
User::create([
|
||||
'name' => $data['0'],
|
||||
'email' => $data['1'],
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt($data['3']),
|
||||
'status' => User::STATUS_ENABLED,
|
||||
])->assignRole($data['2']);
|
||||
}
|
||||
|
||||
$firstline = false;
|
||||
}
|
||||
|
||||
fclose($csvFile);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user