summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-04-04 18:39:14 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-04-04 18:39:14 +0200
commitfc2d539c324a34254a5cb5e9ebeb386c39220f93 (patch)
treeefbb2930e4b5ae0a348e180c771f3f8ab392006c /Bugzilla/User.pm
parentc83c4f78bb91c27e2ffd0e5fb8091fe6795885b8 (diff)
downloadbugzilla-fc2d539c324a34254a5cb5e9ebeb386c39220f93.tar.gz
bugzilla-fc2d539c324a34254a5cb5e9ebeb386c39220f93.tar.xz
Bug 1257662 - Disallow clearing a flag if the flag is set to allow granting by specifc group and changer is not in group
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 5386e70ca..3fe59fe76 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -1529,6 +1529,13 @@ sub can_set_flag {
|| $self->in_group_id($flag_type->grant_group_id)) ? 1 : 0;
}
+sub can_unset_flag {
+ my ($self, $flag_type, $flag_status) = @_;
+ return 1 if !$flag_type->grant_group_id;
+ return 1 if ($flag_status ne '+' && $flag_status ne '-');
+ return $self->in_group_id($flag_type->grant_group_id) ? 1 : 0;
+}
+
# visible_groups_inherited returns a reference to a list of all the groups
# whose members are visible to this user.
sub visible_groups_inherited {