mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[Task 70080] applied feedback to the scripts prototype
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user