Merge pull request #142 from dikstub-rssa/feat/sso-auth

feat/sso-auth: adjust role const
This commit is contained in:
Munawwirul Jamal
2025-11-12 07:30:34 +07:00
committed by GitHub
2 changed files with 20 additions and 20 deletions
@@ -71,7 +71,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)
}
}
@@ -91,7 +91,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)
}
}
@@ -109,7 +109,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)
}
}
@@ -127,7 +127,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)
}
}
@@ -147,7 +147,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)
}
}
@@ -210,7 +210,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 {