diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java b/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
index 17e3086f184..0ee146ed99b 100644
--- a/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
+++ b/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
@@ -407,6 +407,12 @@ public Response importDataset(@Context ContainerRequestContext crc, String jsonB
if (ds.getIdentifier() == null) {
return badRequest("Please provide a persistent identifier, either by including it in the JSON, or by using the pid query parameter.");
}
+
+ PidProvider pidProvider = PidUtil.getPidProvider(ds.getGlobalId().getProviderId());
+ if (pidProvider == null || !pidProvider.canManagePID()) {
+ return badRequest("Cannot import a dataset that has a PID that doesn't match the server's settings");
+ }
+
boolean shouldRelease = StringUtil.isTrue(releaseParam);
DataverseRequest request = createDataverseRequest(u);
diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Users.java b/src/main/java/edu/harvard/iq/dataverse/api/Users.java
index 1f5430340c2..c1a7c95dbff 100644
--- a/src/main/java/edu/harvard/iq/dataverse/api/Users.java
+++ b/src/main/java/edu/harvard/iq/dataverse/api/Users.java
@@ -24,13 +24,7 @@
import jakarta.ejb.Stateless;
import jakarta.json.JsonArray;
import jakarta.json.JsonObjectBuilder;
-import jakarta.ws.rs.BadRequestException;
-import jakarta.ws.rs.DELETE;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.*;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
@@ -157,7 +151,7 @@ public Response getTokenExpirationDate() {
@Path("token/recreate")
@AuthRequired
@POST
- public Response recreateToken(@Context ContainerRequestContext crc) {
+ public Response recreateToken(@Context ContainerRequestContext crc, @QueryParam("returnExpiration") boolean returnExpiration) {
User u = getRequestUser(crc);
AuthenticatedUser au;
@@ -174,8 +168,12 @@ public Response recreateToken(@Context ContainerRequestContext crc) {
ApiToken newToken = authSvc.generateApiTokenForUser(au);
authSvc.save(newToken);
- return ok("New token for " + au.getUserIdentifier() + " is " + newToken.getTokenString());
+ String message = "New token for " + au.getUserIdentifier() + " is " + newToken.getTokenString();
+ if (returnExpiration) {
+ message += " and expires on " + newToken.getExpireTime();
+ }
+ return ok(message);
}
@GET
diff --git a/src/main/webapp/dataset-license-terms.xhtml b/src/main/webapp/dataset-license-terms.xhtml
index 255e63fbfc2..03173faf989 100644
--- a/src/main/webapp/dataset-license-terms.xhtml
+++ b/src/main/webapp/dataset-license-terms.xhtml
@@ -12,7 +12,7 @@
or !empty termsOfUseAndAccess.originalArchive or !empty termsOfUseAndAccess.availabilityStatus
or !empty termsOfUseAndAccess.contactForAccess or !empty termsOfUseAndAccess.sizeOfCollection
or !empty termsOfUseAndAccess.studyCompletion
- or termsOfUseAndAccess.fileAccessRequest}"/>
+ }"/>
roleIds) {
Response response = given()
.header(API_TOKEN_HTTP_HEADER, apiToken)