community: github.com/documize/community/model/user Index | Files

package user

import "github.com/documize/community/model/user"

Index

Package Files

user.go

Constants

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"
)

func Exists Uses

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

Exists ehecks if user is in array.

type User Uses

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 Uses

func (user *User) Fullname() string

Fullname returns Firstname + Lastname.

func (*User) GetAccount Uses

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

GetAccount returns matching org account using orgID

func (*User) ProtectSecrets Uses

func (user *User) ProtectSecrets()

ProtectSecrets blanks sensitive data.

Package user imports 4 packages (graph) and is imported by 11 packages. Updated 2019-02-28. Refresh now. Tools for package owners.