Closed
Bug 830330
Opened 12 years ago
Closed 12 years ago
flags should honour check_can_change_field()
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: glob, Assigned: mail)
References
Details
Attachments
(2 files, 1 obsolete file)
1.55 KB,
patch
|
dkl
:
review+
LpSolit
:
review-
|
Details | Diff | Splinter Review |
836 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
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);
> }
![]() |
Assignee | |
Comment 1•12 years ago
|
||
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?
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+
![]() |
||
Comment 3•12 years ago
|
||
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-
![]() |
||
Comment 4•12 years ago
|
||
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.
![]() |
Assignee | |
Updated•12 years ago
|
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 → ---
minor change to allow anyone to set flags.
Attachment #703288 -
Attachment is obsolete: true
Attachment #710085 -
Flags: review?(dkl)
Comment 8•12 years ago
|
||
Comment on attachment 710085 [details] [diff] [review]
patch v2
r=dkl
Attachment #710085 -
Flags: review?(dkl) → review+
Updated•12 years ago
|
Flags: approval?
Flags: approval4.4?
![]() |
||
Updated•12 years ago
|
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 ago → 12 years ago
Resolution: --- → FIXED
![]() |
||
Comment 10•12 years ago
|
||
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-
![]() |
||
Updated•12 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
![]() |
||
Comment 11•12 years ago
|
||
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+
![]() |
||
Updated•12 years ago
|
Summary: flags should honour bug_check_can_change_field → flags should honour check_can_change_field()
![]() |
||
Comment 12•12 years ago
|
||
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 ago → 12 years ago
Keywords: relnote
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•