mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-01 05:39:01 +02:00
BUGFIX: Simplify permissions, getting rid of the EDIT_PERMISSIONS and SUBSITE_ASSETS_EDIT permissions, and moving the responsibility for making the folder view readonly to the Folder::getCMSFields() and AssetAdmin::getEditForm()
This commit is contained in:
parent
0170bcae79
commit
7d3d498cb9
@ -33,11 +33,6 @@ class FileSubsites extends DataObjectDecorator {
|
|||||||
$sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
|
$sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
|
||||||
if($sites)$fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $sites->toDropdownMap('ID', 'Title', "(Public)")));
|
if($sites)$fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $sites->toDropdownMap('ID', 'Title', "(Public)")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->owner->SubsiteID == 0 && !Permission::check('EDIT_PERMISSIONS') && !Permission::check('SUBSITE_ASSETS_EDIT')){
|
|
||||||
$fields->removeFieldFromTab("Root", "Upload");
|
|
||||||
$fields = $fields->transform(new ReadonlyTransformation());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,7 +64,7 @@ class FileSubsites extends DataObjectDecorator {
|
|||||||
$this->owner->write();
|
$this->owner->write();
|
||||||
}
|
}
|
||||||
|
|
||||||
function alternateCanEdit() {
|
function canEdit() {
|
||||||
// Check the CMS_ACCESS_SecurityAdmin privileges on the subsite that owns this group
|
// Check the CMS_ACCESS_SecurityAdmin privileges on the subsite that owns this group
|
||||||
$subsiteID = Session::get('SubsiteID');
|
$subsiteID = Session::get('SubsiteID');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user