BUGFIX: Fixed issue where folderID wasn't being correctly resolved from request, thus making file upload permissions only ever checked against the 'root' folder

This commit is contained in:
Marcus Nyeholt 2011-06-29 10:41:35 +10:00
parent e3ad632231
commit 07487bf192

View File

@ -103,7 +103,8 @@ JS
Requirements::css(CMS_DIR . "/css/cms_left.css"); Requirements::css(CMS_DIR . "/css/cms_left.css");
Requirements::css(CMS_DIR . "/css/cms_right.css"); Requirements::css(CMS_DIR . "/css/cms_right.css");
if(isset($data['ID']) && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']); $id = (int) $this->request->param('ID');
if($id) $folder = DataObject::get_by_id("Folder", $id);
else $folder = singleton('Folder'); else $folder = singleton('Folder');
return array( 'CanUpload' => $folder->canEdit()); return array( 'CanUpload' => $folder->canEdit());