]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 388232: Restricting a bug to a group sets reporter_accessible and cc_accessible...
authormkanat%bugzilla.org <>
Mon, 16 Jul 2007 04:41:58 +0000 (04:41 +0000)
committermkanat%bugzilla.org <>
Mon, 16 Jul 2007 04:41:58 +0000 (04:41 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Bugzilla/Bug.pm
process_bug.cgi

index ad91465047343ae52e1a44c5c41c5c6d5f76dfb8..ec2fd491a385050b1da6c822d6ac6465e8da390b 100755 (executable)
@@ -1753,6 +1753,17 @@ sub groups {
     return $self->{'groups'};
 }
 
+sub groups_in {
+    my $self = shift;
+    return $self->{'groups_in'} if exists $self->{'groups_in'};
+    return [] if $self->{'error'};
+    my $group_ids = Bugzilla->dbh->selectcol_arrayref(
+        'SELECT group_id FROM bug_group_map WHERE bug_id = ?',
+        undef, $self->id);
+    $self->{'groups_in'} = Bugzilla::Group->new_from_list($group_ids);
+    return $self->{'groups_in'};
+}
+
 sub user {
     my $self = shift;
     return $self->{'user'} if exists $self->{'user'};
index 8316979b243f3463025f8c3297d2b151e136c8b6..dcc0d654321aadb00e7055ad85c8daca50256f35 100755 (executable)
@@ -667,7 +667,7 @@ if (defined $cgi->param('id')) {
     #  on show_bug, thus it would look like the user was trying to
     #  uncheck them, which would then be denied by the set_ functions,
     #  throwing a confusing error.)
-    if (scalar @{$bug->groups}) {
+    if (scalar @{$bug->groups_in}) {
         $bug->set_cclist_accessible($cgi->param('cclist_accessible'))
             if $bug->check_can_change_field('cclist_accessible', 0, 1);
         $bug->set_reporter_accessible($cgi->param('reporter_accessible'))