From 0d3a72b793725118641c4d7abf511b4fc98f7aef Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 11 Nov 2006 00:51:27 +0000 Subject: Bug 189627: Implement per-product privileges - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Component.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Component.pm') diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 4b9856feb..657d0f728 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -171,6 +171,15 @@ sub initial_cc { return $self->{'initial_cc'}; } +sub product { + my $self = shift; + if (!defined $self->{'product'}) { + require Bugzilla::Product; # We cannot |use| it. + $self->{'product'} = new Bugzilla::Product($self->product_id); + } + return $self->{'product'}; +} + ############################### #### Accessors #### ############################### @@ -229,7 +238,8 @@ Bugzilla::Component - Bugzilla product component class. my $product_id = $component->product_id; my $default_assignee = $component->default_assignee; my $default_qa_contact = $component->default_qa_contact; - my $initial_cc = $component->initial_cc + my $initial_cc = $component->initial_cc; + my $product = $component->product; my $bug_flag_types = $component->flag_types->{'bug'}; my $attach_flag_types = $component->flag_types->{'attachment'}; @@ -305,6 +315,14 @@ Initial CC List. Returns: Two references to an array of flagtype objects. +=item C + + Description: Returns the product the component belongs to. + + Params: none. + + Returns: A Bugzilla::Product object. + =back =head1 SUBROUTINES -- cgit v1.2.3-24-g4f1b