mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT added new permission, SITETREE_REORGANISE
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@84073 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2d97200a23
commit
96d438f21e
@ -892,6 +892,11 @@ JS;
|
|||||||
$_REQUEST['ajax'] = 1;
|
$_REQUEST['ajax'] = 1;
|
||||||
$cleanupJS = '';
|
$cleanupJS = '';
|
||||||
|
|
||||||
|
if (!Permission::check('SITETREE_REORGANISE') && !Permission::check('ADMIN')) {
|
||||||
|
FormResponse::status_message(_t('LeftAndMain.CANT_REORGANISE',"You do not have permission to rearange the site tree. Your change was not saved."),"bad");
|
||||||
|
return FormResponse::respond();
|
||||||
|
}
|
||||||
|
|
||||||
if(is_numeric($id) && is_numeric($parentID) && $id != $parentID) {
|
if(is_numeric($id) && is_numeric($parentID) && $id != $parentID) {
|
||||||
$node = DataObject::get_by_id($this->stat('tree_class'), $id);
|
$node = DataObject::get_by_id($this->stat('tree_class'), $id);
|
||||||
if($node){
|
if($node){
|
||||||
@ -933,6 +938,11 @@ JS;
|
|||||||
$js = '';
|
$js = '';
|
||||||
$_REQUEST['ajax'] = 1;
|
$_REQUEST['ajax'] = 1;
|
||||||
|
|
||||||
|
if (!Permission::check('SITETREE_REORGANISE') && !Permission::check('ADMIN')) {
|
||||||
|
FormResponse::status_message(_t('LeftAndMain.CANT_REORGANISE',"You do not have permission to rearange the site tree. Your change was not saved."),"bad");
|
||||||
|
return FormResponse::respond();
|
||||||
|
}
|
||||||
|
|
||||||
if(is_array($_REQUEST['ID'])) {
|
if(is_array($_REQUEST['ID'])) {
|
||||||
if($_REQUEST['MovedNodeID']==0){ //Sorting root
|
if($_REQUEST['MovedNodeID']==0){ //Sorting root
|
||||||
$movedNode = DataObject::get($className, "\"ParentID\"=0");
|
$movedNode = DataObject::get($className, "\"ParentID\"=0");
|
||||||
@ -971,6 +981,10 @@ JS;
|
|||||||
return FormResponse::respond();
|
return FormResponse::respond();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function CanOrganiseSitetree() {
|
||||||
|
return !Permission::check('SITETREE_REORGANISE') && !Permission::check('ADMIN') ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a number of items
|
* Delete a number of items
|
||||||
*/
|
*/
|
||||||
|
@ -88,6 +88,7 @@
|
|||||||
<% end_control %>
|
<% end_control %>
|
||||||
</select> <img id="siteTreeFilterActionIndicator" style="display:none" src="cms/images/network-save.gif">
|
</select> <img id="siteTreeFilterActionIndicator" style="display:none" src="cms/images/network-save.gif">
|
||||||
</div>
|
</div>
|
||||||
|
<% if CanOrganiseSitetree %>
|
||||||
<div class="checkboxAboveTree">
|
<div class="checkboxAboveTree">
|
||||||
<img id="checkboxActionIndicator" src="cms/images/network-save.gif">
|
<img id="checkboxActionIndicator" src="cms/images/network-save.gif">
|
||||||
<div>
|
<div>
|
||||||
@ -95,7 +96,7 @@
|
|||||||
<label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag & drop reordering', PR_HIGH) %></label>
|
<label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag & drop reordering', PR_HIGH) %></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end_if %>
|
||||||
<% if IsTranslatableEnabled %>
|
<% if IsTranslatableEnabled %>
|
||||||
<div id="LangSelector_holder">
|
<div id="LangSelector_holder">
|
||||||
Language: $LangSelector
|
Language: $LangSelector
|
||||||
|
Loading…
Reference in New Issue
Block a user