Commit a9acddbb authored by dkl%redhat.com's avatar dkl%redhat.com

Bug 455583 - Bugzilla::User::can_{set,request}_flag methods should use the…

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 <dkl@redhat.com> - r/a=LpSolit
parent dde670d3
...@@ -177,6 +177,8 @@ sub is_requestable { return $_[0]->{'is_requestable'}; } ...@@ -177,6 +177,8 @@ sub is_requestable { return $_[0]->{'is_requestable'}; }
sub is_requesteeble { return $_[0]->{'is_requesteeble'}; } sub is_requesteeble { return $_[0]->{'is_requesteeble'}; }
sub is_multiplicable { return $_[0]->{'is_multiplicable'}; } sub is_multiplicable { return $_[0]->{'is_multiplicable'}; }
sub sortkey { return $_[0]->{'sortkey'}; } sub sortkey { return $_[0]->{'sortkey'}; }
sub request_group_id { return $_[0]->{'request_group_id'}; }
sub grant_group_id { return $_[0]->{'grant_group_id'}; }
############################### ###############################
#### Methods #### #### Methods ####
......
...@@ -796,15 +796,15 @@ sub can_request_flag { ...@@ -796,15 +796,15 @@ sub can_request_flag {
my ($self, $flag_type) = @_; my ($self, $flag_type) = @_;
return ($self->can_set_flag($flag_type) return ($self->can_set_flag($flag_type)
|| !$flag_type->request_group || !$flag_type->request_group_id
|| $self->in_group_id($flag_type->request_group->id)) ? 1 : 0; || $self->in_group_id($flag_type->request_group_id)) ? 1 : 0;
} }
sub can_set_flag { sub can_set_flag {
my ($self, $flag_type) = @_; my ($self, $flag_type) = @_;
return (!$flag_type->grant_group return (!$flag_type->grant_group_id
|| $self->in_group_id($flag_type->grant_group->id)) ? 1 : 0; || $self->in_group_id($flag_type->grant_group_id)) ? 1 : 0;
} }
sub direct_group_membership { sub direct_group_membership {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment