Skip to content

Conversation

@labkey-susanh
Copy link
Contributor

Rationale

Users want to move jobs around as they work to reorganize their data when the organization or its usage of the Workflow feature set expands.

Related Pull Requests

Changes

  • Update getMoveTargetContainer method to check SampleWorkflowJobPermission for moving jobs and to throw UnauthorizedException instead of the generic error if permissions are not satisfied

@labkey-susanh labkey-susanh requested a review from cnathe December 16, 2025 22:43
if (!_targetContainer.hasPermission(user, InsertPermission.class))
Class<? extends Permission> permClass = InsertPermission.class;
if (schemaName != null && schemaName.equalsIgnoreCase("workflow") && queryName != null && queryName.equalsIgnoreCase("job"))
permClass = SampleWorkflowJobPermission.class;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this is a bit of a hack and am open to other ideas.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is only called from the MoveRowsAction, there really isn't a better, workflow specific location for this code. One idea would be to pass in the permClass to this method so that it is the MoveRowsAction.validateForm which has this workflow specific code in it instead of the ContainerManager (but that is minor).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad idea, but only marginally better, so I'm leaving as is for now.

if (!_targetContainer.hasPermission(user, InsertPermission.class))
Class<? extends Permission> permClass = InsertPermission.class;
if (schemaName != null && schemaName.equalsIgnoreCase("workflow") && queryName != null && queryName.equalsIgnoreCase("job"))
permClass = SampleWorkflowJobPermission.class;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is only called from the MoveRowsAction, there really isn't a better, workflow specific location for this code. One idea would be to pass in the permClass to this method so that it is the MoveRowsAction.validateForm which has this workflow specific code in it instead of the ContainerManager (but that is minor).

@labkey-susanh labkey-susanh merged commit ba4f276 into develop Dec 22, 2025
7 of 8 checks passed
@labkey-susanh labkey-susanh deleted the fb_moveJobs branch December 22, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants