organization

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service for interfacing with postgresql/rds

func New

func New(roleManager auth.RoleManager, authorizer auth.Authorizer) *Service

New returns an Organization Service with a role manager and authorizer

func (*Service) Create

func (s *Service) Create(ctx context.Context, userContext am.UserContext, org *am.Organization, userCID string) (oid int, uid int, ocid string, ucid string, err error)

Create a new organization, and intialize the user + roles, system users only.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, userContext am.UserContext, orgID int) (oid int, err error)

Delete the organization

func (*Service) Get

func (s *Service) Get(ctx context.Context, userContext am.UserContext, orgName string) (oid int, org *am.Organization, err error)

Get organization by organization name, system user only.

func (*Service) GetByAppClientID

func (s *Service) GetByAppClientID(ctx context.Context, userContext am.UserContext, orgAppClientID string) (oid int, org *am.Organization, err error)

GetByOrgAppClientID organization by ID, system user only.

func (*Service) GetByCID

func (s *Service) GetByCID(ctx context.Context, userContext am.UserContext, orgCID string) (oid int, org *am.Organization, err error)

GetByCID organization by organization customer id

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, userContext am.UserContext, orgID int) (oid int, org *am.Organization, err error)

GetByID organization by ID, system user only.

func (*Service) Init

func (s *Service) Init(config []byte) error

Init by parsing the config and initializing the database pool

func (*Service) IsAuthorized

func (s *Service) IsAuthorized(ctx context.Context, userContext am.UserContext, resource, action string) bool

IsAuthorized checks if an action is allowed by a particular user

func (*Service) List

func (s *Service) List(ctx context.Context, userContext am.UserContext, filter *am.OrgFilter) (orgs []*am.Organization, err error)

List all organizations that match the supplied filter, system users only.

func (*Service) Update

func (s *Service) Update(ctx context.Context, userContext am.UserContext, org *am.Organization) (oid int, err error)

Update allows the customer to update the details of their organization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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