Files
simrsx-be/pkg/auth-helper/tycovar.go

53 lines
1.1 KiB
Go

package authhelper
import (
ero "simrs-vx/internal/domain/references/organization"
)
type AuthKey struct{}
type AuthInfo struct {
Uuid string
User_Id uint
User_Name string
// User_Email string
// User_Ref_Id int
User_Position_Code string
}
func (a AuthInfo) IsDoctor() bool {
return a.User_Position_Code == string(ero.UPCDoc)
}
func (a AuthInfo) IsNurse() bool {
return a.User_Position_Code == string(ero.UPCNur)
}
func (a AuthInfo) IsNutritionist() bool {
return a.User_Position_Code == string(ero.UPCNut)
}
func (a AuthInfo) IsLaborant() bool {
return a.User_Position_Code == string(ero.UPCLab)
}
func (a AuthInfo) IsPharmacist() bool {
return a.User_Position_Code == string(ero.UPCPha)
}
func (a AuthInfo) IsPayment() bool {
return a.User_Position_Code == string(ero.UPCPay)
}
func (a AuthInfo) IsPaymentVerificator() bool {
return a.User_Position_Code == string(ero.UPCPav)
}
func (a AuthInfo) IsManagement() bool {
return a.User_Position_Code == string(ero.UPCMan)
}
func (a AuthInfo) IsSpecialistIntern() bool {
return a.User_Position_Code == string(ero.UPCInt)
}