[Task 70080] applied feedback to the scripts prototype

This commit is contained in:
Raf Ponsaerts
2020-05-06 11:02:47 +02:00
parent 4031e41a5d
commit 861cdfb2b8
6 changed files with 5 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ public class MetadataExportScriptConfiguration<T extends MetadataExport> extends
try {
return authorizeService.isAdmin(context);
} catch (SQLException e) {
throw new RuntimeException("SQLException occured", e);
throw new RuntimeException("SQLException occurred when checking if the current user is an admin", e);
}
}

View File

@@ -45,7 +45,7 @@ public class MetadataImportScriptConfiguration<T extends MetadataImport> extends
try {
return authorizeService.isAdmin(context);
} catch (SQLException e) {
throw new RuntimeException("SQLException occured", e);
throw new RuntimeException("SQLException occurred when checking if the current user is an admin", e);
}
}

View File

@@ -35,7 +35,7 @@ public class IndexDiscoveryScriptConfiguration<T extends IndexClient> extends Sc
try {
return authorizeService.isAdmin(context);
} catch (SQLException e) {
throw new RuntimeException("SQLException occured", e);
throw new RuntimeException("SQLException occurred when checking if the current user is an admin", e);
}
}

View File

@@ -44,7 +44,7 @@ public class MockDSpaceRunnableScriptConfiguration<T extends MockDSpaceRunnableS
try {
return authorizeService.isAdmin(context);
} catch (SQLException e) {
throw new RuntimeException("SQLException occurred", e);
throw new RuntimeException("SQLException occurred when checking if the current user is an admin", e);
}
}

View File

@@ -102,10 +102,6 @@ public class ScriptRestRepository extends DSpaceRestRepository<ScriptRest, Strin
if (!scriptToExecute.isAllowedToExecute(context)) {
throw new AuthorizeException("Current user is not eligible to execute script with name: " + scriptName);
}
EPerson currentUser = context.getCurrentUser();
// if (currentUser != null) {
// scriptToExecute.setEpersonIdentifier(currentUser.getID());
// }
RestDSpaceRunnableHandler restDSpaceRunnableHandler = new RestDSpaceRunnableHandler(
context.getCurrentUser(), scriptName, dSpaceCommandLineParameters);
List<String> args = constructArgs(dSpaceCommandLineParameters);

View File

@@ -44,7 +44,7 @@ public class MockDSpaceRunnableScriptConfiguration<T extends MockDSpaceRunnableS
try {
return authorizeService.isAdmin(context);
} catch (SQLException e) {
throw new RuntimeException("SQLException occured", e);
throw new RuntimeException("SQLException occurred when checking if the current user is an admin", e);
}
}