summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2002-12-11 09:41:19 +0100
committerbugreport%peshkin.net <>2002-12-11 09:41:19 +0100
commit6bd37cce67502e54410dde53f615b5d9b860a4be (patch)
treef924986ee994fc7dd68d91f990de8273c806a5dd /Bugzilla
parentc457b4c49d1ac10b91db246235e65292798f33d6 (diff)
downloadbugzilla-6bd37cce67502e54410dde53f615b5d9b860a4be.tar.gz
bugzilla-6bd37cce67502e54410dde53f615b5d9b860a4be.tar.xz
Bug 184256 Canedit group_control_map entry does not prevent making attachments
r=bbaetz a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Attachment.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index 27d7fa2ca..322a3b2ba 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -65,6 +65,11 @@ sub query
my ($bugid) = @_;
my $in_editbugs = &::UserInGroup("editbugs");
+ &::SendSQL("SELECT product_id
+ FROM bugs
+ WHERE bug_id = $bugid");
+ my $productid = &::FetchOneColumn();
+ my $caneditproduct = &::CanEditProductId($productid);
# Retrieve a list of attachments for this bug and write them into an array
# of hashes in which each hash represents a single attachment.
@@ -88,8 +93,8 @@ sub query
# ie the are the submitter, or they have canedit.
# Also show the link if the user is not logged in - in that cae,
# They'll be prompted later
- $a{'canedit'} = ($::userid == 0 || $submitter_id == $::userid ||
- $in_editbugs);
+ $a{'canedit'} = ($::userid == 0 || (($submitter_id == $::userid ||
+ $in_editbugs) && $caneditproduct));
push @attachments, \%a;
}