Merge pull request #142 from dikstub-rssa/feat/sso-auth
feat/sso-auth: adjust role const
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user