Skip to content

Add Addons:ApiView and AddonsApiViewUnlisted & rework AddonViewSet permissions#25187

Open
eviljeff wants to merge 1 commit into
mozilla:masterfrom
eviljeff:16318-view-all-addons-api-permission
Open

Add Addons:ApiView and AddonsApiViewUnlisted & rework AddonViewSet permissions#25187
eviljeff wants to merge 1 commit into
mozilla:masterfrom
eviljeff:16318-view-all-addons-api-permission

Conversation

@eviljeff

@eviljeff eviljeff commented Jul 24, 2026

Copy link
Copy Markdown
Member

Fixes mozilla/addons#16318

Description

Replaces use of Addons:Review and Addons:ReviewUnlisted permissions in the API with dedicated Addons:ApiView and Addons:ApiViewUnlisted permissions, plus some refactoring to simplify the places we define permissions.

Context

Also replaces ReviewerTools:View and ReviewTools:ViewUnlisted too, but adds a migration so all existing groups containing those permissions get the dedicated replacements, so there's no breakage to Operations usage.

I took the opportunity to replace our custom AllOf and AnyOf classes with boolean logic, and break down our complex permission classes.

The issue asked for a single permission, but these permissions match our setup, and as users are added to groups that contain permissions, not assigned individual permissions, it doesn't make a difference.

Naming? Should they be Api:AddonView rather than Addons:ApiView? Some other naming?

Testing

  • Run the migrations (happens automatically with make up
  • Add yourself to a reviewer group that has Addons:Review in django admin/shell
    • that group should also have Addons:ApiView too from the migration
  • verify you can access the detail page in local frontend for a non-public add-on
  • check the /versions page too

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@eviljeff
eviljeff force-pushed the 16318-view-all-addons-api-permission branch from 7a0ccea to c83c6f9 Compare July 24, 2026 11:19
@eviljeff
eviljeff force-pushed the 16318-view-all-addons-api-permission branch from c83c6f9 to 1132602 Compare July 24, 2026 12:02
@eviljeff
eviljeff requested review from a team and diox and removed request for a team July 24, 2026 12:04
@eviljeff
eviljeff marked this pull request as ready for review July 24, 2026 12:04
@eviljeff eviljeff changed the title Add Addons:ApiView and AddonsApiViewUnlisted & rework ViewSet permissions Add Addons:ApiView and AddonsApiViewUnlisted & rework AddonViewSet permissions Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addons:ViewAll Permission

1 participant