Skip to content

Commit

Permalink
[BP] Add ownerId to geonet:info (geonetwork#7547)
Browse files Browse the repository at this point in the history
It is a more reliable way to identify the exact user.
  • Loading branch information
ianwallen committed Dec 14, 2023
1 parent 39537b6 commit 88df8f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/org/fao/geonet/constants/Edit.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public static final class Elem {
public static final String TITLE = "title";
public static final String IS_HARVESTED = "isHarvested";
public static final String HARVEST_INFO = "harvestInfo";
public static final String OWNERID = "ownerId";
public static final String OWNERNAME = "ownername";
public static final String GROUPOWNERNAME = "groupOwnerName";
public static final String POPULARITY = "popularity";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ private Element buildInfoElem(ServiceContext context, String id, String version)
// add owner name
User user = userRepository.findOne(owner);
if (user != null) {
addElement(info, Edit.Info.Elem.OWNERID, user.getId());
String ownerName = user.getName();
addElement(info, Edit.Info.Elem.OWNERNAME, ownerName);
}
Expand Down

0 comments on commit 88df8f2

Please sign in to comment.