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)
Tracking
()
RESOLVED
FIXED
Bugzilla 6.0
People
(Reporter: timeless, Assigned: mail)
Details
Attachments
(1 file, 4 obsolete files)
|
4.31 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
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).
| Assignee | ||
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
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.
Comment 3•11 years ago
|
||
No, a parameter for that doesn't make sense.
Comment 4•11 years ago
|
||
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+
Updated•11 years ago
|
Flags: approval?
Comment 5•11 years ago
|
||
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.
| Assignee | ||
Comment 6•11 years ago
|
||
(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.
Comment 7•11 years ago
|
||
Fair enough. I have a QA team that tracks tickets based on aliases. I will just give them editbug privs.
| Assignee | ||
Comment 8•11 years ago
|
||
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?
| Assignee | ||
Updated•11 years ago
|
Attachment #8585232 -
Attachment is obsolete: true
Attachment #8585232 -
Flags: review+
| Assignee | ||
Comment 9•11 years ago
|
||
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 10•11 years ago
|
||
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-
| Assignee | ||
Comment 11•11 years ago
|
||
With two changes suggested by LpSolit. Will file a separate bug about the blocks and depends on.
Attachment #8588482 -
Flags: review?(dkl)
| Assignee | ||
Updated•11 years ago
|
Attachment #8588396 -
Attachment is obsolete: true
Comment 12•11 years ago
|
||
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-
| Assignee | ||
Comment 13•11 years ago
|
||
(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 14•11 years ago
|
||
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 15•11 years ago
|
||
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-
| Assignee | ||
Comment 16•11 years ago
|
||
Attachment #8588511 -
Attachment is obsolete: true
Attachment #8635646 -
Flags: review?(dkl)
Comment 17•11 years ago
|
||
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+
Updated•11 years ago
|
Flags: approval?
Target Milestone: --- → Bugzilla 6.0
Updated•11 years ago
|
Flags: relnote?
| Assignee | ||
Updated•11 years ago
|
Flags: approval? → approval+
| Assignee | ||
Comment 18•11 years ago
|
||
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.
Description
•