feat/sso-auth: adjust role const
This commit is contained in:
No files matched your search
@@ -11,21 +11,21 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CSCSys ContractPositionCode = "system" // System
|
CSCSys ContractPositionCode = "sys" // System
|
||||||
CSCEmp ContractPositionCode = "employee" // Pegawai
|
CSCEmp ContractPositionCode = "emp" // Pegawai
|
||||||
CSCInt ContractPositionCode = "intern" // PPDS
|
CSCInt ContractPositionCode = "int" // PPDS
|
||||||
|
|
||||||
EPCReg EmployeePositionCode = "registration" // Admisi/Pendaftaran
|
EPCReg EmployeePositionCode = "reg" // Admisi/Pendaftaran
|
||||||
EPCNur EmployeePositionCode = "nurse" // Perawat
|
EPCNur EmployeePositionCode = "nur" // Perawat
|
||||||
EPCDoc EmployeePositionCode = "doctor" // Dokter
|
EPCDoc EmployeePositionCode = "doc" // Dokter
|
||||||
EPCNut EmployeePositionCode = "nutritionist" // Ahli gizi
|
EPCNut EmployeePositionCode = "nut" // Ahli gizi
|
||||||
EPCMwi EmployeePositionCode = "mid-wife" // Bidan
|
EPCMwi EmployeePositionCode = "miw" // Bidan
|
||||||
EPCLab EmployeePositionCode = "laborant" // Laboran
|
EPCLab EmployeePositionCode = "lab" // Laboran
|
||||||
EPCPha EmployeePositionCode = "pharmacy" // Farmasi
|
EPCPha EmployeePositionCode = "pha" // Farmasi
|
||||||
EPCPay EmployeePositionCode = "payment" // Pembayaran
|
EPCPay EmployeePositionCode = "pay" // Pembayaran
|
||||||
EPCHur EmployeePositionCode = "human-resource" // Sumber Daya Manusia
|
EPCHur EmployeePositionCode = "hue" // Sumber Daya Manusia
|
||||||
EPCGea EmployeePositionCode = "general-affair" // Bagian Umum
|
EPCGea EmployeePositionCode = "gea" // Bagian Umum
|
||||||
EPCMan EmployeePositionCode = "management" // Manajemen
|
EPCMan EmployeePositionCode = "man" // Manajemen
|
||||||
|
|
||||||
IPCSpecialist = "specialist-intern"
|
IPCSpecialist = "specialist-intern"
|
||||||
IPCNurse = "nurse-intern"
|
IPCNurse = "nurse-intern"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func getDivisionPosition(employee_id uint, event *pl.Event) ([]string, error) {
|
|||||||
|
|
||||||
if len(data) > 0 {
|
if len(data) > 0 {
|
||||||
for _, dp := range data {
|
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 {
|
if len(data) > 0 {
|
||||||
for _, dp := range data {
|
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 {
|
if len(data) > 0 {
|
||||||
for _, dp := range data {
|
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 {
|
if len(data) > 0 {
|
||||||
for _, dp := range data {
|
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 {
|
if len(data) > 0 {
|
||||||
for _, dp := range data {
|
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
|
atClaims["employee_id"] = employee.Id
|
||||||
outputData["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
|
// employee position
|
||||||
if employee.Id > 0 && employee.Position_Code != nil {
|
if employee.Id > 0 && employee.Position_Code != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user