Versions in this module Expand all Collapse all v1 v1.1.0 Apr 30, 2026 v1.0.0 Apr 29, 2026 Changes in this version + func Can(user Identity, resource any, action string) error + type CompiledPolicy struct + DynamicRules []DynamicRule + StaticRules map[string]map[string]bool + func (p *CompiledPolicy) Evaluate(user Identity, resourceVal reflect.Value, action string) error + type DynamicRule struct + Actions []string + FieldIndex int + FieldKind reflect.Kind + FieldType reflect.Type + type Guard struct + func NewGuard() *Guard + func (g *Guard) Can(user Identity, resource any, action string) error + func (g *Guard) GetRoles(user Identity, resource any) ([]string, error) + type Identity interface + GetID func() string + GetRoles func() []string