security

package
v0.0.0-...-a757527 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NamespaceManager

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

NamespaceManager is an abstraction that writes and retrieves data from a SQL database, it expects to have "memberships" to read/write from and "roles" to read from

func NewNamespaceManager

func NewNamespaceManager(db *sqlx.DB) *NamespaceManager

NewNamespaceManager creates a new manager from the given database and driver

func (*NamespaceManager) AddUserToNamespace

func (m *NamespaceManager) AddUserToNamespace(ctx context.Context, role security.Role, id, user uuid.UUID) error

AddUserToNamespace sets the role of a user in the given namespace

func (*NamespaceManager) RemoveUserFromNamespace

func (m *NamespaceManager) RemoveUserFromNamespace(ctx context.Context, id, user uuid.UUID) error

RemoveUserFromNamespace removes the role of a user in the given namespace

func (*NamespaceManager) RolesFor

func (m *NamespaceManager) RolesFor(ctx context.Context, globalNamespace, namespace, user uuid.UUID) ([]security.NamespaceRole, error)

RolesFor is used in gathering all of the roles for both the global and given namespace for a given user

Jump to

Keyboard shortcuts

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