Skip to content

Commit

Permalink
[DSC-1905] Removes process-cleaner for non administrators
Browse files Browse the repository at this point in the history
  • Loading branch information
vins01-4science committed Sep 11, 2024
1 parent 7a373f6 commit 2faf90d
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
*/
package org.dspace.administer;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.cli.Options;
import org.dspace.core.Context;
import org.dspace.scripts.DSpaceCommandLineParameter;
import org.dspace.scripts.configuration.ScriptConfiguration;

/**
Expand All @@ -22,17 +17,6 @@ public class ProcessCleanerConfiguration<T extends ProcessCleaner> extends Scrip

private Class<T> dspaceRunnableClass;

@Override
public boolean isAllowedToExecute(Context context, List<DSpaceCommandLineParameter> commandLineParameters) {
try {
return authorizeService.isAdmin(context) || authorizeService.isComColAdmin(context) ||
authorizeService.isItemAdmin(context);
} catch (SQLException e) {
throw new RuntimeException(
"SQLException occurred when checking if the current user is eligible to run the script", e);
}
}

@Override
public Options getOptions() {
if (options == null) {
Expand Down

0 comments on commit 2faf90d

Please sign in to comment.