Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to control editing STATUS

52 views
Skip to first unread message

Xia, Richard

unread,
Oct 15, 2009, 10:24:47 PM10/15/09
to support-...@lists.mozilla.org
We have a requirement to precisely control editing STATUS, that is, the Assignee who's not in editbugs group has permission to change STAUTS from ASSIGNED to RESOLVED, but has no permission to close the bug.

Now, the Assignee can close the bug, we don't know how to suppress it. Please help us. Thanks.

Max Kanat-Alexander

unread,
Oct 16, 2009, 5:55:34 PM10/16/09
to support-...@lists.mozilla.org
On 10/15/2009 07:24 PM, Xia, Richard wrote:
> We have a requirement to precisely control editing STATUS, that is, the Assignee who's not in editbugs group has permission to change STAUTS from ASSIGNED to RESOLVED, but has no permission to close the bug.
>
> Now, the Assignee can close the bug, we don't know how to suppress it. Please help us. Thanks.

Edit the code of Bugzilla::Bug::check_can_change_field.

-Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.

Xia, Richard

unread,
Oct 20, 2009, 9:04:36 AM10/20/09
to support-...@lists.mozilla.org
thanks for the hint.
I edited the code of Bugzilla::Bug::check_can_change_field,and it does prevent ordinary assignee from changing bug_status from RESOLVED to CLOSE.(when the assignee tries to commit,the web page will display a message that he has no permission). However,editing Bugzilla::Bug::check_can_change_field seems that it can't stop the assignee selecting CLOSE status on page /show_bug.cgi?id=1(the number 1 is an example),although he will fail when he click the commit button.

I have read the code snippet in /template/en/default/bug/edit.html.tmpl .the display of the select item on page should be stopped,but it doesn't.
I can't figure out why it does'nt work.By the way, my way to editing the Bugzilla::Bug::check_can_change_field is checking whether $self->{“bug_status”} eq "ASSIGNED" && $field eq "bug_status" is true.
Any help is appreciated.


the snippte in file /template/en/default/bug/edit.html.tmpl
[%############################################################################%]
[%# Block for SELECT fields #%]
[%############################################################################%]

[% BLOCK select %]
<td>
[% IF bug.check_can_change_field(selname, 0, 1) AND bug.choices.${selname}.size > 1 %]
<select id="[% selname %]" name="[% selname %]">
[% FOREACH x = bug.choices.${selname} %]
<option value="[% x FILTER html %]"
[% " selected" IF x == bug.${selname} %]>[% x FILTER html %]
</option>
[% END %]
</select>
[% ELSE %]
<input type="hidden" id="[% selname %]" name="[% selname %]" value="[% bug.${selname} FILTER html %]">
[% bug.${selname} FILTER html %]
[% END %]
</td>
[% END %]

________________________________________
From: support-bugzilla-bounces+richard.xia=chn.fuji...@lists.mozilla.org [support-bugzilla-bounces+richard.xia=chn.fuji...@lists.mozilla.org] On Behalf Of Max Kanat-Alexander [mka...@bugzilla.org]
Sent: Saturday, October 17, 2009 5:55 AM
To: support-...@lists.mozilla.org
Subject: Re: how to control editing STATUS

_______________________________________________
support-bugzilla mailing list
support-...@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put support-...@lists.mozilla.org in the To: field when you reply.

Max Kanat-Alexander

unread,
Oct 21, 2009, 8:07:04 PM10/21/09
to support-...@lists.mozilla.org
On 10/20/2009 06:04 AM, Xia, Richard wrote:
> I edited the code of Bugzilla::Bug::check_can_change_field,and it does prevent ordinary assignee from changing bug_status from RESOLVED to CLOSE.(when the assignee tries to commit,the web page will display a message that he has no permission). However,editing Bugzilla::Bug::check_can_change_field seems that it can't stop the assignee selecting CLOSE status on page /show_bug.cgi?id=1(the number 1 is an example),although he will fail when he click the commit button.

Right, that's because in Bugzilla 3.4, the code doesn't check if people
can change from one value to another as far as displaying values goes.
You'll have to edit template/en/default/bug/knob.html.tmpl accordingly
for the permissions that you want to enforce there.

0 new messages