Skip to content

Create queries for custom views, reports and queries#7650

Open
labkey-klum wants to merge 18 commits into
developfrom
fb_customView_query
Open

Create queries for custom views, reports and queries#7650
labkey-klum wants to merge 18 commits into
developfrom
fb_customView_query

Conversation

@labkey-klum
Copy link
Copy Markdown
Contributor

Rationale

Tracking issue : https://github.com/LabKey/internal-issues/issues/1078

This PR introduces admin-only queries to replace (or create) standard LabKey table infos for : custom views, reports and queries. Details include:

  • New query schema that's available to admins only.
  • query.CustomViews table that exposes that table (shared and private views).
  • query.Queires table that exposes the querydef table.
  • core.Reports table that exposes the reports table, also restricted to admins.
  • For each table, show the "flags" bitmask column as separate boolean columns (inheritable, hidden)
  • Details and edit links should navigate to the standard pages for that object.
    • Reports : details
    • CustomViews : insert, edit
  • Implement bulk delete via checkboxes (no truncate, though).

@labkey-klum labkey-klum marked this pull request as ready for review May 7, 2026 00:16
@labkey-klum labkey-klum requested a review from labkey-adam May 7, 2026 00:16
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

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

See questions about potential cross-container issues

Comment thread core/src/org/labkey/core/query/CoreQuerySchema.java
Comment thread query/src/org/labkey/query/controllers/QueryController.java
Comment thread core/src/org/labkey/core/query/ReportsTable.java Outdated
Comment thread query/src/org/labkey/query/query/CustomViewsTable.java Outdated
Comment thread query/src/org/labkey/query/query/QueriesTable.java Outdated
Comment thread query/src/org/labkey/query/query/CustomViewsTable.java
@labkey-adam labkey-adam self-requested a review May 7, 2026 22:12
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

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

Manual testing verifies those cross-container issues are present. For example, apply a folder filter and attempt to delete a report that's outside the request folder.

@labkey-klum
Copy link
Copy Markdown
Contributor Author

Manual testing verifies those cross-container issues are present. For example, apply a folder filter and attempt to delete a report that's outside the request folder.

Give it another try, I think I've addressed all of those cross folder issues.

@labkey-klum labkey-klum requested a review from labkey-adam May 7, 2026 23:43
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

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

I think container filters are allowing rows based on read permissions (the default) when it should be admin. I think you need to override getContainerFilterClause().

@labkey-klum
Copy link
Copy Markdown
Contributor Author

Good catch, done.

@labkey-klum labkey-klum requested a review from labkey-adam May 11, 2026 21:28
@labkey-adam
Copy link
Copy Markdown
Contributor

One issue and one request:

  1. I have 16 descriptorType="chartDescriptor" reports that I can't open and I can't delete. Ideally, the QUS deleteRow() method would check for admin permissions in the owning container and delete based on just the RowId.
  2. Would be nice to add reasonable default sorts to these tables:
    • Query: folder name, schema name, query name
    • Custom View: folder name, schema name, query name, view name
    • Report: folder name, report key

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