From: dkl%redhat.com <> Date: Wed, 17 Sep 2008 08:57:05 +0000 (+0000) Subject: Bug 455583 - Bugzilla::User::can_{set,request}_flag methods should use the respective... X-Git-Tag: bugzilla-3.2rc2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eccd55aa0fa2d414a9bc4af9aad13c2a1b7c765;p=thirdparty%2Fbugzilla.git Bug 455583 - Bugzilla::User::can_{set,request}_flag methods should use the respective {grant,request}_group_id values instead of loading new Group object Patch by David Lawrence - r/a=LpSolit --- diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index ffa36863ef..2892a8392c 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -177,6 +177,8 @@ sub is_requestable { return $_[0]->{'is_requestable'}; } sub is_requesteeble { return $_[0]->{'is_requesteeble'}; } sub is_multiplicable { return $_[0]->{'is_multiplicable'}; } sub sortkey { return $_[0]->{'sortkey'}; } +sub request_group_id { return $_[0]->{'request_group_id'}; } +sub grant_group_id { return $_[0]->{'grant_group_id'}; } ############################### #### Methods #### diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index f5b5030951..91240e1ceb 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -775,15 +775,15 @@ sub can_request_flag { my ($self, $flag_type) = @_; return ($self->can_set_flag($flag_type) - || !$flag_type->request_group - || $self->in_group_id($flag_type->request_group->id)) ? 1 : 0; + || !$flag_type->request_group_id + || $self->in_group_id($flag_type->request_group_id)) ? 1 : 0; } sub can_set_flag { my ($self, $flag_type) = @_; - return (!$flag_type->grant_group - || $self->in_group_id($flag_type->grant_group->id)) ? 1 : 0; + return (!$flag_type->grant_group_id + || $self->in_group_id($flag_type->grant_group_id)) ? 1 : 0; } sub direct_group_membership {