Skip to content

Add createAsyncUpdater to application_service to add a hook to conditionally reveal menu items#11620

Open
cwperks wants to merge 1 commit intoopensearch-project:mainfrom
cwperks:admin-page
Open

Add createAsyncUpdater to application_service to add a hook to conditionally reveal menu items#11620
cwperks wants to merge 1 commit intoopensearch-project:mainfrom
cwperks:admin-page

Conversation

@cwperks
Copy link
Copy Markdown
Member

@cwperks cwperks commented Mar 28, 2026

Description

Companion PRs:

This PR adds a new extension point to application_service called createAsyncUpdater. If defined, this updater would return a simple true or false to indicate whether the menu item should be revealed.

See companion PRs for usage.

Use case: Menu items that should only appear to the security admin. security-dashboards-plugin already has logic to conditionally show the Security menu item (code ref). This will allow other plugins to follow similar behavior and conditionally display according to whether the logged in user has security admin permissions. A consumer of this would be a new job-scheduler dashboards plugin limited to cluster administrator.

Issues Resolved

Related to opensearch-project/security#5635, but limited in scope.

With the companion PRs this would simply be used for a toggle to show a menu item if the logged in user is a security admin

Used the reporting plugin for testing, but ultimately plan to use it for opensearch-project/.github#393

Screenshot

Will add short recording

Testing the changes

See companion PRs:

  1. Login as admin and see all menu items
  2. Login as non-admin (i.e. readall:readall) and verify the menu items do not appear for plugins that use the updater and should only be displayed for admins

Changelog

feat: Add createAsyncUpdater to application_service to add a hook to conditionally reveal menu items

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

…ionally reveal menu items

Signed-off-by: Craig Perkins <craig5008@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@github-actions
Copy link
Copy Markdown
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant