aboutsummaryrefslogtreecommitdiffstats
path: root/editvalues.cgi
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-01 17:34:26 -0800
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-01 17:34:26 -0800
commitb0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af (patch)
treec08cb54facdfa7f21833b6519fd0f468f5022e29 /editvalues.cgi
parent52ca02ea108a6c1d4c1ec735d3907782c2000586 (diff)
downloadbugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar
bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar.gz
bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar.bz2
bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar.xz
bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.zip
Bug 487508: Allow restricting the visibility of custom fields and values by component
r=dkl, a=mkanat
Diffstat (limited to 'editvalues.cgi')
-rwxr-xr-xeditvalues.cgi10
1 files changed, 3 insertions, 7 deletions
diff --git a/editvalues.cgi b/editvalues.cgi
index 477bf8696..b651b23c2 100755
--- a/editvalues.cgi
+++ b/editvalues.cgi
@@ -71,16 +71,12 @@ Bugzilla->user->in_group('admin') ||
my $action = trim($cgi->param('action') || '');
my $token = $cgi->param('token');
-# Fields listed here must not be edited from this interface.
-my @non_editable_fields = qw(product);
-my %block_list = map { $_ => 1 } @non_editable_fields;
-
#
# field = '' -> Show nice list of fields
#
if (!$cgi->param('field')) {
- my @field_list = grep { !$block_list{$_->name} }
- Bugzilla->get_fields({ is_select => 1 });
+ my @field_list = grep { !$_->is_abnormal }
+ Bugzilla->get_fields({ is_select => 1 });
$vars->{'fields'} = \@field_list;
$template->process("admin/fieldvalues/select-field.html.tmpl", $vars)
@@ -90,7 +86,7 @@ if (!$cgi->param('field')) {
# At this point, the field must be defined.
my $field = Bugzilla::Field->check($cgi->param('field'));
-if (!$field->is_select || $block_list{$field->name}) {
+if (!$field->is_select || $field->is_abnormal) {
ThrowUserError('fieldname_invalid', { field => $field });
}
$vars->{'field'} = $field;