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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96767 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-01-12 23:40:33 +00:00
parent 91bb2e56b6
commit deae632bbf

View File

@ -1692,6 +1692,16 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
//new NamedLabelField("Status", $message, "pageStatusMessage", true)
);
// 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");