feat/sso-auth: adjust role const
This commit is contained in:
@@ -11,21 +11,21 @@ type (
|
||||
)
|
||||
|
||||
const (
|
||||
CSCSys ContractPositionCode = "system" // System
|
||||
CSCEmp ContractPositionCode = "employee" // Pegawai
|
||||
CSCInt ContractPositionCode = "intern" // PPDS
|
||||
CSCSys ContractPositionCode = "sys" // System
|
||||
CSCEmp ContractPositionCode = "emp" // Pegawai
|
||||
CSCInt ContractPositionCode = "int" // PPDS
|
||||
|
||||
EPCReg EmployeePositionCode = "registration" // Admisi/Pendaftaran
|
||||
EPCNur EmployeePositionCode = "nurse" // Perawat
|
||||
EPCDoc EmployeePositionCode = "doctor" // Dokter
|
||||
EPCNut EmployeePositionCode = "nutritionist" // Ahli gizi
|
||||
EPCMwi EmployeePositionCode = "mid-wife" // Bidan
|
||||
EPCLab EmployeePositionCode = "laborant" // Laboran
|
||||
EPCPha EmployeePositionCode = "pharmacy" // Farmasi
|
||||
EPCPay EmployeePositionCode = "payment" // Pembayaran
|
||||
EPCHur EmployeePositionCode = "human-resource" // Sumber Daya Manusia
|
||||
EPCGea EmployeePositionCode = "general-affair" // Bagian Umum
|
||||
EPCMan EmployeePositionCode = "management" // Manajemen
|
||||
EPCReg EmployeePositionCode = "reg" // Admisi/Pendaftaran
|
||||
EPCNur EmployeePositionCode = "nur" // Perawat
|
||||
EPCDoc EmployeePositionCode = "doc" // Dokter
|
||||
EPCNut EmployeePositionCode = "nut" // Ahli gizi
|
||||
EPCMwi EmployeePositionCode = "miw" // Bidan
|
||||
EPCLab EmployeePositionCode = "lab" // Laboran
|
||||
EPCPha EmployeePositionCode = "pha" // Farmasi
|
||||
EPCPay EmployeePositionCode = "pay" // Pembayaran
|
||||
EPCHur EmployeePositionCode = "hue" // Sumber Daya Manusia
|
||||
EPCGea EmployeePositionCode = "gea" // Bagian Umum
|
||||
EPCMan EmployeePositionCode = "man" // Manajemen
|
||||
|
||||
IPCSpecialist = "specialist-intern"
|
||||
IPCNurse = "nurse-intern"
|
||||
|
||||
@@ -70,7 +70,7 @@ func getDivisionPosition(employee_id uint, event *pl.Event) ([]string, error) {
|
||||
|
||||
if len(data) > 0 {
|
||||
for _, dp := range data {
|
||||
result = append(result, "div-"+*dp.Division_Code)
|
||||
result = append(result, "div|"+*dp.Division_Code+"|"+dp.Code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func getInstallationPosition(employeeId uint, event *pl.Event) ([]string, error)
|
||||
|
||||
if len(data) > 0 {
|
||||
for _, dp := range data {
|
||||
result = append(result, "inst-"+*dp.Installation_Code+"-"+dp.Code)
|
||||
result = append(result, "inst|"+*dp.Installation_Code+"|"+dp.Code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ func getUnitPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
|
||||
if len(data) > 0 {
|
||||
for _, dp := range data {
|
||||
result = append(result, "unit-"+*dp.Unit_Code+"-"+dp.Code)
|
||||
result = append(result, "unit|"+*dp.Unit_Code+"|"+dp.Code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ func getSpecialistPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
|
||||
if len(data) > 0 {
|
||||
for _, dp := range data {
|
||||
result = append(result, "spec-"+*dp.Specialist_Code+"-"+dp.Code)
|
||||
result = append(result, "spec|"+*dp.Specialist_Code+"|"+dp.Code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ func getSubspecialistPosition(employeeId uint, event *pl.Event) ([]string, error
|
||||
|
||||
if len(data) > 0 {
|
||||
for _, dp := range data {
|
||||
result = append(result, "subspec-"+dp.Subspecialist.Code+"-"+dp.Code)
|
||||
result = append(result, "subspec|"+dp.Subspecialist.Code+"|"+dp.Code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ func populateRoles(user *eu.User, input eu.LoginDto, atClaims jwt.MapClaims, out
|
||||
}
|
||||
atClaims["employee_id"] = employee.Id
|
||||
outputData["employee_id"] = employee.Id
|
||||
roles = append(roles, "emp-"+string(*employee.Position_Code))
|
||||
roles = append(roles, "emp|"+string(*employee.Position_Code))
|
||||
|
||||
// employee position
|
||||
if employee.Id > 0 && employee.Position_Code != nil {
|
||||
|
||||
Reference in New Issue
Block a user