roles

package
v0.0.0-...-0751cc3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	ID        uuid.UUID `json:"id" db:"id"`
	RoleType  RoleType  `json:"role_type" db:"role_type"`
	RoleName  RoleName  `json:"role_name" db:"role_name"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

Role represents a Role for users

func (*Role) Validate

func (r *Role) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Role) ValidateCreate

func (r *Role) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Role) ValidateUpdate

func (r *Role) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type RoleName

type RoleName string

RoleName represents the names of roles

type RoleType

type RoleType string

RoleType represents the types of users who can authenticate in the admin app

const (
	// RoleTypeTOO is the Transportation Ordering Officer Role
	RoleTypeTOO RoleType = "transportation_ordering_officer"
	// RoleTypeCustomer is the Customer Role
	RoleTypeCustomer RoleType = "customer"
	// RoleTypeTIO is the Transportation Invoicing Officer Role
	RoleTypeTIO RoleType = "transportation_invoicing_officer"
	// RoleTypeContractingOfficer is the Contracting Officer Role
	RoleTypeContractingOfficer RoleType = "contracting_officer"
	// RoleTypePPMOfficeUsers is the PPM Office User Role
	RoleTypePPMOfficeUsers RoleType = "ppm_office_users"
	// RoleTypeServicesCounselor is the Services Counselor Role
	RoleTypeServicesCounselor RoleType = "services_counselor"
	// RoleTypePrimeSimulator is the PrimeSimulator Role
	RoleTypePrimeSimulator RoleType = "prime_simulator"
	// RoleTypeQaeCsr is the Quality Assurance and Customer Support Role
	RoleTypeQaeCsr RoleType = "qae_csr"
	// RoleTypePrime is the Role associated with actions performed by the Prime
	RoleTypePrime RoleType = "prime"
)

type Roles

type Roles []Role

Roles is a slice of Role objects

func (Roles) GetRole

func (rs Roles) GetRole(roleType RoleType) (Role, bool)

GetRole returns the role a Role Type

func (Roles) HasRole

func (rs Roles) HasRole(roleType RoleType) bool

HasRole validates if Role has a role of a particular type

Jump to

Keyboard shortcuts

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