summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2020-09-16 19:49:24 +1000
committerJeff Fearn <jfearn@redhat.com>2020-09-16 19:49:24 +1000
commiteab2a286f5ce1a4a6f6aa21eb7c8827b2168c3d8 (patch)
tree338ebc58632da56743611e2a6a307d2a3f39a641
parentBug 1825819 - Consider relaxing the requirement for minor updates (diff)
downloadbugzilla-eab2a286f5ce1a4a6f6aa21eb7c8827b2168c3d8.tar.gz
bugzilla-eab2a286f5ce1a4a6f6aa21eb7c8827b2168c3d8.tar.bz2
bugzilla-eab2a286f5ce1a4a6f6aa21eb7c8827b2168c3d8.zip
Bug 1872544 - Limit effect of setpriority group to Red Hat classification
Change-Id: Ifd54ece0ed4bba30f28d5b3c9df173e547d90076
-rw-r--r--Bugzilla/Bug.pm3
-rw-r--r--extensions/RedHat/Extension.pm17
-rw-r--r--template/en/default/bug/create/create.html.tmpl5
3 files changed, 7 insertions, 18 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index d3f28f74a..5f6a5ba66 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2406,7 +2406,8 @@ sub _check_priority {
# adding setpriority check
if ( !ref $invocant
&& !Bugzilla->params->{'letsubmitterchoosepriority'}
- && !Bugzilla->user->in_group('setpriority'))
+ && !($invocant->classification eq 'Red Hat'
+ && Bugzilla->user->in_group('setpriority')))
{
$priority = Bugzilla->params->{'defaultpriority'};
}
diff --git a/extensions/RedHat/Extension.pm b/extensions/RedHat/Extension.pm
index 97afcd687..0a65ddbd1 100644
--- a/extensions/RedHat/Extension.pm
+++ b/extensions/RedHat/Extension.pm
@@ -890,25 +890,12 @@ sub bug_check_can_change_field {
# Disallow priority change if not in the setpriority group
if ( $field eq "priority"
and $new_value ne $old_value
- and not $user->in_group('setpriority'))
+ and ($bug->classification eq 'Red Hat' and not $user->in_group('setpriority')))
{
push(@$priv_results, PRIVILEGES_REQUIRED_EMPOWERED);
return;
}
- ## REDHAT EXTENSION END 406141 822804
-
- ## REDHAT EXTENSION START 495985
-# Fedora product related restrictions
-# field IN (priority) AND value_changed AND in_group(fedora_contrib) THEN ALLOW ELSE NOT-ALLOW
- if ($product->name eq 'Fedora') {
- if ($field eq 'priority' && $new_value ne $old_value) {
- if (!$user->in_group('fedora_contrib')) {
- push(@$priv_results, PRIVILEGES_REQUIRED_EMPOWERED);
- return;
- }
- }
- }
- ## REDHAT EXTENSION END 495985
+ ## REDHAT EXTENSION END 406141 822804 495985 1872544
## REDHAT EXTENSION START 502604
# Disallow a bug from being put into VERIFIED state if RHEL product and not in 'qe_staff' group
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 1440a29d4..38feedc8f 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -334,7 +334,8 @@ TUI_hide_default('attachment_text_field');
</tr>
<tr class="expert_fields">
- [% IF Param('letsubmitterchoosepriority') || user.in_group('setpriority') %]
+ [% IF Param('letsubmitterchoosepriority') || (product.classification.name == 'Red Hat' && user.in_group('setpriority')) %]
+
[% INCLUDE bug/field.html.tmpl
bug = default, field = bug_fields.priority, editable = 1,
value = default.priority %]
@@ -375,7 +376,7 @@ TUI_hide_default('attachment_text_field');
<tbody class="expert_fields">
<tr>
- [% IF Param('usetargetmilestone') && (Param('letsubmitterchoosemilestone') || user.in_group('setpriority')) %]
+ [% IF Param('usetargetmilestone') && (Param('letsubmitterchoosemilestone') || (product.classification.name == 'Red Hat' && user.in_group('setpriority'))) %]
[% INCLUDE select field = bug_fields.target_milestone %]
[% ELSE %]
<td colspan="2">&nbsp;</td>