Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/src/org/labkey/api/pipeline/PipelineJobService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.labkey.api.data.Container;
import org.labkey.api.formSchema.FormSchema;
import org.labkey.api.pipeline.file.PathMapper;
import org.labkey.api.security.User;
import org.labkey.api.util.QuietCloser;

import java.io.FileNotFoundException;
Expand Down Expand Up @@ -192,7 +193,7 @@ enum LocationType
RemoteExecutionEngine
}

FormSchema getFormSchema(Container container);
FormSchema getFormSchema(Container container, User user);

/** @return true if the current instance is the web server, which has access to more resources including the
* primary database, or false if we're on a remote server
Expand Down
13 changes: 10 additions & 3 deletions pipeline/src/org/labkey/pipeline/api/PipelineJobServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
import org.labkey.api.pipeline.trigger.PipelineTriggerRegistry;
import org.labkey.api.pipeline.trigger.PipelineTriggerType;
import org.labkey.api.reports.report.r.RReport;
import org.labkey.api.security.SecurityManager;
import org.labkey.api.security.User;
import org.labkey.api.security.permissions.InsertPermission;
import org.labkey.api.util.FileUtil;
import org.labkey.api.util.JunitUtil;
import org.labkey.api.util.MemTracker;
Expand Down Expand Up @@ -672,7 +675,7 @@ public PipelineStatusFile.JobStore getJobStore()
}

@Override
public FormSchema getFormSchema(Container container)
public FormSchema getFormSchema(Container container, User user)
{
List<Option<String>> typeOptions = new ArrayList<>();
for (PipelineTriggerType<?> pipelineTriggerType : PipelineTriggerRegistry.get().getTypes())
Expand All @@ -696,7 +699,11 @@ public FormSchema getFormSchema(Container container)
for (FileAnalysisTaskPipeline task : tasks)
taskOptions.add(new Option<>(task.getId().toString(), task.getDescription()));

String usernameHelpText = "The file watcher will run as this user in the pipeline. Some tasks may require this user to have admin permissions.";
List<Option<String>> userOptions = new ArrayList<>(SecurityManager.getUsersWithPermissions(container, Set.of(InsertPermission.class)).stream()
.map(u -> new Option<>(u.getDisplayName(user), u.getDisplayName(user)))
.toList());

String usernameHelpText = "The file watcher will run as this user in the pipeline. Users in this list have insert permissions for the folder. Some tasks may require this user to have admin permissions.";
String assayProviderHelpText = "Use this provider for running assay import runs. This will be the name of the assay type eg : General or " +
"the name of a module based assay.";
String baseHref = "https://www.labkey.org/Documentation/wiki-page.view?name=fileWatchCreate#";
Expand All @@ -708,7 +715,7 @@ public FormSchema getFormSchema(Container container)
new TextareaField("description", "Description", null, false, ""),
new SelectField<>("type", "Type", null, true, typeDefaultValue, typeOptions),
new SelectField<>("pipelineId", "Pipeline Task", "Select a Pipeline Task", true, null, taskOptions),
new TextField("username", "Run as Username", null, false, null, usernameHelpText, usernameHref),
new SelectField("username", "Run as Username", null, true, null, userOptions, usernameHelpText, usernameHref),
new TextField("assay provider", "Assay Provider", "General", false, null, assayProviderHelpText, assayProviderHref),
new CheckboxField("enabled", "Enable this Trigger", false, true)
);
Expand Down
2 changes: 1 addition & 1 deletion pipeline/src/org/labkey/pipeline/createPipelineTrigger.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

String uniqueId = "" + UniqueID.getServerSessionScopedUID();
String appId = "create-pipeline-trigger-" + uniqueId;
FormSchema detailsFormSchema = PipelineJobService.get().getFormSchema(getContainer());
FormSchema detailsFormSchema = PipelineJobService.get().getFormSchema(getContainer(), getUser());
Map<String, FormSchema> taskFormSchemas = new HashMap<>();
Map<String, FormSchema> customFieldFormSchemas = new HashMap<>();
Map<String, String> tasksHelpText = new HashMap<>();
Expand Down