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

AddedAdminRole

parent 0db1189f
...@@ -44,10 +44,14 @@ public class UserController { ...@@ -44,10 +44,14 @@ public class UserController {
public ResponseEntity<EmployeeRoles> getEmployeeRole(@RequestParam("emailId") String emailId) public ResponseEntity<EmployeeRoles> getEmployeeRole(@RequestParam("emailId") String emailId)
throws MyTimeException { throws MyTimeException {
EmployeeRoles employeesRole = userService.getEmployeesRole(emailId); EmployeeRoles employeesRole = userService.getEmployeesRole(emailId);
if (employeesRole.getRole() != null && employeesRole.getRole().equalsIgnoreCase("Admin")) {
employeesRole.setRole("Admin");
} else {
String roleName = roleMappingService.getEmployeeRole(employeesRole.getEmployeeId()); String roleName = roleMappingService.getEmployeeRole(employeesRole.getEmployeeId());
if (roleName != null) { if (roleName != null) {
employeesRole.setRole(roleName); employeesRole.setRole(roleName);
} }
}
System.out.println("emailId" + emailId + "result" + employeesRole); System.out.println("emailId" + emailId + "result" + employeesRole);
return new ResponseEntity<>(employeesRole, HttpStatus.OK); 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