Versions in this module Expand all Collapse all v0 v0.11.4 Jan 7, 2023 Changes in this version + func NewContext(parent context.Context, v Viewer) context.Context + type AppViewer struct + Role Role + func (v AppViewer) Admin() bool + func (v AppViewer) Can(r Role) bool + func (v AppViewer) Teams(context.Context) ([]string, error) + type Role int + const Admin + const Edit + const View + type UserViewer struct + Role Role + User *ent.User + func (v UserViewer) Admin() bool + func (v UserViewer) Can(r Role) bool + func (v UserViewer) Teams(ctx context.Context) ([]string, error) + type Viewer interface + Admin func() bool + Can func(Role) bool + Teams func(context.Context) ([]string, error) + func FromContext(ctx context.Context) Viewer