23 lines
638 B
Go
23 lines
638 B
Go
package urbac
|
|
|
|
import "github.com/loveuer/urbac/internal/sqlType"
|
|
|
|
type Role struct {
|
|
Id uint64 `json:"id" gorm:"primaryKey;column:id"`
|
|
CreatedAt int64 `json:"created_at" gorm:"column:created_at;autoCreateTime:milli"`
|
|
UpdatedAt int64 `json:"updated_at" gorm:"column:updated_at;autoUpdateTime:milli"`
|
|
DeletedAt int64 `json:"deleted_at" gorm:"index;column:deleted_at;default:0"`
|
|
Name string
|
|
Label string
|
|
ParentId uint64
|
|
Privileges sqlType.NumSlice[uint64]
|
|
}
|
|
|
|
func (r *Role) Grant(privileges ...*Privilege) error {
|
|
panic("todo")
|
|
}
|
|
|
|
func (r *Role) Revoke(privileges ...*Privilege) error {
|
|
panic("todo")
|
|
}
|