Skip to content

Commit

Permalink
feat: Add support for getCurrentUserId
Browse files Browse the repository at this point in the history
  • Loading branch information
travisstebbins committed Oct 31, 2024
1 parent 72cfcf2 commit b98a269
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,4 +546,21 @@ public CompletableFuture<LegendSDLCFeature.SubtypeInfoResult> getSubtypeInfo()
}
});
}

public CompletableFuture<String> getCurrentUserId()
{
return this.server.supplyPossiblyAsync(() ->
{
try
{
return System.getProperty("user.name");
}
catch (Throwable e)
{
LOGGER.error("Error while getting current user ID", e);
this.server.showErrorToClient("Error while getting current user ID: " + e.getMessage());
return null;
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ public interface LegendLanguageServiceContract

@JsonRequest("getSubtypeInfo")
CompletableFuture<LegendSDLCFeature.SubtypeInfoResult> getSubtypeInfo();

@JsonRequest("getCurrentUserId")
CompletableFuture<String> getCurrentUserId();
}

0 comments on commit b98a269

Please sign in to comment.