constants

package
v0.0.0-...-48f5382 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FacilityDisplayNameMap = map[FacilityID]string{
		AcademyFacility:      "Academy",
		HeadquartersFacility: "Headquarters",
		NonMemberFacility:    "Non-Member",
		InactiveFacility:     "Inactive",

		AlbuquerqueFacility:  "Albuquerque ARTCC",
		AnchorageFacility:    "Anchorage ARTCC",
		AtlantaFacility:      "Atlanta ARTCC",
		BostonFacility:       "Boston ARTCC",
		ChicagoFacility:      "Chicago ARTCC",
		ClevelandFacility:    "Cleveland ARTCC",
		DenverFacility:       "Denver ARTCC",
		FortWorthFacility:    "Fort Worth ARTCC",
		HonoluluFacility:     "Honolulu Control FacilityID",
		HoustonFacility:      "Houston ARTCC",
		IndianapolisFacility: "Indianapolis ARTCC",
		JacksonvilleFacility: "Jacksonville ARTCC",
		KansasCityFacility:   "Kansas City ARTCC",
		LosAngelesFacility:   "Los Angeles ARTCC",
		MemphisFacility:      "Memphis ARTCC",
		MiamiFacility:        "Miami ARTCC",
		MinneapolisFacility:  "Minneapolis ARTCC",
		NewYorkFacility:      "New York ARTCC",
		OaklandFacility:      "Oakland ARTCC",
		SaltLakeFacility:     "Salt Lake ARTCC",
		SeattleFacility:      "Seattle ARTCC",
		WashingtonFacility:   "Washington, D.C. ARTCC",
	}
)
View Source
var Roles = map[RoleID]Role{

	AirTrafficManagerRole: {
		Name: "Air Traffic Manager",
		Groups: []GroupID{
			FacilityManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	DeputyAirTrafficManagerRole: {
		Name: "Deputy Air Traffic Manager",
		Groups: []GroupID{
			FacilityManagement,
		},
		RolesCanAdd: []RoleID{
			AirTrafficManagerRole,
		},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			FacilityManagement,
		},
	},
	TrainingAdministratorRole: {
		Name:        "Training Administrator",
		Groups:      []GroupID{},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionTraining,
			FacilityManagement,
		},
	},
	EventCoordinatorRole: {
		Name: "Event Coordinator",
		Groups: []GroupID{
			FacilityStaff,
			FacilityEvents,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionEvents,
			FacilityManagement,
		},
	},
	AssistantEventCoordinator: {
		Name: "Assistant Event Coordinator",
		Groups: []GroupID{
			FacilityEvents,
		},
		RolesCanAdd: []RoleID{
			EventCoordinatorRole,
		},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionEvents,
			FacilityManagement,
		},
	},
	FacilityEngineerRole: {
		Name: "Facility Engineer",
		Groups: []GroupID{
			FacilityStaff,
			FacilityEngineers,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			FacilityManagement,
		},
	},
	AssistantFacilityEngineer: {
		Name: "Assistant Facility Engineer",
		Groups: []GroupID{
			FacilityEngineers,
		},
		RolesCanAdd: []RoleID{
			FacilityEngineerRole,
		},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			FacilityManagement,
		},
	},
	WebMasterRole: {
		Name: "Webmaster",
		Groups: []GroupID{
			FacilityStaff,
			FacilityDevelopment,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			FacilityManagement,
		},
	},
	AssistantWebMasterRole: {
		Name: "Assistant Webmaster",
		Groups: []GroupID{
			FacilityDevelopment,
		},
		RolesCanAdd: []RoleID{
			WebMasterRole,
		},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			FacilityManagement,
			FacilityDevelopment,
		},
	},
	InstructorRole: {
		Name: "Instructor",
		Groups: []GroupID{
			FacilityTraining,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionTraining,
			DivisionDevelopment,
		},
	},
	MentorRole: {
		Name: "Mentor",
		Groups: []GroupID{
			FacilityTraining,
		},
		RolesCanAdd: []RoleID{
			TrainingAdministratorRole,
		},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionTraining,
			DivisionDevelopment,
			FacilityManagement,
		},
	},

	DivisionDirectorRole: {
		Name: "Division Director",
		Groups: []GroupID{
			DivisionManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	AirTrafficServicesRole: {
		Name: "Deputy Director Air Traffic Services",
		Groups: []GroupID{
			DivisionManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	TrainingServicesRole: {
		Name: "Deputy Director Training Services",
		Groups: []GroupID{
			DivisionManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	SupportServicesRole: {
		Name: "Deputy Director Support Services",
		Groups: []GroupID{
			DivisionManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	EventsManagerRole: {
		Name: "Events Manager",
		Groups: []GroupID{
			DivisionStaff,
			DivisionEvents,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	TechnicalManagerRole: {
		Name: "Technical Manager",
		Groups: []GroupID{
			DivisionStaff,
			DivisionDevelopment,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	StaffDevelopmentManagerRole: {
		Name: "Staff Development Manager",
		Groups: []GroupID{
			DivisionStaff,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	TrainingServicesManagerRole: {
		Name: "Training Services Manager",
		Groups: []GroupID{
			DivisionStaff,
			DivisionTraining,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionTraining,
		},
	},
	TrainingContentManagerRole: {
		Name: "Training Content Manager",
		Groups: []GroupID{
			DivisionStaff,
			DivisionTraining,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionTraining,
		},
	},

	DeveloperTeamRole: {
		Name: "Developer Team",
		Groups: []GroupID{
			DivisionDevelopment,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	AceTeamRole: {
		Name: "ACE Team",
		Groups: []GroupID{
			TrafficManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionEvents,
		},
	},
	NTMSRole: {
		Name: "National Traffic Management Supervisor",
		Groups: []GroupID{
			TrafficManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionEvents,
		},
	},
	NTMTRole: {
		Name: "National Training Management Supervisor",
		Groups: []GroupID{
			TrafficManagement,
		},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionEvents,
		},
	},
	SocialMediaTeam: {
		Name:        "Social Media Team",
		Groups:      []GroupID{},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
		},
	},
	TrainingContentTeam: {
		Name:        "Training Content Team",
		Groups:      []GroupID{},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionTraining,
		},
	},
	AcademyMaterialEditor: {
		Name:        "Academy Material Editor (Academy)",
		Groups:      []GroupID{},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionTraining,
		},
	},
	FacilityMaterialEditor: {
		Name:   "Academy Material Editor (Facility)",
		Groups: []GroupID{},
		RolesCanAdd: []RoleID{
			TrainingAdministratorRole,
		},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionDevelopment,
			DivisionTraining,
			FacilityManagement,
		},
	},

	EmailUser: {
		Name:        "Email User",
		Groups:      []GroupID{},
		RolesCanAdd: []RoleID{},
		GroupsCanAdd: []GroupID{
			DivisionManagement,
			DivisionStaff,
			FacilityManagement,
			FacilityStaff,
		},
	},
}

Functions

func CanAddRole

func CanAddRole(userRoles []RoleID, targetRole RoleID) bool

CanAddRole checks if a user with the given roles can add the target role

Types

type ATCRating

type ATCRating int
const (
	InactiveRating         ATCRating = -1
	SuspendedRating        ATCRating = 0
	ObserverRating         ATCRating = 1
	Student1Rating         ATCRating = 2
	Student2Rating         ATCRating = 3
	Student3Rating         ATCRating = 4
	ControllerRating       ATCRating = 5
	SeniorControllerRating ATCRating = 7
	InstructorRating       ATCRating = 8
	SeniorInstructorRating ATCRating = 10
	SupervisorRating       ATCRating = 11
	AdministratorRating    ATCRating = 12
)

func (ATCRating) Int

func (r ATCRating) Int() int

func (ATCRating) IsValidRating

func (r ATCRating) IsValidRating() bool

func (ATCRating) Long

func (r ATCRating) Long() string

func (ATCRating) Short

func (r ATCRating) Short() string

type FacilityID

type FacilityID string
const (
	// Special Facilities
	AcademyFacility      FacilityID = "ZAE"
	HeadquartersFacility FacilityID = "ZHQ"
	NonMemberFacility    FacilityID = "ZZN"
	InactiveFacility     FacilityID = "ZZI"

	// ARTCC Facilities
	AlbuquerqueFacility  FacilityID = "ZAB"
	AnchorageFacility    FacilityID = "ZAN"
	AtlantaFacility      FacilityID = "ZTL"
	BostonFacility       FacilityID = "ZBW"
	ChicagoFacility      FacilityID = "ZAU"
	ClevelandFacility    FacilityID = "ZOB"
	DenverFacility       FacilityID = "ZDV"
	FortWorthFacility    FacilityID = "ZFW"
	HonoluluFacility     FacilityID = "HCF"
	HoustonFacility      FacilityID = "ZHU"
	IndianapolisFacility FacilityID = "ZID"
	JacksonvilleFacility FacilityID = "ZJX"
	KansasCityFacility   FacilityID = "ZKC"
	LosAngelesFacility   FacilityID = "ZLA"
	MemphisFacility      FacilityID = "ZME"
	MiamiFacility        FacilityID = "ZMA"
	MinneapolisFacility  FacilityID = "ZMP"
	NewYorkFacility      FacilityID = "ZNY"
	OaklandFacility      FacilityID = "ZOA"
	SaltLakeFacility     FacilityID = "ZLC"
	SeattleFacility      FacilityID = "ZSE"
	WashingtonFacility   FacilityID = "ZDC"
)

func (FacilityID) DisplayName

func (f FacilityID) DisplayName() string

func (FacilityID) IsTierOne

func (a FacilityID) IsTierOne(b FacilityID) bool

func (FacilityID) IsValidFacility

func (fac FacilityID) IsValidFacility() bool

type GroupID

type GroupID string
const (
	// Division Groups
	DivisionManagement  GroupID = "div_mgmt"
	DivisionStaff       GroupID = "div_staff"
	DivisionDevelopment GroupID = "div_dev"
	DivisionEvents      GroupID = "div_events"
	DivisionTraining    GroupID = "div_training"

	// Facility Groups
	FacilityManagement  GroupID = "fac_mgmt"
	FacilityStaff       GroupID = "fac_staff"
	FacilityEvents      GroupID = "fac_events"
	FacilityTraining    GroupID = "fac_training"
	FacilityDevelopment GroupID = "fac_dev"
	FacilityEngineers   GroupID = "fac_eng"

	// Misc Groups
	TrafficManagement GroupID = "tmu"
)

func (GroupID) RolesInGroup

func (g GroupID) RolesInGroup() []RoleID

type PilotRating

type PilotRating int
const (
	NoRating               PilotRating = 0
	PrivatePilotRating     PilotRating = 1
	InstrumentRating       PilotRating = 3
	CommercialMultiRating  PilotRating = 7
	AirTransportRating     PilotRating = 15
	FlightInstructorRating PilotRating = 31
	FlightExaminerRating   PilotRating = 63
)

func (PilotRating) Int

func (r PilotRating) Int() int

func (PilotRating) IsValidRating

func (r PilotRating) IsValidRating() bool

func (PilotRating) Long

func (r PilotRating) Long() string

func (PilotRating) Short

func (r PilotRating) Short() string

type Role

type Role struct {
	Name         string
	Groups       []GroupID // Groups this role is a part of
	RolesCanAdd  []RoleID  // Roles this role can be added by
	GroupsCanAdd []GroupID // Groups this role can be added by
}

type RoleID

type RoleID string
const (
	// ARTCC Roles
	AirTrafficManagerRole       RoleID = "ATM"
	DeputyAirTrafficManagerRole RoleID = "DATM"
	TrainingAdministratorRole   RoleID = "TA"
	EventCoordinatorRole        RoleID = "EC"
	AssistantEventCoordinator   RoleID = "AEC"
	FacilityEngineerRole        RoleID = "FE"
	AssistantFacilityEngineer   RoleID = "AFE"
	WebMasterRole               RoleID = "WM"
	AssistantWebMasterRole      RoleID = "AWM"
	InstructorRole              RoleID = "INS"
	MentorRole                  RoleID = "MTR"

	// Division Roles
	DivisionDirectorRole        RoleID = "USA1"
	AirTrafficServicesRole      RoleID = "USA2"
	TrainingServicesRole        RoleID = "USA3"
	SupportServicesRole         RoleID = "USA4"
	EventsManagerRole           RoleID = "USA5"
	TechnicalManagerRole        RoleID = "USA6"
	StaffDevelopmentManagerRole RoleID = "USA7"
	TrainingServicesManagerRole RoleID = "USA8"
	TrainingContentManagerRole  RoleID = "USA9"

	// Other Roles
	DeveloperTeamRole      RoleID = "DEV"
	AceTeamRole            RoleID = "ACE"
	NTMSRole               RoleID = "NTMS"
	NTMTRole               RoleID = "NTMT"
	SocialMediaTeam        RoleID = "SMT"
	TrainingContentTeam    RoleID = "TCT"
	AcademyMaterialEditor  RoleID = "CBT"
	FacilityMaterialEditor RoleID = "FACCBT"

	// Misc Roles
	EmailUser RoleID = "EMAIL"
)

func (RoleID) DisplayName

func (r RoleID) DisplayName() string

func (RoleID) InGroup

func (r RoleID) InGroup(group GroupID) bool

func (RoleID) IsValidRole

func (r RoleID) IsValidRole() bool

func (RoleID) RolesCanAdd

func (r RoleID) RolesCanAdd() []RoleID

Jump to

Keyboard shortcuts

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