Commit 298bffb5 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 350181: Check whether the requestee is allowed to set a flag - Patch by…

Bug 350181: Check whether the requestee is allowed to set a flag - Patch by Frédéric Buclin <LpSolit@gmail.com> a=myk
parent f86bdf88
......@@ -414,6 +414,15 @@ sub _validate {
bug_id => $bug_id,
attach_id => $attach_id });
}
# 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});
}
}
}
......
......@@ -475,7 +475,13 @@
'flags.html' => 'Using Flags'} %]
You can't ask more than one person at a time for
<em>[% type.name FILTER html %]</em>.
[% ELSIF error == "flag_requestee_needs_privs" %]
[% title = "Flag Requestee Needs Privileges" %]
[% requestee.identity FILTER html %] does not have permission to set the
<em>[% flagtype.name FILTER html %]</em> flag. Please select a user who is
a member of the <em>[% flagtype.grant_group.name FILTER html %]</em> group.
[% ELSIF error == "flag_requestee_unauthorized" %]
[% title = "Flag Requestee Not Authorized" %]
[% admindocslinks = {'flags-overview.html#flags-admin' => 'Administering Flags',
......
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