NameError: Unauthorized: when ~registry user tries to edit feature

Bug #651852 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Benji York

Bug Description

Silly mistake:
https://edge.launchpad.net/+feature-rules
tries to let all users read but only admin users write, but it has, at least, a missing import statement causing

Module zope.formlib.form, line 606, in success
return self.success_handler(self.form, self, data)
Module lp.services.features.browser.edit, line 63, in change_action
raise Unauthorized()
NameError: global name 'Unauthorized' is not defined<br />

https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-1734ED352

and I guess a missing test too.

I don't think this needs to block continued deployment though.

Related branches

Martin Pool (mbp)
summary: - NameError: Unauthorized: when unauthorized user triest to edit feature
+ NameError: Unauthorized: when ~registry user tries to edit feature
tags: added: oops
Gary Poster (gary)
Changed in launchpad-foundations:
status: Confirmed → Triaged
Revision history for this message
Martin Pool (mbp) wrote :

Some suggestions from canonical-launchpad, to make the overall form work better:

See BranchEditView.setUpFields() in lp.code.browser.Branch.py for an
example of hiding fields depending on a user's team permission.

If you want to make fields readonly instead of hiding them, set the
"for_display" attribute to True - see
BranchMergeProposalEnqueueView.setUpFields() in
lp.code.browser.branchmergeproposal.py for an example.

Basically, just override the setUpFields() method in your view class and
do whatever you need to in there.

---

There is a permission that you can add to the action I believe. This will make sure the button isn't there if the person doesn't have that permission.

Revision history for this message
Martin Pool (mbp) wrote :
Changed in launchpad:
status: Triaged → In Progress
assignee: Martin Pool (mbp) → nobody
Benji York (benji)
Changed in launchpad:
assignee: nobody → Benji York (benji)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
Changed in launchpad:
milestone: none → 11.01
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Benji York (benji)
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
importance: Medium → Critical
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.