Closed Bug 404663 Opened 19 years ago Closed 11 years ago

aliases should be reserved for people w/ editbugs

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement)

3.1.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 6.0

People

(Reporter: timeless, Assigned: mail)

Details

Attachments

(1 file, 4 obsolete files)

newbies tend to try to file bugs with aliases with things like their name. it's really annoying and pointless. setting an alias should be reserved for people who are heavy users of bugzilla (editbugs).
Attached patch bug404663-1.patch (obsolete) — — Splinter Review
Assignee: create-and-change → simon
Status: NEW → ASSIGNED
Attachment #8585232 - Flags: review?(dkl)
In my case, we don't have the issue noted in the original description and have allowed anyone to set the alias, especially now that Bugzilla supports multiple aliases. So would prefer maybe an editaliasgroup parameter, as opposed to hardcoding it to editbugs.
No, a parameter for that doesn't make sense.
Comment on attachment 8585232 [details] [diff] [review] bug404663-1.patch Review of attachment 8585232 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl
Attachment #8585232 - Flags: review?(dkl) → review+
Flags: approval?
My 2 cents. How would folks configure Bugzilla to revert to the older workflow? I know I can add a bug_check_can_change_field hook, yet that may be too much work for some.
(In reply to Albert Ting from comment #5) > My 2 cents. How would folks configure Bugzilla to revert to the older > workflow? I know I can add a bug_check_can_change_field hook, yet that may > be too much work for some. A default installation gives everyone editbugs privileges, so by there is no change required if everyone has the editbugs privilege. As per the original request, I cannot see any reason someone that does not have editbugs would have a need to set an alias.
Fair enough. I have a QA team that tracks tickets based on aliases. I will just give them editbug privs.
I'm actually going to redo this patch. post_bug.cgi isn't the correct place for the check. It should be in Bugzilla::Bug (so it can catch RPC calls too).
Flags: approval?
Attachment #8585232 - Attachment is obsolete: true
Attachment #8585232 - Flags: review+
Attached patch bug404663-v2.patch (obsolete) — — Splinter Review
This will also prevent RPC calls from creating or updating the bug if the user does not have editbugs privileges
Attachment #8588396 - Flags: review?(dkl)
Comment on attachment 8588396 [details] [diff] [review] bug404663-v2.patch >+++ b/Bugzilla/Bug.pm >+ foreach my $field (qw(alias depends blocked)) { This bug is about aliases, not the depends and blocked fields. >+++ b/template/en/default/global/user-error.html.tmpl >+ [% DEFAULT action = "change" %] >+ You tried to [% action FILTER html %] the You cannot do that. 'action' is passed by the CGI file, and so is not localizable. You must write something like: You tried to [% IF action == "set" %] set [% ELSE %] change [% END %] the ...
Attachment #8588396 - Flags: review?(dkl) → review-
Attached patch bug404663-v3.patch (obsolete) — — Splinter Review
With two changes suggested by LpSolit. Will file a separate bug about the blocks and depends on.
Attachment #8588482 - Flags: review?(dkl)
Attachment #8588396 - Attachment is obsolete: true
Comment on attachment 8588482 [details] [diff] [review] bug404663-v3.patch >+++ b/Bugzilla/Bug.pm >+ # You need editbugs to edit these fields >+ unless (Bugzilla->user->in_group('editbugs', $product->id)) { >+ if (defined($params->{alias}) && scalar(@{$params->{alias}})) { >+ ThrowUserError('illegal_change', { field => 'alias', >+ action => 'set', >+ privs => PRIVILEGES_REQUIRED_EMPOWERED }); >+ } >+ } This check should go into _check_alias() itself. You will note that run_create_validators() doesn't do any check itself but calls validators instead. >+ my $can = $self->check_can_change_field('alias', '', $alias, \$privs); This is no longer needed with the check being in _check_alias(). Also, did you make sure that _set_global_validator() is not already called? >+++ b/template/en/default/global/user-error.html.tmpl >+ You tried to [% IF action %][% action FILTER html %][% ELSE %]change[% END %] This is not what I suggested! The point is that you cannot print 'action' directly, because this is not localizable. Please read how the "auth_failure" error message is written.
Attachment #8588482 - Flags: review?(dkl) → review-
Attached patch bug404663-v4.patch (obsolete) — — Splinter Review
(In reply to Frédéric Buclin from comment #12) > Comment on attachment 8588482 [details] [diff] [review] > bug404663-v3.patch > > >+++ b/Bugzilla/Bug.pm > This check should go into _check_alias() itself. You will note that > run_create_validators() doesn't do any check itself but calls validators > instead. Fixed. > >+ my $can = $self->check_can_change_field('alias', '', $alias, \$privs); > > This is no longer needed with the check being in _check_alias(). Also, did > you make sure that _set_global_validator() is not already called? It is still needed for remove_alias, since this doesn't go anywhere near _check_alias. > >+++ b/template/en/default/global/user-error.html.tmpl > This is not what I suggested! The point is that you cannot print 'action' > directly, because this is not localizable. Please read how the > "auth_failure" error message is written. Ah, I understand now.
Attachment #8588482 - Attachment is obsolete: true
Attachment #8588511 - Flags: review?(dkl)
Comment on attachment 8588511 [details] [diff] [review] bug404663-v4.patch >+++ b/template/en/default/global/user-error.html.tmpl >+ You tried to >+ [% IF action == "set" %] >+ set >+ [% ELSIF action == "remove" %] >+ remove >+ [% ELSE %] >+ change >+ [% END %] >+ the <strong>[% field_descs.$field FILTER html %]</strong> field So for unauthorized removals, you now get: "You tried to remove the Alias field ..." ???
Comment on attachment 8588511 [details] [diff] [review] bug404663-v4.patch Review of attachment 8588511 [details] [diff] [review]: ----------------------------------------------------------------- Works well. Just need to address LpSolits comment about the error wording and then quick r+
Attachment #8588511 - Flags: review?(dkl) → review-
Attachment #8588511 - Attachment is obsolete: true
Attachment #8635646 - Flags: review?(dkl)
Comment on attachment 8635646 [details] [diff] [review] bug404663-v5.patch Review of attachment 8635646 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl
Attachment #8635646 - Flags: review?(dkl) → review+
Flags: approval?
Target Milestone: --- → Bugzilla 6.0
Flags: relnote?
Flags: approval? → approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git fe168e2..727ba2a master -> master
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: