Versions in this module Expand all Collapse all v0 v0.1.2 Jun 14, 2026 Changes in this version + var ErrNotAdminActor = apperror.Authorization("This operation requires an admin actor.") + var ErrNotServiceActor = apperror.Authorization("This operation requires a service actor.") + var Module = fx.Options(fx.Provide(fx.Annotate(NewTokenAuthorizer, fx.As(new(Authorizer))))) + func ContextWithActor(ctx context.Context, a *Actor) context.Context + func ContextWithUser[U any](ctx context.Context, u *U) context.Context + func UserFromContext[U any](ctx context.Context) *U + type Actor struct + ClientID string + ID uuid.UUID + IsAdmin bool + Locale string + Permissions []string + Scopes []string + Type ActorType + func ActorFromContext(ctx context.Context) *Actor + type ActorType string + const ActorTypeService + const ActorTypeUser + type Authorizer interface + Authorize func(actor *Actor, permissions ...string) error + type TokenAuthorizer struct + func NewTokenAuthorizer() *TokenAuthorizer + func (a *TokenAuthorizer) Authorize(actor *Actor, permissions ...string) error