Merge dev into feat/user
This commit is contained in:
+48
-13
@@ -7,11 +7,15 @@ import (
|
||||
type AuthKey struct{}
|
||||
|
||||
type AuthInfo struct {
|
||||
Uuid string
|
||||
User_Id uint
|
||||
User_Name string
|
||||
User_DivisionPositions []DivisionPosition
|
||||
User_Position_Code string
|
||||
Uuid string
|
||||
User_Id uint
|
||||
User_Name string
|
||||
User_ContractPosition_code string
|
||||
Employee_Position_Code *string
|
||||
Intern_Position_Code *string
|
||||
User_DivisionPositions []DivisionPosition
|
||||
// User_DivisionPositions []DivisionPosition
|
||||
// User_Position_Code string
|
||||
}
|
||||
|
||||
type DivisionPosition struct {
|
||||
@@ -20,33 +24,64 @@ type DivisionPosition struct {
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsDoctor() bool {
|
||||
return a.User_Position_Code == string(ero.UPCDoc)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCDoc)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsNurse() bool {
|
||||
return a.User_Position_Code == string(ero.UPCNur)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCNur)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsNutritionist() bool {
|
||||
return a.User_Position_Code == string(ero.UPCNut)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCNut)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsLaborant() bool {
|
||||
return a.User_Position_Code == string(ero.UPCLab)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCLab)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsPharmacist() bool {
|
||||
return a.User_Position_Code == string(ero.UPCPha)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCPha)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsPayment() bool {
|
||||
return a.User_Position_Code == string(ero.UPCPay)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCPay)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsManagement() bool {
|
||||
return a.User_Position_Code == string(ero.UPCMan)
|
||||
if a.Employee_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Employee_Position_Code == string(ero.EPCMan)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsSpecialistIntern() bool {
|
||||
return a.User_Position_Code == string(ero.UPCInt)
|
||||
if a.Intern_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Intern_Position_Code == string(ero.IPCSpecialist)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsNurseIntern() bool {
|
||||
if a.Intern_Position_Code == nil {
|
||||
return false
|
||||
}
|
||||
return *a.Intern_Position_Code == string(ero.IPCNurse)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user