Commit 7c040491 authored by Sridhar Sathu's avatar Sridhar Sathu

AddedAdminRole

parent 0db1189f
......@@ -44,9 +44,13 @@ public class UserController {
public ResponseEntity<EmployeeRoles> getEmployeeRole(@RequestParam("emailId") String emailId)
throws MyTimeException {
EmployeeRoles employeesRole = userService.getEmployeesRole(emailId);
String roleName = roleMappingService.getEmployeeRole(employeesRole.getEmployeeId());
if (roleName != null) {
employeesRole.setRole(roleName);
if (employeesRole.getRole() != null && employeesRole.getRole().equalsIgnoreCase("Admin")) {
employeesRole.setRole("Admin");
} else {
String roleName = roleMappingService.getEmployeeRole(employeesRole.getEmployeeId());
if (roleName != null) {
employeesRole.setRole(roleName);
}
}
System.out.println("emailId" + emailId + "result" + employeesRole);
return new ResponseEntity<>(employeesRole, HttpStatus.OK);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment