ENHANCEMENT Adjusted AssetAdmin to Folder->can*() changes

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65455 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-11-07 12:21:41 +00:00
parent 62a36c6828
commit 6db9650b32

View File

@ -124,9 +124,7 @@ class AssetAdmin extends LeftAndMain {
if(isset($data['ID']) && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']);
else $folder = singleton('Folder');
$canUpload = $folder->userCanEdit();
return array( 'CanUpload' => $canUpload );
return array( 'CanUpload' => $folder->canEdit());
}
/**
@ -273,7 +271,7 @@ HTML;
$actions = new FieldSet();
// Only show save button if not 'assets' folder
if( $record->userCanEdit() && $id != "root") {
if( $record->canEdit() && $id != "root") {
$actions = new FieldSet(
new FormAction('save',_t('AssetAdmin.SAVEFOLDERNAME','Save folder name'))
);
@ -289,7 +287,7 @@ HTML;
));
}
if( !$record->userCanEdit() )
if( !$record->canEdit() )
$form->makeReadonly();
return $form;