viewer

package
v1.1.65 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPowerfulContext

func AllPowerfulContext(parent context.Context) context.Context

func LoggedOutContext

func LoggedOutContext(parent context.Context) context.Context

func NewContext

func NewContext(parent context.Context, v *Context) context.Context

func OmniContext

func OmniContext(parent context.Context) context.Context

Types

type Context

type Context struct {
	Role              ViewerRole
	ID                pulid.ID
	OrgID             pulid.ID
	AccountID         string
	OrgAccountID      string
	OrgMembershipRole membershiprole.MembershipRole
	SubscriptionPlan  string
}

func AllPowerfulVC

func AllPowerfulVC() *Context

func FromContext

func FromContext(ctx context.Context) *Context

func LoggedOutVC

func LoggedOutVC() *Context

func OmniVC

func OmniVC() *Context

func (*Context) GetBaseContext

func (c *Context) GetBaseContext() *Context

func (*Context) HasIdentity

func (v *Context) HasIdentity() bool

func (*Context) HasOrg

func (v *Context) HasOrg() bool

func (*Context) HasPersonalOrg

func (v *Context) HasPersonalOrg() bool

func (*Context) HasPlan added in v1.1.41

func (v *Context) HasPlan(plan string) bool

func (*Context) IsAgent

func (v *Context) IsAgent() bool

func (*Context) IsAllPowerful

func (v *Context) IsAllPowerful() bool

func (*Context) IsAnonymous

func (v *Context) IsAnonymous() bool

func (*Context) IsEmployee

func (v *Context) IsEmployee() bool

func (*Context) IsLoggedOut

func (v *Context) IsLoggedOut() bool

func (*Context) IsOmni

func (v *Context) IsOmni() bool

func (*Context) IsOrgAdmin

func (v *Context) IsOrgAdmin() bool

func (*Context) IsTest

func (v *Context) IsTest() bool

type CtxKey

type CtxKey struct{}

type Viewer

type Viewer interface {
	GetBaseContext() *Context
}

type ViewerRole

type ViewerRole string
const (
	LoggedOut   ViewerRole = "LoggedOut"
	User        ViewerRole = "User"
	Agent       ViewerRole = "Agent"
	AllPowerful ViewerRole = "AllPowerful"
	Omni        ViewerRole = "Omni"
	Test        ViewerRole = "Test"
	Employee    ViewerRole = "Employee"
)

Jump to

Keyboard shortcuts

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