user

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 2 Imported by: 11 modules, 14 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

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