Files
warehouse-management-BE/configs/constants/permissions.go
Tran Anh Tuan 6a4a96e0ca Base Project
2026-05-08 14:32:24 +07:00

72 lines
2.2 KiB
Go

package constants
// Permission định nghĩa toàn bộ quyền trong hệ thống
// Format: {module}:{action}
// Giá trị string phải KHỚP với seed data trong db/init/init.sql
const (
// ── Warehouse (Kho) ──
PermWarehouseCreate = "warehouse:create"
PermWarehouseRead = "warehouse:read"
PermWarehouseUpdate = "warehouse:update"
PermWarehouseDelete = "warehouse:delete"
// ── Room (Phòng) ──
PermRoomCreate = "room:create"
PermRoomRead = "room:read"
PermRoomUpdate = "room:update"
PermRoomDelete = "room:delete"
// ── Cabinet (Tủ) ──
PermCabinetCreate = "cabinet:create"
PermCabinetRead = "cabinet:read"
PermCabinetUpdate = "cabinet:update"
PermCabinetDelete = "cabinet:delete"
// ── Shelf (Kệ) ──
PermShelfCreate = "shelf:create"
PermShelfRead = "shelf:read"
PermShelfUpdate = "shelf:update"
PermShelfDelete = "shelf:delete"
// ── Container (Vật chứa) ──
PermContainerCreate = "container:create"
PermContainerRead = "container:read"
PermContainerUpdate = "container:update"
PermContainerDelete = "container:delete"
// ── Component Type (Loại linh kiện) ──
PermComponentTypeCreate = "component_type:create"
PermComponentTypeRead = "component_type:read"
PermComponentTypeUpdate = "component_type:update"
PermComponentTypeDelete = "component_type:delete"
// ── Component (Linh kiện) ──
PermComponentCreate = "component:create"
PermComponentRead = "component:read"
PermComponentUpdate = "component:update"
PermComponentDelete = "component:delete"
// ── Invoice (Hóa đơn) ──
PermInvoiceCreate = "invoice:create"
PermInvoiceRead = "invoice:read"
PermInvoiceUpdate = "invoice:update"
PermInvoiceDelete = "invoice:delete"
PermInvoiceApprove = "invoice:approve"
// ── Stock (Kho) ──
PermStockImport = "stock:import"
PermStockExport = "stock:export"
PermStockAdjust = "stock:adjust"
PermStockTransfer = "stock:transfer"
PermStockRead = "stock:read"
// ── User (Người dùng) ──
PermUserCreate = "user:create"
PermUserRead = "user:read"
PermUserUpdate = "user:update"
PermUserDelete = "user:delete"
// ── Role (Vai trò & quyền) ──
PermRoleManage = "role:manage"
)