summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Flag.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-09-20 06:47:49 +0200
committerlpsolit%gmail.com <>2006-09-20 06:47:49 +0200
commitf90a0b775e927aad00631ce80d282186a3022af5 (patch)
tree37b896b80e108ecbb73544a164528521ae7a1288 /Bugzilla/Flag.pm
parent0fccdb26ae49bd8bb6022d48b769595e0a328278 (diff)
downloadbugzilla-f90a0b775e927aad00631ce80d282186a3022af5.tar.gz
bugzilla-f90a0b775e927aad00631ce80d282186a3022af5.tar.xz
Bug 348518: grant / reject options for flag listbox should only appear if user is a member of grantgroup - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=myk
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r--Bugzilla/Flag.pm17
1 files changed, 6 insertions, 11 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index b82165e80..072a449f6 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -416,13 +416,10 @@ sub _validate {
}
# Throw an error if the user won't be allowed to set the flag.
- if ($flag_type->grant_group
- && !$requestee->in_group_id($flag_type->grant_group->id))
- {
- ThrowUserError('flag_requestee_needs_privs',
- {'requestee' => $requestee,
- 'flagtype' => $flag_type});
- }
+ $requestee->can_set_flag($flag_type)
+ || ThrowUserError('flag_requestee_needs_privs',
+ {'requestee' => $requestee,
+ 'flagtype' => $flag_type});
}
}
@@ -433,12 +430,10 @@ sub _validate {
# - User in the request_group can clear pending requests and set flags
# and can rerequest set flags.
return if (($status eq 'X' || $status eq '?')
- && (!$flag_type->request_group
- || $user->in_group_id($flag_type->request_group->id)));
+ && $user->can_request_flag($flag_type));
# - User in the grant_group can set/clear flags, including "+" and "-".
- return if (!$flag_type->grant_group
- || $user->in_group_id($flag_type->grant_group->id));
+ return if $user->can_set_flag($flag_type);
# - Any other flag modification is denied
ThrowUserError('flag_update_denied',