Skip to content

Show only accessible links in sidepanel for new manage Jenkins UI - #27228

Open
mawinter69 wants to merge 1 commit into
jenkinsci:masterfrom
mawinter69:managementlink-permissions
Open

Show only accessible links in sidepanel for new manage Jenkins UI#27228
mawinter69 wants to merge 1 commit into
jenkinsci:masterfrom
mawinter69:managementlink-permissions

Conversation

@mawinter69

Copy link
Copy Markdown
Contributor

fixes #27227

Introduce a new method hasRequiredPermission in ManagementLink that defaults to using getRequiredPermission similar to the the permission checks for administrative monitors
Plugins should override this (e.g. Casc plugin)

Testing done

Interactive testing

Screenshots (UI changes only)

Before

image

After

image

Proposed changelog entries

  • Show only accessible links in sidepanel for new manage Jenkins UI

Proposed changelog category

/label bug

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

fixes jenkinsci#27227

Introduce a new method `hasRequiredPermission` that defaults to using
`getRequiredPermission` similar to the the permission checks for
administrative monitors
@comment-ops-bot comment-ops-bot Bot added the bug For changelog: Minor bug. Will be listed after features label Aug 11, 2026
@mawinter69

Copy link
Copy Markdown
Contributor Author

The spotbugs issues is pre-existing. Not introduced by this change

@preetham-18-developer

Copy link
Copy Markdown

hey @mawinter69 , @SInCE TODO should be replaced with the target Jenkins core version before merge. Based on the current development version, this should be @SInCE 2.577.

@MarkEWaite

Copy link
Copy Markdown
Contributor

hey @mawinter69 , @since TODO should be replaced with the target Jenkins core version before merge. Based on the current development version, this should be @SInCE 2.577.

No, the @since TODO placeholders are updated after the first Jenkins release that includes the API. That way we're not trying to predict the future in the pull request.

@preetham-18-developer

Copy link
Copy Markdown

No, the @since TODO placeholders are updated after the first Jenkins release that includes the API. That way we're not trying to predict the future in the pull request.

Thanks for the clarification! Understood — I wasn't aware that @SInCE TODO is intentionally updated after the first release containing the API. I'll withdraw that comment.

@preetham-18-developer

Copy link
Copy Markdown

Could we add an automated test covering the permission filtering introduced here? In particular, it would be useful to verify that a user with Overall/Read + Job/Read does not see AboutJenkins, ConfigureLink, or SystemInfoLink, while StatisticsLink remains visible. This would help prevent regressions in the new hasRequiredPermission() behaviour.

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

Labels

bug For changelog: Minor bug. Will be listed after features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Management links are shown for pages the user has no access to with new manage Jenkins UI

3 participants