user

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasUploaderRole added in v0.0.23

func HasUploaderRole(user *userpb.User) bool

HasUploaderRole returns true if the user has uploader role.

Types

type BlockedUsers added in v0.0.21

type BlockedUsers map[string]struct{}

BlockedUsers is a set containing all the blocked users.

func NewBlockedUsersSet added in v0.0.21

func NewBlockedUsersSet(users []string) BlockedUsers

NewBlockedUsersSet creates a new set of blocked users from a list.

func (BlockedUsers) IsBlocked added in v0.0.21

func (b BlockedUsers) IsBlocked(user string) bool

IsBlocked returns true if the user is blocked.

type Manager

type Manager interface {
	// GetUser returns the user metadata identified by a uid.
	// The groups of the user are omitted if specified, as these might not be required for certain operations
	// and might involve computational overhead.
	GetUser(ctx context.Context, uid *userpb.UserId, skipFetchingGroups bool) (*userpb.User, error)
	// GetUserByClaim returns the user identified by a specific value for a given claim.
	GetUserByClaim(ctx context.Context, claim, value string, skipFetchingGroups bool) (*userpb.User, error)
	// GetUserGroups returns the groups a user identified by a uid belongs to.
	GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]string, error)
	// FindUsers returns all the user objects which match a query parameter.
	FindUsers(ctx context.Context, query string, skipFetchingGroups bool) ([]*userpb.User, error)
}

Manager is the interface to implement to manipulate users.

Directories

Path Synopsis
manager

Jump to

Keyboard shortcuts

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