Base Project
This commit is contained in:
71
configs/constants/permissions.go
Normal file
71
configs/constants/permissions.go
Normal file
@@ -0,0 +1,71 @@
|
||||
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"
|
||||
)
|
||||
Reference in New Issue
Block a user