BUGFIX Don't suggest members in SecurityAdmin->autocomplete() that the current user doesn't have rights to edit (fixes #5651) (from r110858)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112796 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-19 01:02:41 +00:00
parent 949d8b3cb1
commit ad5a8e0fce

View File

@ -259,7 +259,9 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
if($matches) {
$result .= "<ul>";
foreach($matches as $match) {
if(!$match->canView()) continue;
// If the current user doesnt have permissions on the target user,
// he's not allowed to add it to a group either: Don't include it in the suggestions.
if(!$match->canView() || !$match->canEdit()) continue;
$data = $match->FirstName;
$data .= ",$match->Surname";