domainpolicy

package
v0.99.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package domainpolicy resolves and applies per-content-kind domain rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HiddenSQL

func HiddenSQL(hidden map[string][]string, alias, prefix string) (string, pgx.NamedArgs)

HiddenSQL applies optional preferences to the same kind that owns them.

Types

type Policies

type Policies map[string]Policy

func Resolve

func Resolve(ctx context.Context, q Querier, table, tenant string, d kinds.Domain) (Policies, error)

Resolve includes internal entities for policy evaluation, but never puts them in Toggles. Missing fixed exclusions fail only their content kind closed.

func (Policies) Allows

func (p Policies) Allows(kind string, entities []string) bool

func (Policies) SQL

func (p Policies) SQL(alias, prefix string) (string, pgx.NamedArgs)

SQL is the hard boundary over a content facet alias. Unconfigured kinds pass.

type Policy

type Policy struct {
	Required        []string
	Blocked         []string
	Toggles         map[string]bool // entity ID to default visibility
	ToggleRefs      map[kinds.GroupRef]string
	MissingRequired bool
	MissingHard     bool
}

type Querier

type Querier interface {
	Query(context.Context, string, ...any) (pgx.Rows, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL