groups

package
v0.0.0-...-ac0b2cf Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = api.Module{
	Name: "groups",
	Setup: func(r api.Router) error {
		return newGroupModule().setup(r)
	},
}

Functions

This section is empty.

Types

type Database

type Database interface {
	// AssignUserToGroup adds accountID to groupID
	AssignUserToGroup(groupID uint, accountID string) error

	// DeleteUserFromGroup removes accountID from groupID
	DeleteUserFromGroup(groupID uint, accountID string) error

	// CreateGroup creates a new group
	CreateGroup(name, description string) (*iam.Group, error)

	// GetGroupUsers returns all users being part of groupID
	GetGroupUsers(groupID uint) ([]*iam.User, error)

	// ListGroups returns all registered groups
	ListGroups() ([]*iam.Group, error)

	// GetGroupByID returns the group with the given ID
	GetGroup(id uint) (*iam.Group, error)

	// UpdateGroup updates the group with the given ID
	UpdateGroup(id uint, group *iam.Group) (*iam.Group, error)

	// DeleteGroup deletes the group with the given ID
	DeleteGroup(id uint) error
}

Database encapsulates database access for group management

func GetDatabase

func GetDatabase(r api.Router) Database

GetDatabase returns the Database associated with r

Jump to

Keyboard shortcuts

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