DS-3740 move fake turnoff to create fake user

This commit is contained in:
Luigi Andrea Pascarelli
2017-11-07 13:15:49 +01:00
parent 8dcfebad10
commit f7895619f4
2 changed files with 1 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ public abstract class AbstractDSpaceRestRepository {
boolean runSingleUser = DSpaceServicesFactoryImpl.getInstance().getConfigurationService()
.getBooleanProperty("run.single.test-user");
if (runSingleUser) {
context.turnOffAuthorisationSystem();
EPerson currentUser = null;
try {
currentUser = EPersonServiceFactory.getInstance().getEPersonService().findByEmail(context,

View File

@@ -100,9 +100,7 @@ public class WorkspaceItemRestRepository extends DSpaceRestRepository<WorkspaceI
@Override
protected WorkspaceItemRest createAndReturn(Context context) {
context.turnOffAuthorisationSystem();
WorkspaceItem source = submissionService.createWorkspaceItem(context, getRequestService().getCurrentRequest());
context.restoreAuthSystemState();
return converter.convert(source);
}