Skip to content

feat: Add domain-admin content list endpoint - #8084

Draft
CryptoRodeo wants to merge 1 commit into
pulp:mainfrom
CryptoRodeo:feat/domain-admin-content-viewset
Draft

feat: Add domain-admin content list endpoint#8084
CryptoRodeo wants to merge 1 commit into
pulp:mainfrom
CryptoRodeo:feat/domain-admin-content-viewset

Conversation

@CryptoRodeo

@CryptoRodeo CryptoRodeo commented Sep 10, 2026

Copy link
Copy Markdown

🚧 work in progress 👷‍♂️

Still need to confirm some more details...


Adds a new list-only viewset, ContentDomainViewSet, served at /pulp/api/v3/content/domains/.

Unlike the repository-scoped content list, it returns every content unit in the current domain (including content in no repository), gated by domain-level core.view_content via RBAC.

The endpoint bypasses repository-based queryset scoping on purpose: the access policy already restricts it to domain administrators and get_queryset has already filtered to the request's domain.

A locked role, core.content_domain_viewer, grants the required permission.

This replaces the earlier approach of granting content uploaders object-level ownership roles, keeping the permission surface tight and reusable for other domain-admin operations.

📜 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

Adds a new list-only viewset, ContentDomainViewSet, served at
`/pulp/api/v3/content/domains/`.

Unlike the repository-scoped content list, it returns every content unit in the current domain (including content in no repository), gated by domain-level `core.view_content` via RBAC.

The endpoint bypasses repository-based queryset scoping on purpose: the access policy already restricts it to domain administrators and get_queryset has already filtered to the request's domain.

A locked role, core.content_domain_viewer, grants the required permission.

This replaces the earlier approach of granting content uploaders object-level ownership roles, keeping the permission surface tight and reusable for other domain-admin operations.

Signed-off-by: Bryan ramos <bramos@redhat.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pulp_label_select, works the same as the standard content list.
"""

endpoint_name = "content/domains"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if we put this under domains - so /domains/ is "list all domains", and /domains/content/ is "list content for domains"? (or even {domain_href}content/, which is "list content for this domain"?)

That would also suggest this be "DomainContentViewSet", and it would live in domain.py instead of content.py. My thinking here, is that this would reinforce that this is a property of domains, more than a property of "content in the instance". wdyt?

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