Permalink
Browse files

BUGFIX Don't suggest members in SecurityAdmin->autocomplete() that th…

…e current user doesn't have rights to edit (fixes #5651)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@110858 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent c134b8e commit 51fee3fe459d94277e0a85060c821c227badbf17 @chillu chillu committed with sminnee Sep 16, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 code/SecurityAdmin.php
View
@@ -283,7 +283,9 @@ public function autocomplete() {
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";

0 comments on commit 51fee3f

Please sign in to comment.