Versions in this module Expand all Collapse all v0 v0.1.1 Jun 25, 2026 v0.1.0 Jun 25, 2026 Changes in this version + var ErrForbidden = fmt.Errorf("authz: forbidden") + func Allows(ctx context.Context, subject any, action string, resource any) bool + func Authorize(ctx context.Context, subject any, action string, resource any) error + func Before(fn BeforeFunc) + func Can(ctx context.Context, subject any, action string, resource any) (bool, error) + func Denies(ctx context.Context, subject any, action string, resource any) bool + func Policy(resourceType string, actions map[string]PolicyFunc) + func RegisterGate(name string, fn GateFunc) + func Registry() map[string]any + func Require(action string) func(http.Handler) http.Handler + func Reset() + func SubjectFrom(ctx context.Context) any + func TypeName(resource any) string + func WithSubject(ctx context.Context, subject any) context.Context + type BeforeFunc func(ctx context.Context, subject any, action string) (decided, allow bool) + type GateFunc func(ctx context.Context, subject any) (bool, error) + type PolicyFunc func(ctx context.Context, subject, resource any) (bool, error) + type Service struct + func FromKernel(k *togo.Kernel) (*Service, bool) + func (s *Service) Allows(ctx context.Context, subject any, action string, resource any) bool + func (s *Service) Authorize(ctx context.Context, subject any, action string, resource any) error + func (s *Service) Can(ctx context.Context, subject any, action string, resource any) (bool, error)