newerpol

package
v0.0.0-...-7b3a301 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessGrantPending  = 1
	AccessGranted       = 2
	AccessRevokePending = 3
	AccessRevoked       = 4
)

These are the statuses from dbo.WebserverAccessStatii

Variables

This section is empty.

Functions

func Connect

func Connect() (*sqlx.DB, error)

Connect to the Newerpol database using the Newerpol connection settings from configuration

func GetGrantsToAdd

func GetGrantsToAdd(db *sqlx.DB, opts *GetGrantsOptions) (map[int][]AccessRecord, error)

Get grants to add

func GetGrantsToRevoke

func GetGrantsToRevoke(db *sqlx.DB, opts *GetGrantsOptions) (map[int][]AccessRecord, error)

Get grants to remove

func GetManagedSiteIds

func GetManagedSiteIds(db *sqlx.DB) ([]int, error)

Get IDs of all sites managed in eActivities

Types

type AccessRecord

type AccessRecord struct {
	AccessId      int
	WebsiteId     int
	RequestStatus int
	FirstName     string
	LookupName    string
	Login         string
	Email         string
	CSP           string
}

func (*AccessRecord) FinishGrant

func (a *AccessRecord) FinishGrant(db *sqlx.DB) (bool, error)

Move a grant from a pending state to a done state. Returns whether the grant updated and any error

func (*AccessRecord) IsPending

func (a *AccessRecord) IsPending() bool

type GetGrantsOptions

type GetGrantsOptions struct {
	IncludeNonPending bool
}

Jump to

Keyboard shortcuts

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