From 80b35d15f2045928c0ad9d2178bff144c6f5822f Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Wed, 3 Feb 2010 00:57:45 +0000 Subject: [PATCH] MINOR fix permissions FEATURE add 'view site tree as' functionality. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98025 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 2 +- code/CMSSiteTreeFilter.php | 2 +- code/SecurityAdmin.php | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index d96b396a..35028f8c 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -1321,7 +1321,7 @@ JS; 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'sort' => -100 ); - + if (isset($perms['CMS_ACCESS_ModelAdmin'])) unset($perms['CMS_ACCESS_ModelAdmin']); return $perms; diff --git a/code/CMSSiteTreeFilter.php b/code/CMSSiteTreeFilter.php index 73e793c6..e4d58360 100644 --- a/code/CMSSiteTreeFilter.php +++ b/code/CMSSiteTreeFilter.php @@ -28,7 +28,7 @@ abstract class CMSSiteTreeFilter extends Object { } $leftAndMain = new CMSMain(); - $tree = $leftAndMain->getSiteTreeFor('SiteTree', isset($_REQUEST['ID']) ? $_REQUEST['ID'] : 0, null, null, array($this, 'includeInTree')); + $tree = $leftAndMain->getSiteTreeFor('SiteTree', isset($_REQUEST['ID']) ? $_REQUEST['ID'] : 0, null, null, array($this, 'includeInTree'), count($this->ids)); // Trim off the outer tag $tree = ereg_replace('^[ \t\r\n]*]*>','', $tree); diff --git a/code/SecurityAdmin.php b/code/SecurityAdmin.php index 3a18553a..6400013a 100644 --- a/code/SecurityAdmin.php +++ b/code/SecurityAdmin.php @@ -57,6 +57,8 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { public function getEditForm($id) { $record = null; + if (($id == 'root' || $id == 0) && $this->hasMethod('getRootForm')) return $this->getRootForm($this, 'EditForm'); + if($id && $id != 'root') { $record = DataObject::get_by_id($this->stat('tree_class'), $id); }