mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
7eb4e8ef83
commit
07ad87a09a
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user