[Task]: Re-implement restriction checking in API outside of permission mechanism

Open
#16,602 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Domain
api, backend

Research direction

Start by grepping for IsSubmissionAllowedFor and write_permission_classes: the permission class and the API views that list it are the two places to read, then follow the call to RestrictionChecker().is_submission_allowed(). The change moves that check into the add-on submission endpoint only, so metadata edits and source uploads stop being gated. Done means non-submission writes pass while submission is still restricted; the acceptance criteria still reads "item 1", so ask the maintainer what else must be covered.

Written by the indexing model from the issue text.

Description

Description

When the Add-on API was implemented, the restrictions checks for add-on submission (RestrictionChecker().is_submission_allowed()) were implemented as a permission, IsSubmissionAllowedFor.

But those restrictions should only apply to add-on submissions, as of now because they are implemented as a permission included in write_permission_classes they are checked for every API call writing add-on data, including modifying metadata or uploading source code, which should not be restricted.

Acceptance Criteria
  • item 1

┆Issue is synchronized with this Jira Task

Dominant language
Makefile
Stars
135
Forks
52
Avg merge
6d 18h
Merged PRs (30d)
7

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from mozilla/addons

All issues in mozilla/addons

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.