Files
isp-admin-service/entity/role.go
T
2023-10-18 13:24:48 +03:00

32 lines
539 B
Go

package entity
import (
"database/sql/driver"
"time"
"github.com/integration-system/isp-kit/json"
)
type Role struct {
Id int
Name string
ExternalGroup string
Permissions PermList
Immutable bool
Exclusive bool
CreatedAt time.Time
UpdatedAt time.Time
}
type PermList []string
// nolint
func (p *PermList) Scan(src any) error {
return json.Unmarshal(src.([]byte), p)
}
func (p PermList) Value() (driver.Value, error) {
bytes, err := json.Marshal(p)
return driver.Value(bytes), err
}