aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-08-12 06:45:07 +0000
committermkanat%bugzilla.org <>2006-08-12 06:45:07 +0000
commitcc69d134483d1e10423475735b1084535dd075b7 (patch)
tree4e440861d3302bdacea97fd64ae477acf12bd6d8 /show_bug.cgi
parentBug 310753: editflagtypes.cgi page fails w3 validation - Patch by victory(_RS... (diff)
downloadbugzilla-cc69d134483d1e10423475735b1084535dd075b7.tar.gz
bugzilla-cc69d134483d1e10423475735b1084535dd075b7.tar.bz2
bugzilla-cc69d134483d1e10423475735b1084535dd075b7.zip
Bug 348057: Move the checks for bug visibility out of Bugzilla::Bug->new
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
Diffstat (limited to 'show_bug.cgi')
-rwxr-xr-xshow_bug.cgi12
1 files changed, 9 insertions, 3 deletions
diff --git a/show_bug.cgi b/show_bug.cgi
index a23621d78..fda4d1503 100755
--- a/show_bug.cgi
+++ b/show_bug.cgi
@@ -35,7 +35,7 @@ my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
my $vars = {};
-Bugzilla->login();
+my $user = Bugzilla->login();
# Editable, 'single' HTML bugs are treated slightly specially in a few places
my $single = !$cgi->param('format')
@@ -60,7 +60,7 @@ if ($single) {
# Its a bit silly to do the validation twice - that functionality should
# probably move into Bug.pm at some point
ValidateBugID($id);
- push @bugs, new Bugzilla::Bug($id, Bugzilla->user->id);
+ push @bugs, new Bugzilla::Bug($id);
if (defined $cgi->param('mark')) {
foreach my $range (split ',', $cgi->param('mark')) {
if ($range =~ /^(\d+)-(\d+)$/) {
@@ -77,7 +77,13 @@ if ($single) {
# Be kind enough and accept URLs of the form: id=1,2,3.
my @ids = split(/,/, $id);
foreach (@ids) {
- my $bug = new Bugzilla::Bug($_, Bugzilla->user->id);
+ my $bug = new Bugzilla::Bug($_);
+ # This is basically a backwards-compatibility hack from when
+ # Bugzilla::Bug->new used to set 'NotPermitted' if you couldn't
+ # see the bug.
+ if (!$bug->{error} && !$user->can_see_bug($bug->bug_id)) {
+ $bug->{error} = 'NotPermitted';
+ }
push(@bugs, $bug);
}
}