Files
libredesk/internal/role/models/models.go
T
Abhinav Raut 50188352a5 fix: Use SyncedEnforcer in casbin, fixes panics.
feat: store user roles in user roles table, drops the roles table on users table.
feat: standardize column names in schema, renames disabled bool to enables.
- vue router fixes to allow components / pages to rerender after creating an object in db.
- minor fixes and refactors.
2025-01-22 03:40:32 +05:30

27 lines
548 B
Go

package models
import (
"time"
"github.com/lib/pq"
)
const (
RoleAdmin = "Admin"
RoleAgent = "Agent"
)
var DefaultRoles = []string{
RoleAdmin,
RoleAgent,
}
type Role struct {
ID int `db:"id" json:"id"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
Name string `db:"name" json:"name"`
Description string `db:"description" json:"description"`
Permissions pq.StringArray `db:"permissions" json:"permissions"`
}