mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
126 stars 41 forks source link

Rename / split check_addon_ownership() #1882

Open diox opened 2 years ago

diox commented 2 years ago

In https://github.com/mozilla/addons/issues/8763 most acl checks were renamed and had their parameters changed to receive a user instead of a request to be more consistent.

check_addon_ownership() was not touched because it's a bigger issue, but we should look into it. The main problem is that its name is poor: it checks ownership by default, but also allows users with a specific permissions, or even regular non-owner authors if a parameter is passed. So it can't just be renamed to is_addon_owner() or something like that... Maybe its functionality should be split ?

┆Issue is synchronized with this Jira Task

eviljeff commented 2 years ago

it should be broken down into smaller functions imo, and/or renamed. For example the default is to allow anyone with edit permission too, so it could be can_edit_addon or something, and then something more specific in the other case. (I've not looked into everywhere it's used though)

KevinMind commented 5 months ago

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDSRV-98