user

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: BSD-2-Clause Imports: 6 Imported by: 15

Documentation

Index

Constants

View Source
const ClinicRole string = "clinic"
View Source
const CustodianPermission = "custodian"
View Source
const OwnerPermission = "root"
View Source
const UploadPermission = "upload"
View Source
const ViewPermission = "view"

Variables

This section is empty.

Functions

func ErrorValueStringAsIDNotValid added in v1.27.0

func ErrorValueStringAsIDNotValid(value string) error

func IDValidator added in v1.27.0

func IDValidator(value string, errorReporter structure.ErrorReporter)

func IsValidID added in v1.27.0

func IsValidID(value string) bool

func NewID added in v1.27.0

func NewID() string

func ValidateID added in v1.27.0

func ValidateID(value string) error

Types

type Client added in v1.20.0

type Client interface {
	EnsureAuthorizedService(ctx context.Context) error
	EnsureAuthorizedUser(ctx context.Context, targetUserID string, permission string) (string, error)
	GetUserPermissions(ctx context.Context, requestUserID string, targetUserID string) (Permissions, error)
}

type IDHash

type IDHash struct {
	ID   string `json:"id"`
	Hash string `json:"hash"`
}

type Permission added in v1.20.0

type Permission map[string]interface{}

type Permissions added in v1.20.0

type Permissions map[string]Permission

type User

type User struct {
	ID                string             `json:"userid,omitempty" bson:"userid,omitempty"`
	Email             string             `json:"username,omitempty" bson:"username,omitempty"`
	Emails            []string           `json:"emails,omitempty" bson:"emails,omitempty"`
	Roles             []string           `json:"roles,omitempty" bson:"roles,omitempty"`
	TermsAcceptedTime string             `json:"termsAccepted,omitempty" bson:"termsAccepted,omitempty"`
	EmailVerified     bool               `json:"emailVerified" bson:"authenticated"`
	PasswordHash      string             `json:"-" bson:"pwhash,omitempty"`
	Hash              string             `json:"-" bson:"userhash,omitempty"`
	Private           map[string]*IDHash `json:"-" bson:"private,omitempty"`
	CreatedTime       string             `json:"createdTime,omitempty" bson:"createdTime,omitempty"`
	CreatedUserID     string             `json:"createdUserId,omitempty" bson:"createdUserId,omitempty"`
	ModifiedTime      string             `json:"modifiedTime,omitempty" bson:"modifiedTime,omitempty"`
	ModifiedUserID    string             `json:"modifiedUserId,omitempty" bson:"modifiedUserId,omitempty"`
	DeletedTime       string             `json:"deletedTime,omitempty" bson:"deletedTime,omitempty"`
	DeletedUserID     string             `json:"deletedUserId,omitempty" bson:"deletedUserId,omitempty"`

	ProfileID *string `json:"-" bson:"-"`
}

func (*User) HasRole added in v1.3.0

func (u *User) HasRole(role string) bool

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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