Documentation
¶
Overview ¶
Package viewer contains role definitions for policies
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Role ¶ added in v0.1.1
type Role int
Role for viewer actions.
const ( Admin Role View )
List of roles.
type UserViewer ¶
type UserViewer struct {
UserID string
T *generated.Organization
Role Role // Attached roles.
}
UserViewer describes a user-viewer.
func (UserViewer) GetUser ¶ added in v0.1.1
func (u UserViewer) GetUser() UserViewer
GetUser returns the user information.
func (UserViewer) GetUserID ¶ added in v0.1.1
func (u UserViewer) GetUserID() string
GetUserID returns the ID of the user.
type Viewer ¶
type Viewer interface {
GetUser() UserViewer
GetUserID() string
Admin() bool // If viewer is admin.
}
Viewer describes the query/mutation viewer-context.
func FromContext ¶
FromContext returns the Viewer stored in a context.
Click to show internal directories.
Click to hide internal directories.