Closed emoss08 closed 3 months ago
This pull request introduces role-based access control (RBAC) using Casbin. The changes include significant refactoring and enhancements across multiple files to integrate Casbin for permission management, update data models, and improve the shipment management UI.
Files | Changes |
---|---|
web/frontend/src/components/shipment-management/shipment-list.tsx web/frontend/src/components/shipment-management/shipment-list-view.tsx |
Refactored shipment management components to support drag-and-drop functionality and improved UI with new components and pagination. |
pkg/models/location.go pkg/models/equipment_type.go pkg/models/tractor.go pkg/models/accessorial_charge.go pkg/models/worker.go pkg/models/division_code.go pkg/models/user.go pkg/models/organization.go pkg/models/fleet_code.go pkg/models/document_classification.go |
Added optimistic locking support with versioning and updated validation rules across multiple data models. |
internal/api/handlers/tractor.handler.go internal/api/handlers/equipmenttype.handler.go internal/api/handlers/organization.handler.go |
Refactored API handlers to use Casbin for permission checks and simplified method signatures. |
internal/api/services/permission.service.go fixtures/seeder.go fixtures/load_roles.go fixtures/load_adminaccount.go |
Integrated Casbin for role-based access control, refactored permission service, and updated fixture loading to include role and permission setup with Casbin. |
Summary by Sourcery
This pull request introduces role-based access control using Casbin, adds drag-and-drop functionality for assigning tractors to shipments, and implements optimistic locking for various models. It also includes several refactorings and enhancements to improve code readability, maintainability, and data consistency.
Shipment
model to include additional fields and improve data consistency.TractorHandler
andEquipmentTypeHandler
to use Casbin for permission checks.Location
model with additional validation and optimistic locking.PermissionService
to use Casbin for permission checks and role assignments.