use of org.finra.gatekeeper.services.auth.GatekeeperRdsRole in project Gatekeeper by FINRAOS.
the class AuthController method getRole.
@RequestMapping(value = "/getRole", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public Map<String, Object> getRole() {
Map<String, Object> result = new HashMap<>();
GatekeeperUserEntry user = gatekeeperRoleService.getUserProfile();
result.put("userId", user.getUserId());
result.put("name", user.getName());
GatekeeperRdsRole role = gatekeeperRoleService.getRole();
result.put("email", user.getEmail());
result.put("approvalThreshold", approvalThreshold.getApprovalPolicy(role));
result.put("role", role);
switch(role) {
case APPROVER:
case DBA:
result.put("memberships", gatekeeperRoleService.getDbaMemberships());
return result;
default:
{
result.put("memberships", gatekeeperRoleService.getDevMemberships());
return result;
}
}
}
Aggregations