restrict /policy PATCH to non-themes#22564
Conversation
93c0da8 to
2f90dcd
Compare
|
@eviljeff how do I create a new theme locally?
|
Either download one from prod and submit it as a new add-on, or use the theme wizard to create one with whatever random image you have lying around. |
|
Also FWIW I will try testing this using the swagger docs. http://olympia.test/api/v5/swagger/#/addons/addons_addon_eula_policy_partial_update Note: Interesting swagger is not groking the serializer TranslationField correctly, expecting a string. Should be fixed at some point. For now used Curl to update an addon's policy, once I find out how to upload a theme I'll test the opposite case. curl -X PATCH http://olympia.test/api/v5/addons/addon/97/eula_policy/ |
KevinMind
left a comment
There was a problem hiding this comment.
Code looks good. One question, " like devhub does." this indicates that devhub is also limiting access to the endpoint? Thought the validator you added doesn't seem to be referenced by devhub code. Does this mean we have two mechanisms for access control or can you expand on what you mean by the quoted statement.
Confirmed themese not able to patch, extension was able to patch.
|
Filed mozilla/addons#14958 |
Devhub has a form to set/edit privacy policy and EULA (under ownership), and we don't show those fields for themes. |

Fixes: mozilla/addons#14937
Description
Themes can't have EULA or privacy policies, so restrict the endpoint to non-themes, like devhub does.
Context
PATCH for /policy was added recently.
Testing
Checklist
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository.