authadapter

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormOrganizationStore

type GormOrganizationStore struct {
	// contains filtered or unexported fields
}

GormOrganizationStore implements organization membership persistence using Gorm.

func NewGormOrganizationStore

func NewGormOrganizationStore(db *gorm.DB) GormOrganizationStore

NewGormOrganizationStore returns a new GormOrganizationStore.

func (GormOrganizationStore) ApplyUserMembership

func (g GormOrganizationStore) ApplyUserMembership(ctx context.Context, organizationID uint, userID uint, role string) error

ApplyUserMembership ensures that a user is a member of an organization with the necessary role.

func (GormOrganizationStore) EnsureOrganizationExists

func (g GormOrganizationStore) EnsureOrganizationExists(ctx context.Context, name string, provider string) (bool, uint, error)

EnsureOrganizationExists ensures that an organization exists.

func (GormOrganizationStore) FindUserRole

func (g GormOrganizationStore) FindUserRole(ctx context.Context, orgID uint, userID uint) (string, bool, error)

FindUserRole returns the user's role in a given organization. Returns false as the second parameter if the user is not a member of the organization.

func (GormOrganizationStore) GetOrganizationMembershipsOf

func (g GormOrganizationStore) GetOrganizationMembershipsOf(ctx context.Context, userID uint) ([]auth.UserOrganization, error)

GetOrganizationMembershipsOf returns the list of organization memberships for a user.

func (GormOrganizationStore) RemoveUserFromOrganization

func (g GormOrganizationStore) RemoveUserFromOrganization(ctx context.Context, organizationID uint, userID uint) error

RemoveUserFromOrganization removes a user from an organization.

Jump to

Keyboard shortcuts

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