Summary
MavenRemoteViewSet, MavenRepositoryViewSet, and MavenDistributionViewSet don't define a DEFAULT_ACCESS_POLICY, unlike mature plugins (pulp_rpm, pulp_file, pulp_deb, ...). As a result:
- No
AccessPolicy row is ever created in the database for maven's viewsets — confirmed via GET /pulp/api/v3/access_policies/, which returns zero results for any viewset name containing maven, versus several each for rpm/file/deb.
pulp role list --name-contains maven returns [] — no locked roles ship with the plugin at all.
- Because customizing an access policy only works via
PUT/PATCH /access_policies/{id}/ on an existing row (there's no POST to create one), there is no way — via the API, RBAC, or any documented mechanism — to authorize a non-superuser for these endpoints.
Steps to reproduce
- On a Pulp instance with
pulp_maven installed, create a non-superuser user and add them to a group.
- Create a custom Role bundling
maven.view_mavenremote, maven.add_mavenremote, etc., and grant it to the group model-wide (POST /groups/{href}roles/ with content_object: null).
- Confirm the grant is present via
GET /groups/{href}roles/.
- As the non-superuser user, call
GET /pulp/api/v3/remotes/maven/maven/ (or pulp maven remote list).
- Actual:
Error: Operation remotes_maven_maven_list is not authorized.
- The identical request as an actual superuser (
admin) succeeds.
Root cause
MavenRemoteViewSet (etc.) inherit directly from pulpcore's base RemoteViewSet/RepositoryViewSet/DistributionViewSet without overriding DEFAULT_ACCESS_POLICY. Compare to e.g. pulp_rpm's RpmRemoteViewSet, which explicitly maps actions (list, create, sync, ...) to permission checks (has_model_or_domain_or_obj_perms:rpm.view_rpmremote, etc.) and ships locked roles (rpm.rpmremote_owner/_creator/_viewer) via a data migration. pulp_maven never shipped either, so the viewset falls back to whatever pulpcore's base class does with no registered access policy, which in practice requires superuser status.
Expected behavior
A non-superuser granted the appropriate permission via a Role should be authorized, consistent with every other Pulp content plugin.
Environment
- pulpcore 3.105.7
- pulp-maven 0.12.0
Additional context
The identical gap exists in pulp_npm and pulp_hugging_face — none of the three define DEFAULT_ACCESS_POLICY on any viewset. Filing companion reports in each repo since root cause and fix (mirroring pulp_rpm/pulp_file's pattern) look identical across all three. Happy to test a patch if a maintainer can confirm the intended locked-role naming convention for maven.
Summary
MavenRemoteViewSet,MavenRepositoryViewSet, andMavenDistributionViewSetdon't define aDEFAULT_ACCESS_POLICY, unlike mature plugins (pulp_rpm,pulp_file,pulp_deb, ...). As a result:AccessPolicyrow is ever created in the database for maven's viewsets — confirmed viaGET /pulp/api/v3/access_policies/, which returns zero results for any viewset name containingmaven, versus several each forrpm/file/deb.pulp role list --name-contains mavenreturns[]— no locked roles ship with the plugin at all.PUT/PATCH /access_policies/{id}/on an existing row (there's noPOSTto create one), there is no way — via the API, RBAC, or any documented mechanism — to authorize a non-superuser for these endpoints.Steps to reproduce
pulp_maveninstalled, create a non-superuser user and add them to a group.maven.view_mavenremote,maven.add_mavenremote, etc., and grant it to the group model-wide (POST /groups/{href}roles/withcontent_object: null).GET /groups/{href}roles/.GET /pulp/api/v3/remotes/maven/maven/(orpulp maven remote list).Error: Operation remotes_maven_maven_list is not authorized.admin) succeeds.Root cause
MavenRemoteViewSet(etc.) inherit directly from pulpcore's baseRemoteViewSet/RepositoryViewSet/DistributionViewSetwithout overridingDEFAULT_ACCESS_POLICY. Compare to e.g.pulp_rpm'sRpmRemoteViewSet, which explicitly maps actions (list,create,sync, ...) to permission checks (has_model_or_domain_or_obj_perms:rpm.view_rpmremote, etc.) and ships locked roles (rpm.rpmremote_owner/_creator/_viewer) via a data migration.pulp_mavennever shipped either, so the viewset falls back to whatever pulpcore's base class does with no registered access policy, which in practice requires superuser status.Expected behavior
A non-superuser granted the appropriate permission via a Role should be authorized, consistent with every other Pulp content plugin.
Environment
Additional context
The identical gap exists in
pulp_npmandpulp_hugging_face— none of the three defineDEFAULT_ACCESS_POLICYon any viewset. Filing companion reports in each repo since root cause and fix (mirroringpulp_rpm/pulp_file's pattern) look identical across all three. Happy to test a patch if a maintainer can confirm the intended locked-role naming convention formaven.