[DS-261] Community Admin JSPUI: porting of the DS-228 patch

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4196 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Andrea Bollini
2009-08-06 13:29:46 +00:00
parent 7eae73c1d8
commit 0b3c7b9fa0
11 changed files with 161 additions and 33 deletions

View File

@@ -2125,6 +2125,14 @@ public class Item extends DSpaceObject
*/
public void move (Collection from, Collection to) throws SQLException, AuthorizeException, IOException
{
// Check authorisation on the item before that the move occur
// otherwise we will need edit permission on the "target collection" to archive our goal
// only do write authorization if user is not an editor
if (!canEdit())
{
AuthorizeManager.authorizeAction(ourContext, this, Constants.WRITE);
}
// Move the Item from one Collection to the other
to.addItem(this);
from.removeItem(this);
@@ -2133,7 +2141,9 @@ public class Item extends DSpaceObject
if (isOwningCollection(from))
{
setOwningCollection(to);
ourContext.turnOffAuthorisationSystem();
update();
ourContext.restoreAuthSystemState();
}
else
{