DURACOM-136 allow script execution by user other than admins

This commit is contained in:
Andrea Bollini
2023-04-21 06:54:13 +02:00
committed by Andrea Bollini
parent 74e3d10326
commit 7971887b9a
37 changed files with 659 additions and 319 deletions

View File

@@ -129,6 +129,11 @@ public class ProcessServiceImpl implements ProcessService {
return processes;
}
@Override
public List<Process> findByUser(Context context, EPerson eperson, int limit, int offset) throws SQLException {
return processDAO.findByUser(context, eperson, limit, offset);
}
@Override
public void start(Context context, Process process) throws SQLException {
process.setProcessStatus(ProcessStatus.RUNNING);
@@ -311,6 +316,11 @@ public class ProcessServiceImpl implements ProcessService {
return this.processDAO.findByStatusAndCreationTimeOlderThan(context, statuses, date);
}
@Override
public int countByUser(Context context, EPerson user) throws SQLException {
return processDAO.countByUser(context, user);
}
private String formatLogLine(int processId, String scriptName, String output, ProcessLogLevel processLogLevel) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
StringBuilder sb = new StringBuilder();