Skip to content

Return checkHasApiPermission as a method that can be used by other dashboards-plugins#2392

Draft
cwperks wants to merge 1 commit into
opensearch-project:mainfrom
cwperks:create-async-updater
Draft

Return checkHasApiPermission as a method that can be used by other dashboards-plugins#2392
cwperks wants to merge 1 commit into
opensearch-project:mainfrom
cwperks:create-async-updater

Conversation

@cwperks

@cwperks cwperks commented Mar 28, 2026

Copy link
Copy Markdown
Member

Description

Companion OSD core PR: opensearch-project/OpenSearch-Dashboards#11620

Example usage in a dashboards-plugin (in this case reporting): cwperks/dashboards-reporting#2

This PR returns checkHasApiPermission from security-dashboards-plugin for use by other dashboards plugins to conditionally hide/reveal from the main menu. The intended consumer of this is a new dashboards-job-scheduler plugin.

Category

Enhancement

Issues Resolved

Related to opensearch-project/security#5635, but limited in scope to hiding/revealing a menu item only if the logged in user is a security admin.

Testing

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

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…shboards-plugins

Signed-off-by: Craig Perkins <craig5008@gmail.com>
@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.57%. Comparing base (353df7d) to head (6cceacc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
public/plugin.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2392      +/-   ##
==========================================
- Coverage   71.59%   71.57%   -0.03%     
==========================================
  Files         101      101              
  Lines        3010     3011       +1     
  Branches      529      511      -18     
==========================================
  Hits         2155     2155              
- Misses        699      700       +1     
  Partials      156      156              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant