feat/sso-auth: adjust role const
This commit is contained in:
@@ -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