Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 71640ea

Browse files
committed
BUG: refs #946. Remove item from folder only requires write permission
on the folder, not admin.
1 parent deb16a4 commit 71640ea

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

core/controllers/FolderController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ public function removeitemAction()
324324
{
325325
throw new Zend_Exception("The item doesn't exist.");
326326
}
327-
elseif(!$this->Folder->policyCheck($folder, $this->userSession->Dao, MIDAS_POLICY_ADMIN))
327+
elseif(!$this->Folder->policyCheck($folder, $this->userSession->Dao, MIDAS_POLICY_WRITE))
328328
{
329-
throw new Zend_Exception('Admin permission on folder required');
329+
throw new Zend_Exception('Write permission on folder required');
330330
}
331331
elseif(!$this->Item->policyCheck($item, $this->userSession->Dao, MIDAS_POLICY_ADMIN))
332332
{

core/public/js/common/common.browser.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,10 @@ midas.removeItem = function (id) {
217217
$.post(json.global.webroot+'/folder/removeitem',
218218
{folderId: folderId, itemId: id},
219219
function(data) {
220-
jsonResponse = jQuery.parseJSON(data);
221-
if(jsonResponse==null) {
222-
midas.createNotice('Error',4000);
220+
var jsonResponse = $.parseJSON(data);
221+
if(!jsonResponse) {
222+
$('div.MainDialog').dialog('close');
223+
midas.createNotice('An error occurred, check the error logs', 4000);
223224
return;
224225
}
225226
if(jsonResponse[0]) {

0 commit comments

Comments
 (0)