Closed Bug 830330 Opened 12 years ago Closed 12 years ago

flags should honour check_can_change_field()

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: glob, Assigned: mail)

References

Details

Attachments

(2 files, 1 obsolete file)

if an extension uses the bug_check_can_change_field hook to disable editing of fields, flags are still displayed as editable, and can be set/cleared/etc. eg. > sub bug_check_can_change_field { > push(@$priv_results, PRIVILEGES_REQUIRED_EMPOWERED); > }
Attached patch v1 patch (obsolete) — Splinter Review
Turns out we didn't have checks in Bugzilla::Flag either, so I've added this is part of the patch. Regards, Hugo
Attachment #703288 - Flags: review?
Assignee: general → hugo.seabrook
Comment on attachment 703288 [details] [diff] [review] v1 patch r=glob this patch doesn't allow for extensions to control flag editability on a per-flag basis, however if that's required it can be added at a later date.
Attachment #703288 - Flags: review? → review+
Flags: approval?
Comment on attachment 703288 [details] [diff] [review] v1 patch A powerless user who is not the reporter can no longer edit/request flags, even for flags which have no group restrictions set on them.
Attachment #703288 - Flags: review-
I would tend to wontfix this bug, because flags are already controlled by groups. And uneditable bugs are already controlled by the CANEDIT bit set at the product level.
Severity: normal → minor
Status: NEW → ASSIGNED
Component: Bugzilla-General → Creating/Changing Bugs
Flags: approval?
OS: Mac OS X → All
Hardware: x86 → All
(In reply to Frédéric Buclin from comment #4) > I would tend to wontfix this bug, because flags are already controlled by > groups. And uneditable bugs are already controlled by the CANEDIT bit set at > the product level. currently extensions can use the bug_check_can_change_field hook to selectively allow/block editing of each field except for flags. while groups and canedit exists, neither are suitable for hooking via extensions, and i don't see why flags should be treated differently from any other field.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
i don't think this should be WONTFIX'ed, reopening. hugo, i'm happy to address frederic's points in comment 4 if you don't want to continue with this bug.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Attached patch patch v2Splinter Review
minor change to allow anyone to set flags.
Attachment #703288 - Attachment is obsolete: true
Attachment #710085 - Flags: review?(dkl)
Comment on attachment 710085 [details] [diff] [review] patch v2 r=dkl
Attachment #710085 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval4.4?
Status: REOPENED → ASSIGNED
Flags: approval?
Flags: approval4.4?
Flags: approval4.4+
Flags: approval+
Keywords: relnote
Target Milestone: --- → Bugzilla 4.4
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/4.4/ modified Bugzilla/Bug.pm modified Bugzilla/Flag.pm modified template/en/default/flag/list.html.tmpl Committed revision 8516. Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Bug.pm modified Bugzilla/Flag.pm modified template/en/default/flag/list.html.tmpl Committed revision 8575.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Comment on attachment 710085 [details] [diff] [review] patch v2 >=== modified file 'template/en/default/flag/list.html.tmpl' >-[% IF user.id AND !read_only_flags %] >+[% IF user.id && !read_only_flags && bug.check_can_change_field('flagtypes.name', 0, 1) %] When creating a new bug, the bug object doesn't exist yet and so bug.check_can_change_field() is always false, meaning that you can no longer set/request flags on bug creation.
Attachment #710085 - Flags: review-
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch fix bustageSplinter Review
I'm fixing bustage using this patch, but this means that check_can_change_field() isn't called on bug creation anymore. Approving this patch myself as module owner. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified template/en/default/flag/list.html.tmpl Committed revision 8581. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/ modified template/en/default/flag/list.html.tmpl Committed revision 8521.
Attachment #714856 - Flags: review+
Summary: flags should honour bug_check_can_change_field → flags should honour check_can_change_field()
Added to relnotes for 4.4rc2. File a separate bug if you want a hook to control flags on bug creation.
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Keywords: relnote
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: