package models

import "github.com/uptrace/bun"

type PermissionConditions struct {
	Groups *[]Group `json:"groups,omitempty"`
}

type Permission struct {
	bun.BaseModel `bun:"table:permissions"`
	Resource      string               `bun:"resource,pk" json:"resource"`
	Action        string               `bun:"action,pk" json:"action"`
	Conditions    PermissionConditions `bun:"conditions,type:jsonb" json:"conditions"`
}
