Skip to content

Commit

Permalink
API 2.0 and 2.1 and also Public API
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Mar 1, 2024
1 parent 4c4f853 commit ef80e41
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,7 @@ private Object downgradeObject(Object entity) {
}

private void checkProfileStatus(String orcid, boolean readOperation) {
try {
orcidSecurityManager.checkProfile(orcid);
} catch (DeactivatedException e) {
// If it is a read operation, ignore the deactivated status since we
// are going to return the empty element with the deactivation date
if (!readOperation) {
throw e;
}
}
orcidSecurityManager.checkProfile(orcid);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import javax.ws.rs.core.Response;

import org.orcid.api.publicV2.server.delegator.PublicV2ApiServiceDelegator;
import org.orcid.core.exception.DeactivatedException;
import org.orcid.core.manager.OrcidSecurityManager;
import org.orcid.core.manager.ProfileEntityCacheManager;
import org.orcid.core.version.V2Convertible;
Expand Down Expand Up @@ -282,11 +281,7 @@ private Response downgradeResponse(Response response) {
}

private void checkProfileStatus(String orcid) {
try {
orcidSecurityManager.checkProfile(orcid);
} catch(DeactivatedException e) {
// Ignore the DeactivatedException since we should be able to return the empty element
}
orcidSecurityManager.checkProfile(orcid);
}

@SuppressWarnings({ "rawtypes", "unchecked" })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.orcid.api.publicV3.server.delegator.impl;

import static org.orcid.core.api.OrcidApiConstants.STATUS_OK_MESSAGE;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
Expand All @@ -17,7 +15,6 @@
import org.orcid.api.common.writer.citeproc.V3WorkToCiteprocTranslator;
import org.orcid.api.publicV3.server.delegator.PublicV3ApiServiceDelegator;
import org.orcid.api.publicV3.server.security.PublicAPISecurityManagerV3;
import org.orcid.core.exception.DeactivatedException;
import org.orcid.core.exception.OrcidBadRequestException;
import org.orcid.core.exception.OrcidNoResultException;
import org.orcid.core.exception.SearchStartParameterLimitExceededException;
Expand Down Expand Up @@ -927,11 +924,7 @@ public Response viewServiceSummary(String orcid, Long putCode) {
}

private void checkProfileStatus(String orcid) {
try {
orcidSecurityManager.checkProfile(orcid);
} catch(DeactivatedException e) {
// Ignore the DeactivatedException since we should be able to return the empty element
}
orcidSecurityManager.checkProfile(orcid);
}

@Override
Expand Down

0 comments on commit ef80e41

Please sign in to comment.