Documentation ¶
Index ¶
- type GormOrganizationStore
- func (g GormOrganizationStore) ApplyUserMembership(ctx context.Context, organizationID uint, userID uint, role string) error
- func (g GormOrganizationStore) EnsureOrganizationExists(ctx context.Context, name string, provider string) (bool, uint, error)
- func (g GormOrganizationStore) FindUserRole(ctx context.Context, orgID uint, userID uint) (string, bool, error)
- func (g GormOrganizationStore) GetOrganizationMembershipsOf(ctx context.Context, userID uint) ([]auth.UserOrganization, error)
- func (g GormOrganizationStore) RemoveUserFromOrganization(ctx context.Context, organizationID uint, userID uint) error
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.
Click to show internal directories.
Click to hide internal directories.