Closed Bug 745173 Opened 12 years ago Closed 12 years ago

balrog's requirepermission decorator passes wrong thing to hasUrlPermission

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: bhearsum)

References

Details

Attachments

(1 file)

hasUrlPermission matches against a permission name, which is a templatized version of a real URL. requirepermission currently passes a non-templatized, real URL to hasUrlPermission. Because of this, permission matching doesn't work at all, except for 'admin' users.
Alright, this is the simplest way to solve this: require each view to pass its granular permission to requirpermission, rather than using the real one out of the request. I also added a couple of tests.

Another way to do this would be pass the real URL to hasUrlPermission, and have it iterate over all possible permissions and match against them. This seemed pretty painful and more expensive, though.
Attachment #614763 - Flags: review?(rail)
Attachment #614763 - Flags: review?(rail) → review+
Comment on attachment 614763 [details] [diff] [review]
fix granular permission checking

jenkins run is here: https://jenkins.mozilla.org/job/Balrog/72/
Attachment #614763 - Flags: checked-in+
This worked.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: