user

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: AGPL-3.0 Imports: 28 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachUserAccounts

func AttachUserAccounts(ctx domain.RequestContext, s store.Store, orgID string, u *user.User)

AttachUserAccounts attachs user accounts to user object.

func GetSecuredUser

func GetSecuredUser(ctx domain.RequestContext, s store.Store, orgID, id string) (u user.User, err error)

GetSecuredUser contain associated accounts but credentials are wiped.

Types

type Handler

type Handler struct {
	Runtime *env.Runtime
	Store   *store.Store
}

Handler contains the runtime information such as logging and database.

func (*Handler) Add

func (h *Handler) Add(w http.ResponseWriter, r *http.Request)

Add is the endpoint that enables an administrator to add a new user for their organization.

func (*Handler) BulkImport added in v1.58.0

func (h *Handler) BulkImport(w http.ResponseWriter, r *http.Request)

BulkImport imports comma-delimited list of users: firstname, lastname, email

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(w http.ResponseWriter, r *http.Request)

ChangePassword accepts password change from within the app.

func (*Handler) Delete

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

Delete is the endpoint to delete a user specified by userID, the caller must be an Administrator.

func (*Handler) ForgotPassword

func (h *Handler) ForgotPassword(w http.ResponseWriter, r *http.Request)

ForgotPassword initiates the change password procedure. Generates a reset token and sends email to the user. User has to click link in email and then provide a new password.

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

Get returns user specified by ID

func (*Handler) GetOrganizationUsers

func (h *Handler) GetOrganizationUsers(w http.ResponseWriter, r *http.Request)

GetOrganizationUsers is the endpoint that allows administrators to view the users in their organization.

func (*Handler) GetSpaceUsers

func (h *Handler) GetSpaceUsers(w http.ResponseWriter, r *http.Request)

GetSpaceUsers returns every user within a given space

func (*Handler) MatchUsers added in v1.58.0

func (h *Handler) MatchUsers(w http.ResponseWriter, r *http.Request)

MatchUsers returns users where provided text matches firstname, lastname, email

func (*Handler) ResetPassword

func (h *Handler) ResetPassword(w http.ResponseWriter, r *http.Request)

ResetPassword stores the newly chosen password for the user.

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

Update is the endpoint to update user information for the given userID. Note that unless they have admin privildges, a user can only update their own information. Also, only admins can update user roles in organisations.

type Store added in v1.71.0

type Store struct {
	store.Context
	store.UserStorer
}

Store provides data access to space information.

func (Store) Add added in v1.71.0

func (s Store) Add(ctx domain.RequestContext, u user.User) (err error)

Add adds the given user record to the user table.

func (Store) CountActiveUsers added in v1.71.0

func (s Store) CountActiveUsers() (c []domain.SubscriptionUserAccount)

CountActiveUsers returns the number of active users in the system.

func (Store) DeactiveUser added in v1.71.0

func (s Store) DeactiveUser(ctx domain.RequestContext, userID string) (err error)

DeactiveUser deletes the account record for the given userID and persister.Context.OrgID.

func (Store) ForgotUserPassword added in v1.71.0

func (s Store) ForgotUserPassword(ctx domain.RequestContext, email, token string) (err error)

ForgotUserPassword sets the password to ” and the reset field to token, for a user identified by email.

func (Store) Get added in v1.71.0

func (s Store) Get(ctx domain.RequestContext, id string) (u user.User, err error)

Get returns the user record for the given id.

func (Store) GetActiveUsersForOrganization added in v1.71.0

func (s Store) GetActiveUsersForOrganization(ctx domain.RequestContext) (u []user.User, err error)

GetActiveUsersForOrganization returns a slice containing of active user records for the organization identified in the Persister.

func (Store) GetByDomain added in v1.71.0

func (s Store) GetByDomain(ctx domain.RequestContext, domain, email string) (u user.User, err error)

GetByDomain matches user by email and domain.

func (Store) GetByEmail added in v1.71.0

func (s Store) GetByEmail(ctx domain.RequestContext, email string) (u user.User, err error)

GetByEmail returns a single row match on email.

func (Store) GetBySerial added in v1.71.0

func (s Store) GetBySerial(ctx domain.RequestContext, serial string) (u user.User, err error)

GetBySerial is used to retrieve a user via their temporary password salt value! This occurs when we you share a folder with a new user and they have to complete the onboarding process.

func (Store) GetByToken added in v1.71.0

func (s Store) GetByToken(ctx domain.RequestContext, token string) (u user.User, err error)

GetByToken returns a user record given a reset token value.

func (Store) GetSpaceUsers added in v1.71.0

func (s Store) GetSpaceUsers(ctx domain.RequestContext, spaceID string) (u []user.User, err error)

GetSpaceUsers returns a slice containing all user records for given space.

func (Store) GetUsersForOrganization added in v1.71.0

func (s Store) GetUsersForOrganization(ctx domain.RequestContext, filter string, limit int) (u []user.User, err error)

GetUsersForOrganization returns a slice containing all of the user records for the organizaiton identified in the context.

func (Store) GetUsersForSpaces added in v1.71.0

func (s Store) GetUsersForSpaces(ctx domain.RequestContext, spaces []string) (u []user.User, err error)

GetUsersForSpaces returns users with access to specified spaces.

func (Store) MatchUsers added in v1.71.0

func (s Store) MatchUsers(ctx domain.RequestContext, text string, maxMatches int) (u []user.User, err error)

MatchUsers returns users that have match to either firstname, lastname or email.

func (Store) UpdateUser added in v1.71.0

func (s Store) UpdateUser(ctx domain.RequestContext, u user.User) (err error)

UpdateUser updates the user table using the given replacement user record.

func (Store) UpdateUserPassword added in v1.71.0

func (s Store) UpdateUserPassword(ctx domain.RequestContext, userID, salt, password string) (err error)

UpdateUserPassword updates a user record with new password and salt values.

Jump to

Keyboard shortcuts

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