if (getGlobalConfiguration(admin).getEnableEndEntityProfileLimitations()) {
// Check if administrator is authorized to view user.
if (!authorizedToEndEntityProfile(admin, data.getEndEntityProfileId(), AccessRulesConstants.VIEW_RIGHTS)) {
if (requestedUsername == null) {
final String msg = intres.getLocalizedMessage("ra.errorauthprofile", Integer.valueOf(data.getEndEntityProfileId()));
throw new AuthorizationDeniedException(msg);
} else {
final String msg = intres.getLocalizedMessage("ra.errorauthprofileexist", Integer.valueOf(data.getEndEntityProfileId()), requestedUsername);
throw new AuthorizationDeniedException(msg);
}
}
}
if (!authorizedToCA(admin, data.getCaId())) {
if (requestedUsername == null) {
final String msg = intres.getLocalizedMessage("ra.errorauthca", Integer.valueOf(data.getCaId()));
throw new AuthorizationDeniedException(msg);
} else {
final String msg = intres.getLocalizedMessage("ra.errorauthcaexist", Integer.valueOf(data.getCaId()), requestedUsername);
throw new AuthorizationDeniedException(msg);
}
}
return data.toUserDataVO();
}
return null;