Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-68208] "Create a job" button is not hidden to users lacking permission. #6689

Merged
merged 3 commits into from Jul 7, 2022

Conversation

frankie139506
Copy link
Contributor

@frankie139506 frankie139506 commented Jun 23, 2022

See JENKINS-68208.

Before: (User without Job/Create permission can see the button)
Before

After: (User without Job/Create permission can't see the button now)
After

Proposed changelog entries

  • Don't display the job creation button to a user without Job/Create permission.

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change) and are in the imperative mood. Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadoc, as appropriate.
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@mention

Maintainer checklist

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

  • There are at least 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 does not block the change
  • Changelog entries in the PR 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, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@NotMyFault NotMyFault added bug For changelog: Minor bug. Will be listed after features web-ui The PR includes WebUI changes which may need special expertise needs-security-review Awaiting review by a security team member labels Jun 23, 2022
@NotMyFault NotMyFault requested a review from a team June 23, 2022 23:11
Copy link
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

This change is incorrect.

Authorization strategies like Project-based Matrix Authorization give users fine-grained control over who is allowed to create items where. To create an item in a folder, you only need permission to create an item inside that folder, not on the root level. That case would be broken by this change.

The problem here is probably related to the view owner being the user (for "My Views"), and a user has full permissions on itself to freely configure all properties. This seems to be a bad interaction not considered by the Groovy view, but the fix would be different from this change.

Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
@frankie139506
Copy link
Contributor Author

This change is incorrect.

Authorization strategies like Project-based Matrix Authorization give users fine-grained control over who is allowed to create items where. To create an item in a folder, you only need permission to create an item inside that folder, not on the root level. That case would be broken by this change.

The problem here is probably related to the view owner being the user (for "My Views"), and a user has full permissions on itself to freely configure all properties. This seems to be a bad interaction not considered by the Groovy view, but the fix would be different from this change.

Thanks for your suggestion.

@daniel-beck daniel-beck self-requested a review July 5, 2022 11:15
@daniel-beck daniel-beck added security-approved @jenkinsci/core-security-review reviewed this PR for security issues and removed needs-security-review Awaiting review by a security team member labels Jul 5, 2022
@NotMyFault NotMyFault added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Jul 5, 2022
@NotMyFault
Copy link
Member

This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@timja timja merged commit 72e1353 into jenkinsci:master Jul 7, 2022
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 ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback security-approved @jenkinsci/core-security-review reviewed this PR for security issues web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
5 participants