BUGFIX: Don't let users edit the location in the Behaviour tab if they don't have sitetree reorganise permission (from r94609) (from r96767)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102395 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 03:17:25 +00:00
parent 7eb4e8ef83
commit 07ad87a09a

View File

@ -1717,6 +1717,16 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
)
);
// Make page location fields read-only if the user doesn't have the appropriate permission
if(!Permission::check("SITETREE_REORGANISE")) {
$fields->makeFieldReadonly('ParentType');
if($this->ParentType == 'root') {
$fields->removeByName('ParentID');
} else {
$fields->makeFieldReadonly('ParentID');
}
}
$viewersOptionsSource = array();
if($this->Parent()->ID || $this->CanViewType == 'Inherit') $viewersOptionsSource["Inherit"] = _t('SiteTree.INHERIT', "Inherit from parent page");
$viewersOptionsSource["Anyone"] = _t('SiteTree.ACCESSANYONE', "Anyone");