Skip to content

[PR #442/6fe0d35a backport][0.10] Allow core.content_labeler to set/unset labels on npm packages - #443

Merged
dkliban merged 1 commit into
0.10from
patchback/backports/0.10/6fe0d35aa1bbc9535108515dd664af85c7ada0bc/pr-442
Oct 13, 2026
Merged

dkliban merged 1 commit into
0.10from
patchback/backports/0.10/6fe0d35aa1bbc9535108515dd664af85c7ada0bc/pr-442

Conversation

@patchback

@patchback patchback Bot commented Oct 13, 2026

Copy link
Copy Markdown

This is a backport of PR #442 as merged into main (6fe0d35).

Setting labels on an npm package content unit returned 403 for every non-superuser, even one holding the core.content_labeler role, because NpmPackageViewSet's access policy had no set_label/unset_label statement for the permission check to ever consult — so no role grant could authorize labeling.

Add that statement, gated on core.manage_content_labels, mirroring pulp_rpm and pulp_file. The change is additive: create/upload stay superuser-only (unchanged), so this only closes the labeling gap. Ships with a functional RBAC test (labeler succeeds, viewer-without-role gets 403, admin regression) and a towncrier fragment.

Fixes #441

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

Setting labels on an npm package content unit returned 403 for every
non-superuser, even one holding the core.content_labeler role, because
NpmPackageViewSet's access policy had no set_label/unset_label statement
for the permission check to ever consult — so no role grant could
authorize labeling.

Add that statement, gated on core.manage_content_labels, mirroring
pulp_rpm and pulp_file. The change is additive: create/upload stay
superuser-only (unchanged), so this only closes the labeling gap. Ships
with a functional RBAC test (labeler succeeds, viewer-without-role gets
403, admin regression) and a towncrier fragment.

Fixes #441

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Bryan ramos <bramos@redhat.com>
(cherry picked from commit 6fe0d35)
@dkliban
dkliban merged commit 1bd2968 into 0.10 Oct 13, 2026
8 checks passed
@dkliban
dkliban deleted the patchback/backports/0.10/6fe0d35aa1bbc9535108515dd664af85c7ada0bc/pr-442 branch October 13, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants