[DS-2779] Fix versioning due to service api

This commit is contained in:
KevinVdV
2015-10-02 12:20:12 +02:00
parent d69f00fe3e
commit 038e2c57c5
9 changed files with 49 additions and 23 deletions

View File

@@ -111,7 +111,14 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
Version previous = versionHistoryService.getPrevious(history, version);
if (versionHistoryService.isFirstVersion(history, previous))
{
modifyHandleMetadata(context, previous.getItem(), (canonical + DOT + 1));
try{
//If we have a reviewer he/she might not have the rights to edit the metadata of this item, so temporarly grant them.
context.turnOffAuthorisationSystem();
modifyHandleMetadata(context, previous.getItem(), (canonical + DOT + 1));
}finally {
context.restoreAuthSystemState();
}
}
// Check if our previous item hasn't got a handle anymore.
// This only occurs when a switch has been made from the standard handle identifier provider