feat: roles system backend

This commit is contained in:
Florian Sylvain committed 2026-10-26 05:02:49 +01:00
1 parent 44cca46d5e
commit 8c6c6456da
50 files changed
+2578 -22

No files matched your search

@@ -0,0 +1,17 @@
package models
type Role struct {
ID uint32 `gorm:"primaryKey;autoIncrement"`
Name string `gorm:"not null;size:100;index"`
Description string `gorm:"not null;default:'';size:255"`
BuiltIn bool `gorm:"not null;default:false"`
Locked bool `gorm:"not null;default:false"`
Version uint32 `gorm:"not null;default:1"`
}
type RolePermission struct {
ID uint32 `gorm:"primaryKey;autoIncrement"`
RoleID uint32 `gorm:"not null;uniqueIndex:idx_role_permission_key"`
Key string `gorm:"column:permission_key;not null;size:100;uniqueIndex:idx_role_permission_key"`
Scope string `gorm:"not null;size:8"`
}