Skip to content

Validation of script report permissions via study controller actions. - #8252

Merged
labkey-klum merged 7 commits into
developfrom
fb_study_script_report
Nov 3, 2026
Merged

labkey-klum merged 7 commits into
developfrom
fb_study_script_report

Conversation

@labkey-klum

@labkey-klum labkey-klum commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

https://github.com/LabKey/internal-issues/issues/1682

Validation for study-reports.saveReport.view to ensure standard checks are performed for script based reports.

Related Pull Requests

LabKey/testAutomation#3273

errors.add(new SimpleValidationError("Unable to find a configured script engine for this report."));
return;
}
extension = engine.getFactory().getExtensions().getFirst();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ReportUtil just uses extension to find ScriptEngine, we could just pass this in)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that seems cleaner


if (descriptor.isNew())
{
validateScriptCreation(context, report, errors);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why inside isNew() check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For existing reports, the permission check happens inside of canEdit

@labkey-matthewb

Copy link
Copy Markdown
Contributor

Suggest updating study ReportController only allow saving StudyQueryReport and StudyCrosstabReport (and not allow url binding to change report type on edit).

@labkey-klum

Copy link
Copy Markdown
Contributor Author

Suggest updating study ReportController only allow saving StudyQueryReport and StudyCrosstabReport (and not allow url binding to change report type on edit).

Good idea, done. FYI, StudyCrosstabReport goes through a different action so it's only StudyQueryReport that uses SaveReport via CreateQueryReport.

@labkey-matthewb labkey-matthewb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve, but check with Josh/Adam about target branch.

@labkey-klum
labkey-klum merged commit 6f440f7 into develop Nov 3, 2026
10 checks passed
@labkey-klum
labkey-klum deleted the fb_study_script_report branch November 3, 2026 21:00
labkey-klum added a commit to LabKey/testAutomation that referenced this pull request Nov 3, 2026
## Rationale
LabKey/internal-issues#1682

Regression test to verify that `study-reports.saveReport.view` handles
permission checking properly for script reports.

## Related Pull Requests
LabKey/platform#8252
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.

2 participants