models

package
v0.0.0-...-d5841c9 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InviteCode

type InviteCode struct {
	Code   string              `json:"code" bson:"code,omitempty"`
	Expiry primitive.Timestamp `json:"expiry" bson:"expiry,omitempty"`
}

type RefreshToken

type RefreshToken struct {
	// ID is unique per refresh token and used to identify the token claims
	ID        primitive.ObjectID  `json:"id" bson:"_id"`
	UserID    string              `json:"userID" bson:"userID"`
	CreatedAt primitive.Timestamp `json:"createdAt" bson:"createdAt"`
	ExpiresAt primitive.Timestamp `json:"expiresAt,omitempty" bson:"expiresAt,omitempty"`
	// when the refresh token is invalidated, it gets an invalidated at date
	InvalidatedAt primitive.Timestamp `json:"invalidatedAt,omitempty" bson:"invalidatedAt,omitempty"`
}

type StaffMember

type StaffMember struct {
	ID             primitive.ObjectID  `json:"id" bson:"_id,omitempty"`
	Name           string              `json:"name" bson:"name,omitempty"`
	Email          string              `json:"email" bson:"email,omitempty"`
	EmailVerified  bool                `json:"emailVerified" bson:"emailVerified,omitempty"`
	Role           StaffRole           `json:"role" bson:"role,omitempty"`
	HashedPassword string              `json:"password" bson:"password,omitempty"`
	InviteCode     InviteCode          `json:"inviteCode" bson:"inviteCode,omitempty"`
	CreatedAt      primitive.Timestamp `json:"createdAt" bson:"createdAt,omitempty"`
	UpdatedAt      primitive.Timestamp `json:"updatedAt" bson:"updatedAt,omitempty"`
	DeletedAt      primitive.Timestamp `json:"deletedAt" bson:"deletedAt,omitempty"`
}

StaffMember struct StaffMember/Admin members within the CMS

type StaffRole

type StaffRole string
const (
	// The owner of the site, usually the person who created the site
	StaffRoleOwner StaffRole = "OWNER"
	// Trusted staff user who should be able to manage all content and users, as well
	// as site settings and options.
	StaffRoleAdministrator StaffRole = "ADMINISTRATOR"
	// Can invite and manage other Authors and Contributors, as well as edit and
	// publish any posts on the site.
	StaffRoleEditor StaffRole = "EDITOR"
	// A trusted user who can create, edit and publish their own posts, but can’t
	// modify others.
	StaffRoleAuthor StaffRole = "AUTHOR"
)

func StaffRoleFromString

func StaffRoleFromString(role string) StaffRole

func (StaffRole) IsValid

func (e StaffRole) IsValid() bool

func (StaffRole) String

func (s StaffRole) String() string

Jump to

Keyboard shortcuts

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