Documentation ¶
Index ¶
- Constants
- func Connect() (*sqlx.DB, error)
- func GetGrantsToAdd(db *sqlx.DB, opts *GetGrantsOptions) (map[int][]AccessRecord, error)
- func GetGrantsToRevoke(db *sqlx.DB, opts *GetGrantsOptions) (map[int][]AccessRecord, error)
- func GetManagedSiteIds(db *sqlx.DB) ([]int, error)
- type AccessRecord
- type GetGrantsOptions
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 ¶
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
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
}
Click to show internal directories.
Click to hide internal directories.