Merge pull request #528 from mango9/master

Ticket #5578
This commit is contained in:
Sam Minnée 2012-06-14 16:43:20 -07:00
commit 7ce7ac406e
2 changed files with 17 additions and 0 deletions

View File

@ -797,6 +797,18 @@ class LeftAndMain extends Controller implements PermissionProvider {
$statusUpdates = array('modified'=>array());
$id = $request->requestVar('ID');
$parentID = $request->requestVar('ParentID');
if($className == 'SiteTree' && $page = DataObject::get_by_id('Page', $id)){
$root = $page->getParentType();
if(($parentID == '0' || $root == 'root') && !SiteConfig::current_site_config()->canCreateTopLevel()){
$this->response->setStatusCode(
403,
_t('LeftAndMain.CANT_REORGANISE',"You do not have permission to alter Top level pages. Your change was not saved.")
);
return;
}
}
$siblingIDs = $request->requestVar('SiblingIDs');
$statusUpdates = array('modified'=>array());
if(!is_numeric($id) || !is_numeric($parentID)) throw new InvalidArgumentException();

View File

@ -93,6 +93,11 @@
ID: $(movedNode).data('id'),
ParentID: $(newParentNode).data('id') || 0,
SiblingIDs: siblingIDs
},
statusCode: {
403: function() {
$.jstree.rollback(data.rlbk);
}
}
});
});