pulp / pulp/pulpcore

Allow for non-NamedModelViewsets to be added to the RBAC system.

Open
#5,500 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

Currently only NamedModelViewSet (NMV) can be fully added to Pulp's RBAC system. The ability to customize the AccessPolicy, define default roles and use object creation hooks are restricted to NMVs. This is due to the post-migrate hooks at startup that only look through registered NMVs.

https://github.com/pulp/pulpcore/blob/1f2864124d333f95ef23f5e5f0d8a8b616088617/pulpcore/app/apps.py#L131-L136

Also, our permission class AccessPolicyFromDB is expecting NMVs in order to work.

https://github.com/pulp/pulpcore/blob/1f2864124d333f95ef23f5e5f0d8a8b616088617/pulpcore/app/access_policy.py#L25-L29

If we want to add RBAC to non-NMVs (like orphan cleanup #1924), we will need to redesign portions of this system to make it easier to add support without turning every view into a NMV.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the post-migrate hooks in pulpcore/app/apps.py and AccessPolicyFromDB in pulpcore/app/access_policy.py, then trace their assumptions about NamedModelViewSet. Define how non-NamedModelViewSets should support custom AccessPolicy, default roles, and object creation hooks. Done means RBAC can be added to a non-NMV such as orphan cleanup without requiring every view to become an NMV.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authorization, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.