53 lines
1.2 KiB
Go
53 lines
1.2 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_DivisionPositions []DivisionPosition
|
|
User_Position_Code string
|
|
}
|
|
|
|
type DivisionPosition struct {
|
|
Division_Code string `json:"division_code"`
|
|
DivisionPosition_Code string `json:"divisionPosition_code"`
|
|
}
|
|
|
|
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) IsManagement() bool {
|
|
return a.User_Position_Code == string(ero.UPCMan)
|
|
}
|
|
|
|
func (a AuthInfo) IsSpecialistIntern() bool {
|
|
return a.User_Position_Code == string(ero.UPCInt)
|
|
}
|