Skip to content

Commit

Permalink
Switch getAndCheckMetadataId to getInternalId in recent canViewRecord…
Browse files Browse the repository at this point in the history
… changes as it supports both uuid and internal id.
  • Loading branch information
ianwallen committed Sep 29, 2023
1 parent 1579d52 commit a1f4d6c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
4 changes: 1 addition & 3 deletions services/src/main/java/org/fao/geonet/api/ApiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

package org.fao.geonet.api;

import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId;

import com.google.common.collect.Sets;
import jeeves.constants.Jeeves;
import jeeves.server.UserSession;
Expand Down Expand Up @@ -295,7 +293,7 @@ public static AbstractMetadata canViewRecord(String metadataUuid, boolean approv
String metadataId;
if (!approved) {
// If the record is not approved then we need to get the id of the record.
metadataId = String.valueOf(getAndCheckMetadataId(metadataUuid, approved));
metadataId = getInternalId(metadataUuid, approved);
} else {
// Otherwise use the uuid or id that was supplied.
metadataId = metadataUuid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import java.util.stream.Stream;

import static org.fao.geonet.api.ApiParams.*;
import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId;

import static org.fao.geonet.kernel.mef.MEFLib.Version.Constants.MEF_V1_ACCEPT_TYPE;
import static org.fao.geonet.kernel.mef.MEFLib.Version.Constants.MEF_V2_ACCEPT_TYPE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@

import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static org.fao.geonet.api.ApiParams.*;
import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId;

@RequestMapping(value = {
"/{portal}/api/records"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
import java.util.Locale;
import java.util.Map;

import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId;

@RequestMapping(value = {
"/{portal}/api/related"
})
Expand Down

0 comments on commit a1f4d6c

Please sign in to comment.