user

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: AGPL-3.0 Imports: 4 Imported by: 5 modules, 32 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// EveryoneUserID provides a shortcut to state "all authenticated users".
	EveryoneUserID string = "0"

	// EveryoneUserName provides the descriptor for this type of user/group.
	EveryoneUserName string = "Everyone"
)

Variables

This section is empty.

Functions

func Exists added in v1.56.0

func Exists(users []User, userID string) bool

Exists ehecks if user is in array.

Types

type User

type User struct {
	model.BaseEntity
	Firstname   string            `json:"firstname"`
	Lastname    string            `json:"lastname"`
	Email       string            `json:"email"`
	Initials    string            `json:"initials"`
	Active      bool              `json:"active"`
	Editor      bool              `json:"editor"`
	Admin       bool              `json:"admin"`
	ViewUsers   bool              `json:"viewUsers"`
	Analytics   bool              `json:"analytics"`
	GlobalAdmin bool              `json:"global"`
	Password    string            `json:"-"`
	Salt        string            `json:"-"`
	Reset       string            `json:"-"`
	LastVersion string            `json:"lastVersion"`
	Theme       string            `json:"theme"`
	Accounts    []account.Account `json:"accounts"`
	Groups      []group.Record    `json:"groups"`
}

User defines a login.

func (*User) Fullname

func (user *User) Fullname() string

Fullname returns Firstname + Lastname.

func (*User) GetAccount

func (user *User) GetAccount(orgID string) (a account.Account, found bool)

GetAccount returns matching org account using orgID

func (*User) ProtectSecrets

func (user *User) ProtectSecrets()

ProtectSecrets blanks sensitive data.

Jump to

Keyboard shortcuts

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