18 lines
644 B
Go
18 lines
644 B
Go
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"`
|
|
}
|