Closed Bug 938763 Opened 7 years ago Closed 7 years ago

Ember.show no longer works since the bug_check_can_change_field hook added to TrackingFlags ext

Categories

(bugzilla.mozilla.org :: API, defect)

Production
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dkl, Assigned: dkl)

References

Details

Attachments

(1 file)

When accessing the Ember.show API method, when a tracking flag is processed the following error occurs:

{
   "code" : 32000,
   "error" : true,
   "message" : "You tried to update the status of the tracking flag 'cf_tracking_firefox25'. Only a user with the required permissions may make this change."
}

Example URL:
https://bugzilla.mozilla.org/rest/ember/show/856410

Will work on a patch.

dkl
Attached patch 938763_1.patchSplinter Review
-        # we can't return PRIVILEGES_REQUIRED_EMPOWERED as that has different
-        # conditions (eg. it assumes reporters can always change fields).
-        ThrowUserError('tracking_flags_change_denied',
-                       { flag => $flag, value => $new_value });
+        push @$priv_results, PRIVILEGES_REQUIRED_EMPOWERED;

I was able to fix this issue by applying the above change to 4.2-dev. Can you reverify in your testing whether your comment is still valid. I was not able to 
see the privileged values in the tracking flag drop downs when logged in as a non-empowered user and also one that was the reporter. Looking at Bugzilla::Bug::check_can_change_field, the reporter portion does not come until after the hooks are processed so being the reporter would not automatically give the user access to all tracking flag values.

dkl
Attachment #832468 - Flags: review?(glob)
Duplicate of this bug: 930376
Comment on attachment 832468 [details] [diff] [review]
938763_1.patch

r=glob with the obvious debugging removed.

i was hitting the generic error which states that as a bug reporter you can change the field, however i'm unable to replicate that issue now.
Attachment #832468 - Flags: review?(glob) → review+
Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bmo/4.2
modified extensions/TrackingFlags/Extension.pm
Committed revision 9145.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.