Merge pull request #21 from nyeholt/master

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:
Will Rossiter 2011-06-28 17:52:45 -07:00
commit 8e07c967ed

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());