From 82bab122d14431f4bf3f1c31988434aec2386515 Mon Sep 17 00:00:00 2001 From: Hugo Seabrook Date: Fri, 15 Feb 2013 14:08:31 +0800 Subject: Bug 830330: Make flags honour bug_check_can_change_field r=dkl, a=LpSolit --- Bugzilla/Flag.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Bugzilla/Flag.pm') diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 3660e2a7f..98029a1b1 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -294,6 +294,12 @@ sub set_flag { ThrowCodeError('flag_unexpected_object', { 'caller' => ref $obj }); } + # Make sure the user can change flags + my $privs; + $bug->check_can_change_field('flagtypes.name', 0, 1, \$privs) + || ThrowUserError('illegal_change', + { field => 'flagtypes.name', privs => $privs }); + # Update (or delete) an existing flag. if ($params->{id}) { my $flag = $class->check({ id => $params->{id} }); -- cgit v1.2.3-24-g4f1b