mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-22 02:23:32 +00:00
50188352a5
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.
27 lines
548 B
Go
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"`
|
|
}
|