From 0336fb018c43c2832c5aa476069ec621779a7b65 Mon Sep 17 00:00:00 2001
From: srosse <stephane.rosse@frentix.com>
Date: Tue, 24 Jul 2018 08:47:01 +0200
Subject: [PATCH] OO-3584: replace the BARG, canlaunch, statuscode, accesscode
 with a status, all users, guests flags

---
 README.md                                     |   2 +-
 .../den/DENCourseNodeNotificationHandler.java |   3 +-
 .../InstitutionPortletRunController.java      |  29 +-
 .../coursecreation/CourseCreationHelper.java  |   6 +-
 .../SystemRegistrationManager.java            |   5 +-
 .../basesecurity/BaseSecurityManager.java     |   6 +-
 .../CalendarNotificationHandler.java          |   4 +-
 .../InfoMessageNotificationHandler.java       |   8 +-
 .../FolderNotificationsHandler.java           |   2 +-
 .../persistence/NativeQueryBuilder.java       |  50 +-
 .../persistence/PersistenceHelper.java        |  26 +-
 .../commons/persistence/QueryBuilder.java     | 193 ++++++++
 .../commons/services/mark/ui/Bookmark.java    |  11 +-
 .../services/mark/ui/BookmarksController.java |   2 +-
 .../ui/BookmarksPortletRunController.java     |  10 +-
 .../olat/core/id/context/HistoryManager.java  |   5 +
 .../java/org/olat/course/CourseFactory.java   |  27 +-
 .../course/CoursefolderWebDAVMergeSource.java |   9 +-
 .../olat/course/MergedCourseContainer.java    |   2 +-
 .../archiver/CourseLogsArchiveController.java |   8 +-
 .../course/archiver/LogFileChooserForm.java   |  10 +-
 .../AssessmentNotificationsHandler.java       |   3 +-
 .../CertificationNotificationHandler.java     |   3 +-
 ...eAndEfficiencyStatementListController.java |   2 +-
 .../editor/CourseAccessAndProperties.java     |  40 +-
 .../olat/course/editor/PublishProcess.java    |  11 +-
 .../editor/PublishStep01AccessForm.java       | 188 +++-----
 .../course/editor/QuickPublishController.java |  42 +-
 .../groupsandrights/CourseGroupManager.java   |   5 +
 .../PersistingCourseGroupManager.java         |   5 +
 .../FileUploadNotificationHandler.java        |   2 +-
 .../nodes/gta/manager/GTANotifications.java   |  11 +-
 .../ta/AbstractTaskNotificationHandler.java   |   2 +-
 .../course/run/CourseRuntimeController.java   |   3 +-
 .../olat/course/run/RunMainController.java    |   7 +-
 .../preview/PreviewCourseGroupManager.java    |  13 +
 .../userview/UserCourseEnvironmentImpl.java   |   3 +-
 ...urseSiteContextEntryControllerCreator.java |   3 +-
 .../olat/group/manager/BusinessGroupDAO.java  |   5 +-
 .../model/BGRepositoryEntryShortImpl.java     |  10 +-
 .../org/olat/home/HomeCalendarManager.java    |  12 +-
 .../qti/repository/handlers/QTIHandler.java   |   9 +-
 .../handlers/QTI21AssessmentTestHandler.java  |   8 +-
 .../modules/coach/manager/CoachingDAO.java    | 223 ++++-----
 .../ui/CurriculumElementListController.java   |  10 +-
 .../ui/CurriculumElementWithViewsRow.java     |  31 +-
 .../modules/fo/ForumNotificationsHandler.java |   5 +-
 .../forms/handler/EvaluationFormHandler.java  |   7 +-
 .../manager/LectureBlockRollCallDAO.java      |  11 +-
 .../handler/BinderTemplateHandler.java        |   8 +-
 .../modules/portfolio/manager/BinderDAO.java  |   9 +-
 .../modules/reminder/manager/ReminderDAO.java |   6 +-
 .../SharedFolderWebDAVMergeSource.java        |   4 +-
 .../video/ui/VideoListingController.java      |   2 +-
 .../dispatching/FeedMediaDispatcher.java      |   2 +-
 .../modules/webFeed/dispatching/Path.java     |   2 +-
 .../manager/FeedNotificationsHandler.java     |   4 +-
 ...PageChangeOrCreateNotificationHandler.java |   4 +-
 .../olat/repository/RepositoryEntry.hbm.xml   |   6 +-
 .../org/olat/repository/RepositoryEntry.java  | 131 ++---
 .../olat/repository/RepositoryEntryLight.java |   6 +-
 .../repository/RepositoryEntryMyView.java     |  10 +-
 .../olat/repository/RepositoryEntryShort.java |   2 +-
 .../repository/RepositoryEntryStatusEnum.java | 109 +++++
 .../olat/repository/RepositoryManager.java    | 453 +++++++-----------
 .../olat/repository/RepositoryService.java    |   2 +-
 .../_i18n/LocalStrings_de.properties          |  22 +-
 .../_i18n/LocalStrings_en.properties          |  21 +
 .../RepositorySearchController.java           |   2 +-
 .../olat/repository/handlers/BlogHandler.java |   5 +-
 .../repository/handlers/CourseHandler.java    |  15 +-
 .../repository/handlers/GlossaryHandler.java  |   7 +-
 .../repository/handlers/ImsCPHandler.java     |   9 +-
 .../repository/handlers/PodcastHandler.java   |   8 +-
 .../repository/handlers/PortfolioHandler.java |   8 +-
 .../repository/handlers/SCORMCPHandler.java   |   5 +-
 .../handlers/SharedFolderHandler.java         |   5 +-
 .../repository/handlers/VideoHandler.java     |   3 +-
 .../handlers/WebDocumentHandler.java          |   5 +-
 .../olat/repository/handlers/WikiHandler.java |   9 +-
 .../manager/AutomaticLifecycleService.java    |  24 +-
 .../manager/RepositoryEntryAuthorQueries.java |  68 ++-
 .../RepositoryEntryMyCourseQueries.java       |  97 ++--
 .../manager/RepositoryEntryQueries.java       |  56 +--
 .../manager/RepositoryServiceImpl.java        |  31 +-
 .../model/RepositoryEntryAuthorImpl.java      |  31 +-
 .../model/RepositoryEntryLightImpl.java       |  47 +-
 .../model/RepositoryEntryMyCourseImpl.java    |  26 +-
 .../model/RepositoryEntryShortImpl.java       |  39 +-
 .../portlet/RepositoryPortletEntry.java       |  35 +-
 .../RepositoryPortletRunController.java       |  33 +-
 ...RepositoryEntryAccessColumnDescriptor.java |  31 +-
 ...ositoryEntryLifeCycleChangeController.java |   8 +-
 .../ui/RepositoryEntryRuntimeController.java  |  10 +-
 .../ui/RepositoryFlexiTableModel.java         |   4 +-
 .../repository/ui/RepositoryTableModel.java   |  65 ++-
 .../repository/ui/RepositoyUIFactory.java     |  10 +-
 .../repository/ui/author/AccessRenderer.java  |  18 +-
 .../ui/author/AuthorListController.java       |  16 +-
 .../author/AuthoringEditAccessController.java |  25 +-
 .../ui/author/AuthoringEntryDataModel.java    |   6 +-
 .../ui/author/AuthoringEntryDataSource.java   |   2 +-
 .../AuthoringEntryPublishController.java      | 179 ++-----
 .../ui/author/AuthoringEntryRow.java          |  30 +-
 .../repository/ui/author/TypeRenderer.java    |   9 +-
 .../wizard/UnpublishResourceCallback.java     |   5 +-
 .../ui/catalog/CatalogEntryRow.java           |  25 +-
 .../catalog/CatalogNodeManagerController.java |   7 +-
 .../DefaultRepositoryEntryDataSource.java     |   2 +-
 .../RepositoryEntryDetailsController.java     |  33 +-
 .../list/RepositoryEntryListController.java   |   8 +-
 .../ui/list/RepositoryEntryRow.java           |  35 +-
 .../repository/ui/list/_content/details.html  |   4 +-
 .../RepositoryEntriesWebService.java          |  33 +-
 .../repository/RepositoryEntryWebService.java |   9 +-
 .../repository/course/CourseWebService.java   |  21 +-
 .../repository/course/CoursesWebService.java  | 115 +++--
 .../restapi/security/RestSecurityHelper.java  |  10 +
 .../support/vo/RepositoryEntryAccessVO.java   |  34 +-
 .../system/OpenOLATStatisticsWebService.java  |   5 +-
 .../indexer/repository/CourseIndexer.java     |  14 +-
 .../indexer/repository/RepositoryIndexer.java |   6 +-
 .../org/olat/upgrade/OLATUpgrade_13_0_0.java  |  79 +++
 .../model/RepositoryEntryAccessUpgrade.java   | 135 ++++++
 .../RepositoryEntryAccessUpgradeStatus.java   |  81 ++++
 .../model/RepositoryEntryUpgrade.hbm.xml      |  42 ++
 .../user/restapi/UserCoursesWebService.java   |  12 +-
 .../database/mysql/alter_12_4_x_to_13_0_0.sql |   9 +
 .../database/mysql/setupDatabase.sql          |   9 +-
 .../oracle/alter_12_4_x_to_13_0_0.sql         |  10 +
 .../database/oracle/setupDatabase.sql         |   6 +-
 .../postgresql/alter_12_4_x_to_13_0_0.sql     |   9 +
 .../database/postgresql/setupDatabase.sql     |  11 +-
 .../commons/coordinate/CoordinatorTest.java   |   4 +-
 .../services/webdav/WebDAVCommandsTest.java   |  32 +-
 .../config/CourseConfigManagerImplTest.java   |   4 +-
 .../course/editor/PublishProcessTest.java     |  11 +-
 .../en/EnrollmentManagerConcurrentTest.java   |   4 +-
 .../gatling/AccessTransactionGatling.java     |   8 +-
 .../QTIStatisticsManagerLargeTest.java        |   4 +-
 .../coach/manager/CoachingDAOTest.java        |  19 +-
 .../manager/EvaluationFormTestsHelper.java    |   3 +-
 .../org/olat/modules/iq/IQTestHelper.java     |   5 +-
 .../manager/PortfolioServiceTest.java         |  23 +-
 .../olat/portfolio/EPFrontendManagerTest.java |  16 +-
 .../manager/EPStructureManagerTest.java       |   4 +-
 .../repository/RepositoryManagerTest.java     | 203 ++++----
 .../manager/RepositoryEntryDAOTest.java       |  37 +-
 .../manager/RepositoryEntryQueriesTest.java   |  56 ++-
 .../RepositoryEntryRelationDAOTest.java       |  52 +-
 .../RepositoryEntryStatisticsDAOTest.java     |  70 ++-
 .../RepositoryEntryToOrganisationDAOTest.java |  13 +-
 ...RepositoryEntryToTaxonomyLevelDAOTest.java |  13 +-
 .../manager/RepositoryServiceImplTest.java    |  11 +-
 .../accesscontrol/ACFrontendManagerTest.java  |   6 +-
 .../references/ReferenceManagerTest.java      |  52 +-
 .../java/org/olat/restapi/CalendarTest.java   |  11 +-
 .../java/org/olat/restapi/CatalogTest.java    |   4 +-
 .../java/org/olat/restapi/ContactsTest.java   |   4 +-
 .../org/olat/restapi/CourseCalendarTest.java  |   7 +-
 .../java/org/olat/restapi/CourseTest.java     |  12 +-
 .../org/olat/restapi/CoursesFoldersTest.java  |   3 +-
 .../org/olat/restapi/CoursesForumsTest.java   |   3 +-
 .../org/olat/restapi/CoursesInfosTest.java    |   4 +-
 .../restapi/CoursesResourcesFoldersTest.java  |   4 +-
 .../java/org/olat/restapi/CoursesTest.java    |   7 +-
 .../org/olat/restapi/GroupFoldersTest.java    |   4 +-
 .../java/org/olat/restapi/GroupMgmtTest.java  |   4 +-
 .../org/olat/restapi/NotificationsTest.java   |   5 +-
 .../olat/restapi/RepositoryEntriesTest.java   |   7 +-
 .../RepositoryEntryWebServiceTest.java        |  24 +-
 .../org/olat/restapi/UserCoursesTest.java     |  11 +-
 .../org/olat/selenium/AssessmentTest.java     |   2 +-
 .../org/olat/selenium/BusinessGroupTest.java  |   2 +-
 .../org/olat/selenium/CourseElementTest.java  |   2 +-
 .../java/org/olat/selenium/CourseTest.java    |   6 +-
 .../org/olat/selenium/ImsQTI21EditorTest.java |   4 +-
 .../java/org/olat/selenium/ImsQTI21Test.java  |   2 +-
 .../java/org/olat/selenium/LecturesTest.java  |   2 +-
 .../org/olat/selenium/PortfolioV2Test.java    |   2 +-
 .../page/course/PublisherPageFragment.java    |  39 +-
 .../page/repository/RepositoryAccessPage.java |  49 +-
 .../selenium/page/repository/UserAccess.java  |  32 ++
 .../java/org/olat/test/JunitTestHelper.java   |  74 ++-
 184 files changed, 2690 insertions(+), 1935 deletions(-)
 create mode 100644 src/main/java/org/olat/core/commons/persistence/QueryBuilder.java
 create mode 100644 src/main/java/org/olat/repository/RepositoryEntryStatusEnum.java
 create mode 100644 src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgrade.java
 create mode 100644 src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgradeStatus.java
 create mode 100644 src/test/java/org/olat/selenium/page/repository/UserAccess.java

diff --git a/README.md b/README.md
index c2824a9a7ca..fb8258b7760 100644
--- a/README.md
+++ b/README.md
@@ -396,7 +396,7 @@ The beginning of the installation is the same as Tomcat as described above. To c
      
 #### Configuration WildFly (JBoss AS 10.1)
 
-We need Hibernate 5.2, you need to use the utorial to update the version of hibernate
+We need Hibernate 5.2, you need to use the tutorial to update the version of hibernate
 in Widlfly: http://docs.jboss.org/hibernate/orm/5.2/topical/html_single/wildfly/Wildfly.html
 
 Define a JDBC connection pool in your standalone.xml configuration with a jndi-name like:
diff --git a/src/main/java/de/bps/course/nodes/den/DENCourseNodeNotificationHandler.java b/src/main/java/de/bps/course/nodes/den/DENCourseNodeNotificationHandler.java
index 7771ea6e624..f5ad515458f 100644
--- a/src/main/java/de/bps/course/nodes/den/DENCourseNodeNotificationHandler.java
+++ b/src/main/java/de/bps/course/nodes/den/DENCourseNodeNotificationHandler.java
@@ -102,8 +102,7 @@ public class DENCourseNodeNotificationHandler implements NotificationsHandler {
 	
 	private boolean courseStatus(ICourse course) {
 		return course != null
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isUnpublished()
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed();
+				&& !course.getCourseEnvironment().getCourseGroupManager().isNotificationsAllowed();
 	}
 	
 	private void checkPublisher(Publisher p) {
diff --git a/src/main/java/de/bps/olat/portal/institution/InstitutionPortletRunController.java b/src/main/java/de/bps/olat/portal/institution/InstitutionPortletRunController.java
index 0498787f26c..4abcb293d23 100644
--- a/src/main/java/de/bps/olat/portal/institution/InstitutionPortletRunController.java
+++ b/src/main/java/de/bps/olat/portal/institution/InstitutionPortletRunController.java
@@ -40,6 +40,7 @@ import org.olat.core.logging.Tracing;
 import org.olat.core.util.StringHelper;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
+import org.springframework.beans.factory.annotation.Autowired;
 
 public class InstitutionPortletRunController extends BasicController {
 	
@@ -49,6 +50,9 @@ public class InstitutionPortletRunController extends BasicController {
 	private List<String> polyLinks;
 	private Map<Link, PolymorphLink> mapLinks;
 	private InstitutionPortletEntry ipe;
+	
+	@Autowired
+	private RepositoryManager repositoryManager;
 
 	protected InstitutionPortletRunController(UserRequest ureq, WindowControl wControl) {
 		super(ureq, wControl);
@@ -111,11 +115,11 @@ public class InstitutionPortletRunController extends BasicController {
 
 			this.portletVC.contextPut("hasPolymorphLink", Boolean.FALSE);
 
-			polyLinks = new ArrayList<String>();
-			mapLinks = new HashMap<Link, PolymorphLink>();
+			polyLinks = new ArrayList<>();
+			mapLinks = new HashMap<>();
 
 			List<PolymorphLink> polyList = ipe.getPolymorphLinks();
-			if (polyList != null && polyList.size() > 0) {
+			if (polyList != null && !polyList.isEmpty()) {
 				int i = 0;
 				for (PolymorphLink polymorphLink : polyList) {
 					if ((polymorphLink.hasConditions() && (polymorphLink.getResultIDForUser(ureq) != null)) || !(polymorphLink.hasConditions())) {
@@ -128,7 +132,7 @@ public class InstitutionPortletRunController extends BasicController {
 						i++;
 					}
 				}
-				if (polyLinks.size() > 0) {
+				if (!polyLinks.isEmpty()) {
 					this.portletVC.contextPut("polyLinks", polyLinks);
 					this.portletVC.contextPut("numPolyLinks", polyLinks.size());
 					this.portletVC.contextPut("hasPolymorphLink", Boolean.TRUE);
@@ -138,10 +142,7 @@ public class InstitutionPortletRunController extends BasicController {
 		putInitialPanel(this.portletVC);
 	}
 
-	/**
-	 * @see org.olat.gui.control.DefaultController#event(org.olat.gui.UserRequest,
-	 *      org.olat.gui.components.Component, org.olat.gui.control.Event)
-	 */
+	@Override
 	public void event(UserRequest ureq, Component source, Event event) {
 		// nothing to catch
 		if (source instanceof Link) {
@@ -166,17 +167,16 @@ public class InstitutionPortletRunController extends BasicController {
 			}
 
 			if (polyLink.getLinkType().equals(InstitutionPortlet.TYPE_COURSE)) {
-				RepositoryManager rm = RepositoryManager.getInstance();
 				RepositoryEntry re = null;
 
 				// id corresponding to the conditions set for this user
-				if (polyLink != null && resultIDForUser != null) re = rm.lookupRepositoryEntry(resultIDForUser);
+				if (resultIDForUser != null) re = repositoryManager.lookupRepositoryEntry(resultIDForUser);
 
 				// if ressource is not available choose default link
-				if (re == null && defaultID != null) re = rm.lookupRepositoryEntry(defaultID);
+				if (re == null && defaultID != null) re = repositoryManager.lookupRepositoryEntry(defaultID);
 
 				if (re != null) {
-					if (!rm.isAllowedToLaunch(ureq, re)) {
+					if (!repositoryManager.isAllowedToLaunch(getIdentity(), ureq.getUserSession().getRoles(), re)) {
 						getWindowControl().setWarning(translate("warn.cantlaunch"));
 					} else {
 						WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(getWindowControl(), re);
@@ -198,14 +198,11 @@ public class InstitutionPortletRunController extends BasicController {
 		}
 	}
 
-	/**
-	 * @see org.olat.gui.control.DefaultController#doDispose(boolean)
-	 */
+	@Override
 	protected void doDispose() {
 		if(portletVC != null) portletVC = null;
 		if(polyLinks != null) polyLinks = null;
 		if(mapLinks != null) mapLinks = null;
 		if(ipe != null) ipe = null;
 	}
-
 }
diff --git a/src/main/java/de/tuchemnitz/wizard/workflows/coursecreation/CourseCreationHelper.java b/src/main/java/de/tuchemnitz/wizard/workflows/coursecreation/CourseCreationHelper.java
index 022fb8f3f09..f48e35d079d 100644
--- a/src/main/java/de/tuchemnitz/wizard/workflows/coursecreation/CourseCreationHelper.java
+++ b/src/main/java/de/tuchemnitz/wizard/workflows/coursecreation/CourseCreationHelper.java
@@ -271,9 +271,9 @@ public class CourseCreationHelper {
 			CourseAccessAndProperties accessAndProps = courseConfig.getAccessAndProperties();
 			RepositoryManager manager = RepositoryManager.getInstance();			
 			
-			addedEntry = manager.setAccessAndProperties(accessAndProps.getRepositoryEntry(), accessAndProps.getAccess(),
-					accessAndProps.isMembersOnly(), accessAndProps.isCanCopy(), accessAndProps.isCanReference(),
-					accessAndProps.isCanDownload());
+			addedEntry = manager.setAccessAndProperties(accessAndProps.getRepositoryEntry(),
+					accessAndProps.getStatus(), accessAndProps.isAllUsers(), accessAndProps.isGuests(),
+					accessAndProps.isCanCopy(), accessAndProps.isCanReference(), accessAndProps.isCanDownload());
 			addedEntry = manager.setLeaveSetting(addedEntry, accessAndProps.getSetting());
 			
 			List<OfferAccess> offerAccess = accessAndProps.getOfferAccess();
diff --git a/src/main/java/org/olat/admin/registration/SystemRegistrationManager.java b/src/main/java/org/olat/admin/registration/SystemRegistrationManager.java
index 92ec700c8b2..cca7b6bc2a6 100644
--- a/src/main/java/org/olat/admin/registration/SystemRegistrationManager.java
+++ b/src/main/java/org/olat/admin/registration/SystemRegistrationManager.java
@@ -61,7 +61,6 @@ import org.olat.course.CourseModule;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.model.SearchBusinessGroupParams;
 import org.olat.instantMessaging.InstantMessagingModule;
-import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.quartz.JobDetail;
 import org.quartz.JobKey;
@@ -249,8 +248,8 @@ public class SystemRegistrationManager implements InitializingBean {
 		msgProperties.put("debuggingEnabled", String.valueOf(Settings.isDebuging()));
 		
 		// Course counts
-		int allCourses = repositoryManager.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_OWNERS);
-		int publishedCourses = repositoryManager.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_USERS);
+		int allCourses = repositoryManager.countByType(CourseModule.ORES_TYPE_COURSE);
+		int publishedCourses = repositoryManager.countPublished(CourseModule.ORES_TYPE_COURSE);
 		msgProperties.put("courses", String.valueOf(allCourses));
 		msgProperties.put("coursesPublished", String.valueOf(publishedCourses));
 		
diff --git a/src/main/java/org/olat/basesecurity/BaseSecurityManager.java b/src/main/java/org/olat/basesecurity/BaseSecurityManager.java
index 3e973f57ea2..f1ab9b3455b 100644
--- a/src/main/java/org/olat/basesecurity/BaseSecurityManager.java
+++ b/src/main/java/org/olat/basesecurity/BaseSecurityManager.java
@@ -250,10 +250,10 @@ public class BaseSecurityManager implements BaseSecurity, UserDataDeletable {
 	
 	private void updateRoles(Organisation organisation, RolesByOrganisation roles, List<String> currentRoles, OrganisationRoles role,
 			Identity actingIdentity, Identity updatedIdentity) {
-		boolean hasBeenAdmin = currentRoles.contains(role.name());
-		boolean isOLATAdmin = roles.hasRole(role) && !roles.isGuestOnly() && !roles.isInvitee();
+		boolean hasBeenRole = currentRoles.contains(role.name());
+		boolean isRole = roles.hasRole(role) && !roles.isGuestOnly() && !roles.isInvitee();
 		updateRolesInOrganisation(organisation, actingIdentity, updatedIdentity,
-				role, hasBeenAdmin, isOLATAdmin);	
+				role, hasBeenRole, isRole);	
 	}
 	
 	private void updateRolesInOrganisation(Organisation organisation, Identity actingIdentity, Identity updatedIdentity,
diff --git a/src/main/java/org/olat/commons/calendar/notification/CalendarNotificationHandler.java b/src/main/java/org/olat/commons/calendar/notification/CalendarNotificationHandler.java
index 35e74c50c24..4decf30ae34 100644
--- a/src/main/java/org/olat/commons/calendar/notification/CalendarNotificationHandler.java
+++ b/src/main/java/org/olat/commons/calendar/notification/CalendarNotificationHandler.java
@@ -49,6 +49,7 @@ import org.olat.course.CourseModule;
 import org.olat.group.BusinessGroup;
 import org.olat.group.manager.BusinessGroupDAO;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -100,7 +101,8 @@ public class CalendarNotificationHandler implements NotificationsHandler {
 				String title = null;
 				if (type.equals(CalendarController.ACTION_CALENDAR_COURSE)) {
 					RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(OresHelper.createOLATResourceableInstance("CourseModule", id), false);
-					if(re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+					RepositoryEntryStatusEnum status = re.getEntryStatus();
+					if(status.decommissioned()) {
 						return NotificationsManager.getInstance().getNoSubscriptionInfo();
 					}
 					String displayName = re.getDisplayname();
diff --git a/src/main/java/org/olat/commons/info/notification/InfoMessageNotificationHandler.java b/src/main/java/org/olat/commons/info/notification/InfoMessageNotificationHandler.java
index 4bfd1c14fc5..f26d0797be8 100644
--- a/src/main/java/org/olat/commons/info/notification/InfoMessageNotificationHandler.java
+++ b/src/main/java/org/olat/commons/info/notification/InfoMessageNotificationHandler.java
@@ -46,6 +46,7 @@ import org.olat.core.util.resource.OresHelper;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -85,7 +86,8 @@ public class InfoMessageNotificationHandler implements NotificationsHandler {
 				final String resName = subscriber.getPublisher().getResName();
 				String resSubPath = subscriber.getPublisher().getSubidentifier();
 				
-				String displayName, notificationtitle;
+				String displayName;
+				String notificationtitle;
 				if ("BusinessGroup".equals(resName)) {
 					BusinessGroupService groupService = CoreSpringFactory.getImpl(BusinessGroupService.class);
 					BusinessGroup group = groupService.loadBusinessGroup(resId);
@@ -93,7 +95,9 @@ public class InfoMessageNotificationHandler implements NotificationsHandler {
 					notificationtitle = "notification.title.group";
 				} else {
 					RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(OresHelper.createOLATResourceableInstance(resName, resId), false);
-					if(re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+					if(re== null || re.getEntryStatus() == RepositoryEntryStatusEnum.closed
+							|| re.getEntryStatus() == RepositoryEntryStatusEnum.trash
+							|| re.getEntryStatus() == RepositoryEntryStatusEnum.deleted) {
 						return NotificationsManager.getInstance().getNoSubscriptionInfo();
 					}					
 					displayName = re.getDisplayname();	
diff --git a/src/main/java/org/olat/core/commons/modules/bc/notifications/FolderNotificationsHandler.java b/src/main/java/org/olat/core/commons/modules/bc/notifications/FolderNotificationsHandler.java
index ab718ce7f56..3c47e0bb1b9 100644
--- a/src/main/java/org/olat/core/commons/modules/bc/notifications/FolderNotificationsHandler.java
+++ b/src/main/java/org/olat/core/commons/modules/bc/notifications/FolderNotificationsHandler.java
@@ -94,7 +94,7 @@ public class FolderNotificationsHandler implements NotificationsHandler {
 			if (NotificationsManager.getInstance().isPublisherValid(p) && compareDate.before(latestNews)) {
 				if("CourseModule".equals(p.getResName())) {
 					RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(OresHelper.createOLATResourceableInstance(p.getResName(), p.getResId()), false);
-					if(re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+					if(re == null || re.getEntryStatus().decommissioned()) {
 						return NotificationsManager.getInstance().getNoSubscriptionInfo();
 					}
 				}
diff --git a/src/main/java/org/olat/core/commons/persistence/NativeQueryBuilder.java b/src/main/java/org/olat/core/commons/persistence/NativeQueryBuilder.java
index 7afc78d295a..19a7554505d 100644
--- a/src/main/java/org/olat/core/commons/persistence/NativeQueryBuilder.java
+++ b/src/main/java/org/olat/core/commons/persistence/NativeQueryBuilder.java
@@ -155,10 +155,54 @@ public class NativeQueryBuilder {
 		sb.append(String.valueOf(sMin));
 		return this;
 	}
+	
+	public NativeQueryBuilder append(Object o) {
+		sb.append(o);
+		return this;
+	}
+	
+	public NativeQueryBuilder in(Object... objects) {
+		if(objects != null && objects.length > 0) {
+			sb.append(" in ('");
+			boolean first = true;
+			for(Object object:objects) {
+				if(object != null) {
+					if(first) {
+						first = false;
+					} else {
+						sb.append("','");
+					}
+					sb.append(object);
+				}
+			}
+			sb.append("')");
+		}
+		return this;
+	}
+	
+	public NativeQueryBuilder in(Enum<?>... objects) {
+		if(objects != null && objects.length > 0) {
+			if(objects.length == 1) {
+				sb.append(" ='").append(objects[0].name()).append("' ");
+			} else {
+				sb.append(" in ('");
+				boolean first = true;
+				for(Enum<?> object:objects) {
+					if(object != null) {
+						if(first) {
+							first = false;
+						} else {
+							sb.append("','");
+						}
+						sb.append(object.name());
+					}
+				}
+				sb.append("')");
+			}
+		}
+		return this;
+	}
 
-	/**
-	 * @see java.lang.Object#toString()
-	 */
 	@Override
 	public String toString() {
 		return sb.toString();
diff --git a/src/main/java/org/olat/core/commons/persistence/PersistenceHelper.java b/src/main/java/org/olat/core/commons/persistence/PersistenceHelper.java
index 50c9c701ee0..a7bcbb424f0 100644
--- a/src/main/java/org/olat/core/commons/persistence/PersistenceHelper.java
+++ b/src/main/java/org/olat/core/commons/persistence/PersistenceHelper.java
@@ -26,6 +26,7 @@
 
 package org.olat.core.commons.persistence;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -33,6 +34,8 @@ import java.util.List;
 import java.util.Properties;
 
 import org.olat.core.id.Persistable;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.core.util.Formatter;
 import org.olat.core.util.StringHelper;
 import org.olat.core.util.filter.FilterFactory;
@@ -46,6 +49,8 @@ import org.olat.core.util.filter.FilterFactory;
  * @author gnaegi 
  */
 public class PersistenceHelper {
+	
+	private static final OLog log = Tracing.createLoggerFor(PersistenceHelper.class);
 	private static boolean charCountNativeUTF8 = true;
 	
 	/**
@@ -143,16 +148,21 @@ public class PersistenceHelper {
 		return appended;
 	}
 	
-	public static final void appendFuzzyLike(StringBuilder sb, String var, String key, String dbVendor) {
-		if(dbVendor.equals("mysql")) {
-			sb.append(" ").append(var).append(" like :").append(key);
-		} else {
-			sb.append(" lower(").append(var).append(") like :").append(key);
-		}
-		if(dbVendor.equals("oracle")) {
-			sb.append(" escape '\\'");
+	public static final void appendFuzzyLike(Appendable sb, String var, String key, String dbVendor) {
+		try {
+			if(dbVendor.equals("mysql")) {
+				sb.append(" ").append(var).append(" like :").append(key);
+			} else {
+				sb.append(" lower(").append(var).append(") like :").append(key);
+			}
+			if(dbVendor.equals("oracle")) {
+				sb.append(" escape '\\'");
+			}
+		} catch (IOException e) {
+			log.error("", e);
 		}
 	}
+
 	
 	/**
 	 * Helper method that replaces * with % and appends and
diff --git a/src/main/java/org/olat/core/commons/persistence/QueryBuilder.java b/src/main/java/org/olat/core/commons/persistence/QueryBuilder.java
new file mode 100644
index 00000000000..680db408ff6
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/persistence/QueryBuilder.java
@@ -0,0 +1,193 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.core.commons.persistence;
+
+/**
+ * 
+ * Initial date: 21 juil. 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class QueryBuilder implements Appendable {
+
+	private boolean and = false;
+	private final StringBuilder sb;
+
+	/**
+	 * @param len
+	 */
+	public QueryBuilder(int len) {
+		sb = new StringBuilder(len);
+	}
+
+	/**
+	 * 
+	 */
+	public QueryBuilder() {
+		sb = new StringBuilder(128);
+	}
+
+	/**
+	 * @param val
+	 * @return Itself
+	 */
+	public QueryBuilder append(String val) {
+		sb.append(val);
+		return this;
+	}
+	
+	/**
+	 * 
+	 * @param val The value to append
+	 * @param append If true append happens, if false not
+	 * @return Itself
+	 */
+	public QueryBuilder append(String val, boolean append) {
+		if(append) {
+			sb.append(val);
+		}
+		return this;
+	}
+	
+	@Override
+	public QueryBuilder append(CharSequence csq) {
+		sb.append(csq);
+		return this;
+	}
+
+	@Override
+	public QueryBuilder append(CharSequence csq, int start, int end) {
+		sb.append(csq, start, end);
+		return this;
+	}
+
+	@Override
+	public QueryBuilder append(char c) {
+		sb.append(c);
+		return this;
+	}
+
+	public QueryBuilder append(String valTrue, String valFalse, boolean choice) {
+		if(choice) {
+			sb.append(valTrue);
+		} else {
+			sb.append(valFalse);
+		}
+		return this;
+	}
+
+	/**
+	 * @param i
+	 * @return Itself
+	 */
+	public QueryBuilder append(int i) {
+		sb.append(i);
+		return this;
+	}
+
+	/**
+	 * @param sMin
+	 * @return Itself
+	 */
+	public QueryBuilder append(long sMin) {
+		sb.append(sMin);
+		return this;
+	}
+	
+	/**
+	 * @param b The boolean
+	 * @return Itself
+	 */
+	public QueryBuilder append(boolean b) {
+		sb.append(b);
+		return this;
+	}
+	
+	/**
+	 * @param o The object
+	 * @return Itself
+	 */
+	public QueryBuilder append(Object o) {
+		sb.append(o);
+		return this;
+	}
+	
+	public QueryBuilder and() {
+		if(and) {
+			sb.append(" and ");
+		} else {
+			and = true;
+			sb.append(" where ");
+		}
+		return this;
+	}
+	
+	public QueryBuilder in(Object... objects) {
+		if(objects != null && objects.length > 0) {
+			sb.append(" in ('");
+			boolean first = true;
+			for(Object object:objects) {
+				if(object != null) {
+					if(first) {
+						first = false;
+					} else {
+						sb.append("','");
+					}
+					sb.append(object);
+				}
+			}
+			sb.append("')");
+		}
+		return this;
+	}
+	
+	public QueryBuilder in(Enum<?>... objects) {
+		if(objects != null && objects.length > 0) {
+			sb.append(" in ('");
+			boolean first = true;
+			for(Enum<?> object:objects) {
+				if(object != null) {
+					if(first) {
+						first = false;
+					} else {
+						sb.append("','");
+					}
+					sb.append(object.name());
+				}
+			}
+			sb.append("')");
+		}
+		return this;
+	}
+	
+	public QueryBuilder appendAsc(boolean asc) {
+		if(asc) {
+			sb.append(" asc");
+		} else {
+			sb.append(" desc");
+		}
+		return this;
+	}
+
+	@Override
+	public String toString() {
+		return sb.toString();
+	}
+}
diff --git a/src/main/java/org/olat/core/commons/services/mark/ui/Bookmark.java b/src/main/java/org/olat/core/commons/services/mark/ui/Bookmark.java
index 94d3ca7e1e6..147ef475629 100644
--- a/src/main/java/org/olat/core/commons/services/mark/ui/Bookmark.java
+++ b/src/main/java/org/olat/core/commons/services/mark/ui/Bookmark.java
@@ -25,6 +25,7 @@ import org.olat.core.commons.services.mark.Mark;
 import org.olat.core.id.OLATResourceable;
 import org.olat.group.BusinessGroup;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 
 /**
  * Internal wrapper
@@ -39,13 +40,13 @@ class Bookmark {
 	private final String description;
 	private final Date creationDate;
 	private final String displayrestype;
-	private int statusCode;
+	private RepositoryEntryStatusEnum status;
 	
 	public Bookmark(Mark mark, RepositoryEntry entry) {
 		this.mark = mark;
 		title = entry.getDisplayname();
 		description = entry.getDescription();
-		statusCode = entry.getStatusCode();
+		status = entry.getEntryStatus();
 		creationDate = entry.getCreationDate();
 		displayrestype = entry.getOlatResource().getResourceableTypeName();
 	}
@@ -54,7 +55,7 @@ class Bookmark {
 		this.mark = mark;
 		title = group.getName();
 		description = group.getDescription();
-		statusCode = -1;
+		status = null;
 		creationDate = group.getCreationDate();
 		displayrestype = group.getResourceableTypeName();
 	}
@@ -79,8 +80,8 @@ class Bookmark {
 		return displayrestype;
 	}
 	
-	public int getStatusCode() {
-		return statusCode;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return status;
 	}
 	
 	public OLATResourceable getOLATResourceable() {
diff --git a/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksController.java b/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksController.java
index 1a6641b9861..5aa51118eaa 100644
--- a/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksController.java
+++ b/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksController.java
@@ -226,7 +226,7 @@ public class BookmarksController extends BasicController {
 		 */
 		private String getBookmarkTitle(Bookmark bookmark) {
 			String title = bookmark.getTitle();
-			if (new RepositoryEntryStatus(bookmark.getStatusCode()).isClosed() || new RepositoryEntryStatus(bookmark.getStatusCode()).isUnpublished()) {
+			if (bookmark.getEntryStatus().decommissioned()) {
 				Translator pT = Util.createPackageTranslator(RepositoryEntryStatus.class, locale);
 				title = "[" + pT.translate("title.prefix.closed") + "] ".concat(title);
 			}
diff --git a/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksPortletRunController.java b/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksPortletRunController.java
index 8a88272de99..f16b81fb0cf 100644
--- a/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksPortletRunController.java
+++ b/src/main/java/org/olat/core/commons/services/mark/ui/BookmarksPortletRunController.java
@@ -64,6 +64,7 @@ import org.olat.core.util.Util;
 import org.olat.core.util.filter.FilterFactory;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 
 /**
@@ -144,7 +145,7 @@ public class BookmarksPortletRunController extends AbstractPortletRunController<
 	 * @return
 	 */
 	private List<PortletEntry<Bookmark>> convertBookmarkToPortletEntryList(List<Bookmark> items) {
-		List<PortletEntry<Bookmark>> convertedList = new ArrayList<PortletEntry<Bookmark>>();
+		List<PortletEntry<Bookmark>> convertedList = new ArrayList<>();
 		for(Bookmark mark:items) {
 			convertedList.add(new BookmarkPortletEntry(mark));
 		}
@@ -152,9 +153,9 @@ public class BookmarksPortletRunController extends AbstractPortletRunController<
 	}
 	
 	private  List<Bookmark> convertMarkToBookmark(List<Mark> items) {
-		List<Bookmark> convertedList = new ArrayList<Bookmark>();
+		List<Bookmark> convertedList = new ArrayList<>();
 		
-		List<Long> reKeys = new ArrayList<Long>();
+		List<Long> reKeys = new ArrayList<>();
 		for(Mark mark:items) {
 			reKeys.add(mark.getOLATResourceable().getResourceableId());
 		}
@@ -336,7 +337,8 @@ public class BookmarksPortletRunController extends AbstractPortletRunController<
 		private String getBookmarkTitle(Bookmark bookmark) {
 			String title = bookmark.getTitle();
 			
-			if (RepositoryManager.getInstance().createRepositoryEntryStatus(bookmark.getStatusCode()).isClosed()) {
+			RepositoryEntryStatusEnum status = bookmark.getEntryStatus();
+			if (status.decommissioned()) {
 				Translator pT = Util.createPackageTranslator(RepositoryEntryStatus.class, locale);
 				title = "[" + pT.translate("title.prefix.closed") + "] ".concat(title);
 			}
diff --git a/src/main/java/org/olat/core/id/context/HistoryManager.java b/src/main/java/org/olat/core/id/context/HistoryManager.java
index 15993fb9a71..674b1c9c1fd 100644
--- a/src/main/java/org/olat/core/id/context/HistoryManager.java
+++ b/src/main/java/org/olat/core/id/context/HistoryManager.java
@@ -74,6 +74,11 @@ public class HistoryManager {
 		historyReadStream.omitField(RepositoryEntry.class, "organisations");
 		historyReadStream.omitField(RepositoryEntry.class, "storedSnapshot");
 		historyReadStream.omitField(RepositoryEntry.class, "statistics");
+		historyReadStream.omitField(RepositoryEntry.class, "access");
+		historyReadStream.omitField(RepositoryEntry.class, "statusCode");
+		historyReadStream.omitField(RepositoryEntry.class, "canLaunch");
+		historyReadStream.omitField(RepositoryEntry.class, "membersOnly");
+		
 		historyReadStream.omitField(org.olat.core.commons.persistence.PersistentObject.class, "version");
 		
 		historyReadStream.alias("org.olat.core.util.resource.OresHelper$1", Resourceable.class);
diff --git a/src/main/java/org/olat/course/CourseFactory.java b/src/main/java/org/olat/course/CourseFactory.java
index 32303428d76..17a36fe8798 100644
--- a/src/main/java/org/olat/course/CourseFactory.java
+++ b/src/main/java/org/olat/course/CourseFactory.java
@@ -126,6 +126,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.instantMessaging.InstantMessagingService;
 import org.olat.instantMessaging.manager.ChatLogHelper;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -566,20 +567,12 @@ public class CourseFactory {
 	 * @param locale
 	 * @param identity
 	 */
-	public static void publishCourse(ICourse course, int access, boolean membersOnly, Identity identity, Locale locale) {
+	public static void publishCourse(ICourse course, RepositoryEntryStatusEnum accessStatus, boolean allUsers, boolean guests,
+			Identity identity, Locale locale) {
 		 CourseEditorTreeModel cetm = course.getEditorTreeModel();
 		 PublishProcess publishProcess = PublishProcess.getInstance(course, cetm, locale);
 		 PublishTreeModel publishTreeModel = publishProcess.getPublishTreeModel();
-
-		 int newAccess = (access < RepositoryEntry.ACC_OWNERS || access > RepositoryEntry.ACC_USERS_GUESTS)
-				 ? RepositoryEntry.ACC_USERS : access;
-		 //access rule -> all users can the see course
-		 //RepositoryEntry.ACC_OWNERS
-		 //only owners can the see course
-		 //RepositoryEntry.ACC_OWNERS_AUTHORS //only owners and authors can the see course
-		 //RepositoryEntry.ACC_USERS_GUESTS // users and guests can see the course
-		 //fxdiff VCRP-1,2: access control of resources
-		 publishProcess.changeGeneralAccess(identity, newAccess, membersOnly);
+		 publishProcess.changeGeneralAccess(identity, accessStatus, allUsers, guests);
 
 		 if (publishTreeModel.hasPublishableChanges()) {
 			 List<String>nodeToPublish = new ArrayList<>();
@@ -655,12 +648,12 @@ public class CourseFactory {
 		File exportDirectory = CourseFactory.getOrCreateDataExportDirectory(identity, course.getCourseTitle());
 		
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
-		boolean isOLATAdmin = roles.isAdministrator()
+		boolean isAdministrator = roles.isAdministrator()
 				&& repositoryService.hasRoleExpanded(identity, courseRe, OrganisationRoles.administrator.name());
 		boolean isOresOwner = repositoryService.hasRole(identity, courseRe, GroupRoles.owner.name());
 		boolean isOresInstitutionalManager = roles.isLearnResourceManager()
 				&& repositoryService.hasRoleExpanded(identity, courseRe, OrganisationRoles.learnresourcemanager.name());
-		archiveCourse(identity, course, charset, locale, exportDirectory, isOLATAdmin, isOresOwner, isOresInstitutionalManager);
+		archiveCourse(identity, course, charset, locale, exportDirectory, isAdministrator, isOresOwner, isOresInstitutionalManager);
 	}
 
 	/**
@@ -672,7 +665,7 @@ public class CourseFactory {
 	 * @param locale
 	 * @param identity
 	 */
-	public static void archiveCourse(Identity archiveOnBehalfOf, ICourse course, String charset, Locale locale, File exportDirectory, boolean isOLATAdmin, boolean... oresRights) {
+	public static void archiveCourse(Identity archiveOnBehalfOf, ICourse course, String charset, Locale locale, File exportDirectory, boolean isAdministrator, boolean... oresRights) {
 		// archive course results overview
 		List<Identity> users = ScoreAccountingHelper.loadUsers(course.getCourseEnvironment());
 		List<AssessableCourseNode> nodes = ScoreAccountingHelper.loadAssessableNodes(course.getCourseEnvironment());
@@ -694,9 +687,9 @@ public class CourseFactory {
 		boolean isOresOwner = (oresRights.length > 0)?oresRights[0]:false;
 		boolean isOresInstitutionalManager = (oresRights.length > 1)?oresRights[1]:false;
 
-		boolean aLogV = isOresOwner || isOresInstitutionalManager || isOLATAdmin;
-		boolean uLogV = isOLATAdmin;
-		boolean sLogV = isOresOwner || isOresInstitutionalManager || isOLATAdmin;
+		boolean aLogV = isOresOwner || isOresInstitutionalManager || isAdministrator;
+		boolean uLogV = isAdministrator;
+		boolean sLogV = isOresOwner || isOresInstitutionalManager || isAdministrator;
 
 		// make an intermediate commit here to make sure long running course log export doesn't
 		// cause db connection timeout to be triggered
diff --git a/src/main/java/org/olat/course/CoursefolderWebDAVMergeSource.java b/src/main/java/org/olat/course/CoursefolderWebDAVMergeSource.java
index e37f28407db..aa85cde2fb3 100644
--- a/src/main/java/org/olat/course/CoursefolderWebDAVMergeSource.java
+++ b/src/main/java/org/olat/course/CoursefolderWebDAVMergeSource.java
@@ -37,6 +37,7 @@ import org.olat.core.util.vfs.NamedContainerImpl;
 import org.olat.core.util.vfs.VFSContainer;
 import org.olat.core.util.vfs.VirtualContainer;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 
@@ -71,7 +72,7 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource {
 		boolean useTerms = webDAVModule.isTermsFoldersEnabled();
 		if (useTerms) {
 			// prepare no-terms folder for all resources without semester term info or private date
-			terms = new HashMap<String, VFSContainer>();
+			terms = new HashMap<>();
 			noTermContainer = new VirtualContainer("_other");
 		} else {
 			finishedContainer = new VirtualContainer("_finished");
@@ -96,10 +97,10 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource {
 
 		if (useTerms) {
 			// add no-terms folder if any have been found
-			if (noTermContainer.getItems().size() > 0) {
+			if (!noTermContainer.getItems().isEmpty()) {
 				addContainerToList(noTermContainer, containers);
 			}
-		} else if(finishedContainer.getItems().size() > 0) {
+		} else if(!finishedContainer.getItems().isEmpty()) {
 			addContainerToList(finishedContainer, containers);
 		}
 
@@ -123,7 +124,7 @@ class CoursefolderWebDAVMergeSource extends WebDAVMergeSource {
 			}
 			String courseTitle = RequestUtil.normalizeFilename(displayName);
 			
-			if(finishedContainer != null && re.getRepositoryEntryStatus().isClosed()) {
+			if(finishedContainer != null && re.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 				String name = container.getFinishedUniqueName(courseTitle);
 				NamedContainerImpl cfContainer = new CoursefolderWebDAVNamedContainer(name, re, editor ? null : identityEnv);
 				finishedContainer.getItems().add(cfContainer);
diff --git a/src/main/java/org/olat/course/MergedCourseContainer.java b/src/main/java/org/olat/course/MergedCourseContainer.java
index d406ecd67f0..61285987fe2 100644
--- a/src/main/java/org/olat/course/MergedCourseContainer.java
+++ b/src/main/java/org/olat/course/MergedCourseContainer.java
@@ -80,7 +80,7 @@ public class MergedCourseContainer extends MergeSource {
 		super.init();
 		
 		RepositoryEntry courseRe = persistingCourse.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
-		courseReadOnly = !overrideReadOnly && (courseRe.getRepositoryEntryStatus().isClosed() || courseRe.getRepositoryEntryStatus().isUnpublished());
+		courseReadOnly = !overrideReadOnly && courseRe.getEntryStatus().decommissioned();
 		if(courseReadOnly) {
 			setLocalSecurityCallback(new ReadOnlyCallback());
 		}
diff --git a/src/main/java/org/olat/course/archiver/CourseLogsArchiveController.java b/src/main/java/org/olat/course/archiver/CourseLogsArchiveController.java
index 5e022505eab..cb9090f86b1 100644
--- a/src/main/java/org/olat/course/archiver/CourseLogsArchiveController.java
+++ b/src/main/java/org/olat/course/archiver/CourseLogsArchiveController.java
@@ -99,21 +99,21 @@ public class CourseLogsArchiveController extends BasicController {
 		Roles roles = ureq.getUserSession().getRoles();
 		
 		RepositoryEntry re = repositoryManager.lookupRepositoryEntry(ores, false);
-		boolean isOLATAdmin = roles.isAdministrator()
+		boolean isAdministrator = roles.isAdministrator()
 				&& repositoryService.hasRoleExpanded(getIdentity(), re, OrganisationRoles.administrator.name());
 		boolean isOresOwner = repositoryService.hasRole(getIdentity(), re, GroupRoles.owner.name());
 		boolean isOresInstitutionalManager = roles.isLearnResourceManager()
 				&& repositoryService.hasRoleExpanded(getIdentity(), re, OrganisationRoles.learnresourcemanager.name());
 		boolean aLogV = isOresOwner || isOresInstitutionalManager;
-		boolean uLogV = isOLATAdmin;
+		boolean uLogV = isAdministrator;
 		boolean sLogV = isOresOwner || isOresInstitutionalManager;
 		
 		if (asyncExportManager.asyncArchiveCourseLogOngoingFor(getIdentity())) {
 			// then show the ongoing feedback
 			showExportOngoing(false);
-		} else if (isOLATAdmin || aLogV || uLogV || sLogV){
+		} else if (isAdministrator || aLogV || uLogV || sLogV){
 			myContent.contextPut("hasLogArchiveAccess", true);
-			logFileChooserForm = new LogFileChooserForm(ureq, wControl, isOLATAdmin, aLogV, uLogV, sLogV);
+			logFileChooserForm = new LogFileChooserForm(ureq, wControl, isAdministrator, aLogV, uLogV, sLogV);
 			listenTo(logFileChooserForm);
 			myContent.put("logfilechooserform",logFileChooserForm.getInitialComponent());
 			ICourse course = CourseFactory.loadCourse(ores);
diff --git a/src/main/java/org/olat/course/archiver/LogFileChooserForm.java b/src/main/java/org/olat/course/archiver/LogFileChooserForm.java
index a316110467a..11eed502123 100644
--- a/src/main/java/org/olat/course/archiver/LogFileChooserForm.java
+++ b/src/main/java/org/olat/course/archiver/LogFileChooserForm.java
@@ -55,16 +55,16 @@ public class LogFileChooserForm extends FormBasicController {
      * 
      * @param ureq
      * @param wControl
-     * @param isOLATAdmin
+     * @param isAdministrator
      * @param a adminLogVisibility
      * @param u userLogVisibility
      * @param s statisticLogVisibility
      */
     
-    public LogFileChooserForm(UserRequest ureq, WindowControl wControl, boolean isOLATAdmin, boolean a, boolean u, boolean s) {
+    public LogFileChooserForm(UserRequest ureq, WindowControl wControl, boolean isAdministrator, boolean a, boolean u, boolean s) {
         super(ureq, wControl);
         
-        this.admin = isOLATAdmin;
+        this.admin = isAdministrator;
         
         this.u = u;
         this.a = a; 
@@ -73,9 +73,7 @@ public class LogFileChooserForm extends FormBasicController {
         initForm (ureq);
     }
     
-    /**
-     * @see org.olat.core.gui.components.Form#validate(org.olat.core.gui.UserRequest)
-     */
+    @Override
     public boolean validateFormLogic(UserRequest ureq) {
     	boolean logChecked = false;
     	boolean beginLessThanEndOk = true;
diff --git a/src/main/java/org/olat/course/assessment/manager/AssessmentNotificationsHandler.java b/src/main/java/org/olat/course/assessment/manager/AssessmentNotificationsHandler.java
index abd5b2269b7..e04d332af36 100644
--- a/src/main/java/org/olat/course/assessment/manager/AssessmentNotificationsHandler.java
+++ b/src/main/java/org/olat/course/assessment/manager/AssessmentNotificationsHandler.java
@@ -289,8 +289,7 @@ public class AssessmentNotificationsHandler implements NotificationsHandler {
 	
 	private boolean courseStatus(ICourse course) {
 		return course != null
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isUnpublished()
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed();
+				&& course.getCourseEnvironment().getCourseGroupManager().isNotificationsAllowed();
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/course/certificate/manager/CertificationNotificationHandler.java b/src/main/java/org/olat/course/certificate/manager/CertificationNotificationHandler.java
index baf81801d77..4d12dd4f129 100644
--- a/src/main/java/org/olat/course/certificate/manager/CertificationNotificationHandler.java
+++ b/src/main/java/org/olat/course/certificate/manager/CertificationNotificationHandler.java
@@ -121,8 +121,7 @@ public class CertificationNotificationHandler implements NotificationsHandler {
 	
 	private boolean courseStatus(ICourse course) {
 		return course != null
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isUnpublished()
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed();
+				&& course.getCourseEnvironment().getCourseGroupManager().isNotificationsAllowed();
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementListController.java b/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementListController.java
index afc4008d6e1..2c17b817369 100644
--- a/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementListController.java
+++ b/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementListController.java
@@ -366,7 +366,7 @@ public class CertificateAndEfficiencyStatementListController extends FormBasicCo
 		RepositoryEntry entry = repositoryService.loadByResourceKey(resourceKey);
 		if(entry == null) {
 			showWarning("efficiencyStatements.course.noexists");
-		} else if (!repositoryManager.isAllowedToLaunch(ureq, entry)) {
+		} else if (!repositoryManager.isAllowedToLaunch(getIdentity(), ureq.getUserSession().getRoles(), entry)) {
 			showWarning("efficiencyStatements.course.noaccess");
 		} else {
 			try {
diff --git a/src/main/java/org/olat/course/editor/CourseAccessAndProperties.java b/src/main/java/org/olat/course/editor/CourseAccessAndProperties.java
index e824947d118..b5f33abbbde 100644
--- a/src/main/java/org/olat/course/editor/CourseAccessAndProperties.java
+++ b/src/main/java/org/olat/course/editor/CourseAccessAndProperties.java
@@ -23,6 +23,7 @@ import java.util.List;
 
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryAllowToLeaveOptions;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.accesscontrol.Offer;
 import org.olat.resource.accesscontrol.OfferAccess;
 /**
@@ -33,8 +34,9 @@ import org.olat.resource.accesscontrol.OfferAccess;
 public class CourseAccessAndProperties {
 	private RepositoryEntry repoEntry;
 	private RepositoryEntryAllowToLeaveOptions setting;
-	private int access;
-	private boolean membersOnly;
+	private RepositoryEntryStatusEnum status;
+	private boolean allUsers;
+	private boolean guests;
 	private boolean canCopy;
 	private boolean canReference;
 	private boolean canDownload;	
@@ -47,12 +49,14 @@ public class CourseAccessAndProperties {
 		this.repoEntry = re;
 	}
 	
-	public CourseAccessAndProperties(RepositoryEntry re, RepositoryEntryAllowToLeaveOptions setting, int access,
-			boolean membersOnly, boolean canCopy, boolean canReference, boolean canDownload) {
+	public CourseAccessAndProperties(RepositoryEntry re, RepositoryEntryAllowToLeaveOptions setting,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests,
+			boolean canCopy, boolean canReference, boolean canDownload) {
 		this.repoEntry = re;
 		this.setting = setting;
-		this.access = access;
-		this.membersOnly = membersOnly;
+		this.status = status;
+		this.allUsers = allUsers;
+		this.guests = guests;
 		this.canCopy = canCopy;
 		this.canReference = canReference;
 		this.canDownload = canDownload;
@@ -90,20 +94,28 @@ public class CourseAccessAndProperties {
 		this.setting = setting;
 	}
 
-	public int getAccess() {
-		return access;
+	public RepositoryEntryStatusEnum getStatus() {
+		return status;
 	}
 
-	public void setAccess(int access) {
-		this.access = access;
+	public void setStatus(RepositoryEntryStatusEnum status) {
+		this.status = status;
 	}
 
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
-	public void setMembersOnly(boolean membersOnly) {
-		this.membersOnly = membersOnly;
+	public void setAllUsers(boolean allUsers) {
+		this.allUsers = allUsers;
+	}
+
+	public boolean isGuests() {
+		return guests;
+	}
+
+	public void setGuests(boolean guests) {
+		this.guests = guests;
 	}
 
 	public boolean isCanCopy() {
diff --git a/src/main/java/org/olat/course/editor/PublishProcess.java b/src/main/java/org/olat/course/editor/PublishProcess.java
index 72c0f258557..684a1dbe4fa 100644
--- a/src/main/java/org/olat/course/editor/PublishProcess.java
+++ b/src/main/java/org/olat/course/editor/PublishProcess.java
@@ -73,6 +73,7 @@ import org.olat.course.tree.PublishTreeModel;
 import org.olat.properties.Property;
 import org.olat.repository.CatalogEntry;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.controllers.EntryChangedEvent;
@@ -698,8 +699,8 @@ public class PublishProcess {
 		return publishTreeModel;
 	}
 
-	public void changeGeneralAccess(Identity author, int access, boolean membersOnly) {
-		RepositoryManager.getInstance().setAccess(repositoryEntry, access, membersOnly);
+	public void changeGeneralAccess(Identity author, RepositoryEntryStatusEnum access, boolean allUsers, boolean guests) {
+		RepositoryManager.getInstance().setAccess(repositoryEntry, access, allUsers, guests);
 		MultiUserEvent modifiedEvent = new EntryChangedEvent(repositoryEntry, author, Change.modifiedAtPublish, "publish");
 		CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, repositoryEntry);
 	}
@@ -707,9 +708,9 @@ public class PublishProcess {
 	public void changeAccessAndProperties(Identity author, CourseAccessAndProperties accessAndProps) {
 		RepositoryManager manager = RepositoryManager.getInstance();
 		
-		manager.setAccessAndProperties(accessAndProps.getRepositoryEntry(), accessAndProps.getAccess(),
-				accessAndProps.isMembersOnly(), accessAndProps.isCanCopy(), accessAndProps.isCanReference(),
-				accessAndProps.isCanDownload());
+		manager.setAccessAndProperties(accessAndProps.getRepositoryEntry(),
+				accessAndProps.getStatus(), accessAndProps.isAllUsers(), accessAndProps.isGuests(),
+				accessAndProps.isCanCopy(), accessAndProps.isCanReference(), accessAndProps.isCanDownload());
 		manager.setLeaveSetting(accessAndProps.getRepositoryEntry(), accessAndProps.getSetting());
 		
 		List<OfferAccess> offerAccess = accessAndProps.getOfferAccess();
diff --git a/src/main/java/org/olat/course/editor/PublishStep01AccessForm.java b/src/main/java/org/olat/course/editor/PublishStep01AccessForm.java
index 2ed67bc1dd0..a3835b13e03 100644
--- a/src/main/java/org/olat/course/editor/PublishStep01AccessForm.java
+++ b/src/main/java/org/olat/course/editor/PublishStep01AccessForm.java
@@ -55,6 +55,7 @@ import org.olat.login.LoginModule;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryAllowToLeaveOptions;
 import org.olat.repository.RepositoryEntryManagedFlag;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
@@ -82,8 +83,10 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 			RepositoryEntryAllowToLeaveOptions.afterEndDate.name(),
 			RepositoryEntryAllowToLeaveOptions.never.name()
 		};
-	
+
+	private static final String YES_KEY = "y";
 	private static final String[] onKeys = new String[] { "on" };
+	private static final String[] yesKeys = new String[] { YES_KEY };
 	
 	private SingleSelection leaveEl;
 	
@@ -91,22 +94,13 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 	private SelectionElement canCopy;
 	private SelectionElement canReference;
 	private SelectionElement canDownload;
+	private SelectionElement allUsers;
+	private SelectionElement guests;
+	private SingleSelection publishedStatus;
+	private FormLayoutContainer accessLayout;
 	
 	private RepositoryHandler handler;
 
-	private SingleSelection authorsSwitch, usersSwitch;
-	private SingleSelection publishedForUsers;
-	private FormLayoutContainer authorConfigLayout, userConfigLayout, accessLayout;
-	
-	private static final String YES_KEY = "y";
-	private static final String NO_KEY = "n";
-	private final String[] yesNoKeys = new String[]{YES_KEY, NO_KEY};
-
-	private static final String OAU_KEY = "u";
-	private static final String OAUG_KEY = "g";
-	private static final String MEMBERSONLY_KEY = "m";
-	private String[] publishedKeys;
-	
 	private MultipleSelectionElement confirmationEmailEl;
 	private List<FormLink> addMethods = new ArrayList<>();
 	private List<OfferAccess> offerAccess = new ArrayList<>();
@@ -115,7 +109,8 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 	
 	private CloseableModalController cmc;
 	private FormLayoutContainer confControllerContainer;
-	private AbstractConfigurationMethodController newMethodCtrl, editMethodCtrl;
+	private AbstractConfigurationMethodController newMethodCtrl;
+	private AbstractConfigurationMethodController editMethodCtrl;
 	
 	private final List<AccessInfo> confControllers = new ArrayList<>();
 	
@@ -167,10 +162,13 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 			setting = RepositoryEntryAllowToLeaveOptions.valueOf(leaveEl.getSelectedKey());
 		} else {
 			setting = RepositoryEntryAllowToLeaveOptions.atAnyTime;
-		}			
-		boolean membersOnly = (usersSwitch.getSelectedKey().equals(YES_KEY) && publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY));
-		CourseAccessAndProperties accessProperties = new CourseAccessAndProperties(entry, setting, getAccess(), membersOnly,
-				canCopy.isSelected(0), canReference.isSelected(0), canDownload.isSelected(0));
+		}
+		
+		boolean accessGuests = isGuests();
+		boolean accessAllUsers = isAllUsers();
+		RepositoryEntryStatusEnum accessStatus = getEntryStatus();
+		CourseAccessAndProperties accessProperties = new CourseAccessAndProperties(entry, setting,
+				accessStatus, accessAllUsers, accessGuests, canCopy.isSelected(0), canReference.isSelected(0), canDownload.isSelected(0));
 		
 		accessProperties.setOfferAccess(offerAccess);
 		accessProperties.setDeletedOffer(deletedOffer);
@@ -196,12 +194,6 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 		publishLayout.setFormTitle(translate("rentry.publish"));
 		publishLayout.setFormContextHelp("Course Settings#_zugriff");
 		publishLayout.setElementCssClass("o_sel_repositoryentry_access");
-		
-		if (loginModule.isGuestLoginLinksEnabled()) {
-			publishedKeys = new String[]{OAU_KEY, OAUG_KEY, MEMBERSONLY_KEY};
-		} else {
-			publishedKeys = new String[]{OAU_KEY, MEMBERSONLY_KEY};
-		} 
 
 		String resourceType = entry.getOlatResource().getResourceableTypeName();
 		if (TestFileResource.TYPE_NAME.equals(resourceType)
@@ -222,38 +214,40 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 		// make configuration read only when managed by external system
 		final boolean managedSettings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.settings);
 		final boolean managedAccess = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.access);
+		
+		String[] publishedKeys = new String[] {
+			RepositoryEntryStatusEnum.preparation.name(), RepositoryEntryStatusEnum.review.name(),
+			RepositoryEntryStatusEnum.coachpublished.name(), RepositoryEntryStatusEnum.published.name()
+		};
+		String[] publishedValues = new String[] {
+			translate("cif.status." + RepositoryEntryStatusEnum.preparation), translate("cif.status." + RepositoryEntryStatusEnum.review),
+			translate("cif.status." + RepositoryEntryStatusEnum.coachpublished), translate("cif.status." + RepositoryEntryStatusEnum.published),
+		};
+		
+		publishedStatus = uifactory.addDropdownSingleselect("publishedStatus", "cif.publish", publishLayout, publishedKeys, publishedValues, null);
+		publishedStatus.setElementCssClass("o_sel_repositoryentry_access_publication");
+		publishedStatus.setEnabled(!managedAccess);
+		publishedStatus.addActionListener(FormEvent.ONCHANGE);
+	
+		allUsers = uifactory.addCheckboxesVertical("cif.allusers", "cif.allusers", publishLayout, yesKeys, new String[] { translate("cif.release") }, 1);
+		allUsers.addActionListener(FormEvent.ONCHANGE);
+		allUsers.setElementCssClass("o_sel_repositoryentry_access_all_users");
+		allUsers.setEnabled(!managedAccess);
+		guests = uifactory.addCheckboxesVertical("cif.guests", "cif.guests", publishLayout, yesKeys, new String[] { translate("cif.release") }, 1);
+		guests.setElementCssClass("o_sel_repositoryentry_access_all_users");
+		guests.setEnabled(!managedAccess);
+		guests.setVisible(loginModule.isGuestLoginEnabled());
+		
+		uifactory.addSpacerElement("userSpacer", formLayout, true);
 
-		String[] yesNoValues = new String[]{translate("yes"), translate("no")};		
-		authorsSwitch = uifactory.addRadiosHorizontal("authorsSwitch", "rentry.publish.authors", publishLayout, yesNoKeys, yesNoValues);
-		authorsSwitch.setEnabled(!managedAccess);
-		authorsSwitch.addActionListener(FormEvent.ONCHANGE);
-		authorConfigLayout = FormLayoutContainer.createBareBoneFormLayout("authorConfigLayout", getTranslator());
-		publishLayout.add(authorConfigLayout);
-		canReference = uifactory.addCheckboxesVertical("cif_canReference",null, authorConfigLayout, new String[] { YES_KEY }, new String[] { translate("cif.canReference") }, 1);
+		canReference = uifactory.addCheckboxesVertical("cif_canReference", "cif.author.can", publishLayout, yesKeys, new String[] { translate("cif.canReference") }, 1);
 		canReference.setEnabled(!managedSettings);
-		canCopy = uifactory.addCheckboxesVertical("cif_canCopy", null, authorConfigLayout, new String[] { YES_KEY }, new String[] { translate("cif.canCopy") }, 1);
+		canCopy = uifactory.addCheckboxesVertical("cif_canCopy", null, publishLayout, yesKeys, new String[] { translate("cif.canCopy") }, 1);
 		canCopy.setEnabled(!managedSettings);
-		canDownload = uifactory.addCheckboxesVertical("cif_canDownload", null, authorConfigLayout, new String[] { YES_KEY }, new String[] { translate("cif.canDownload") }, 1);
+		canDownload = uifactory.addCheckboxesVertical("cif_canDownload", null, publishLayout, yesKeys, new String[] { translate("cif.canDownload") }, 1);
 		canDownload.setEnabled(!managedSettings);
 		canDownload.setVisible(handler.supportsDownload());
-		uifactory.addSpacerElement("authorSpacer", authorConfigLayout, true);
-
-		String[] publishedValues;
-		if (loginModule.isGuestLoginLinksEnabled()) {
-			publishedValues = new String[]{translate("cif.access.users"), translate("cif.access.users_guests"), translate("cif.access.membersonly")};
-		} else {
-			publishedValues = new String[]{translate("cif.access.users"), translate("cif.access.membersonly")};
-		}
-			
-		usersSwitch = uifactory.addRadiosHorizontal("usersSwitch", "rentry.publish.users", publishLayout, yesNoKeys, yesNoValues);
-		usersSwitch.addActionListener(FormEvent.ONCHANGE);
-		usersSwitch.setEnabled(!managedAccess);
-		userConfigLayout = FormLayoutContainer.createBareBoneFormLayout("userConfigLayout", getTranslator());
-		publishLayout.add(userConfigLayout);
-		publishedForUsers = uifactory.addDropdownSingleselect("publishedForUsers", null, userConfigLayout, publishedKeys, publishedValues, null);
-		publishedForUsers.setEnabled(!managedAccess);
-		publishedForUsers.addActionListener(FormEvent.ONCHANGE);
-		uifactory.addSpacerElement("userSpacer", userConfigLayout, true);
+		uifactory.addSpacerElement("authorSpacer", formLayout, true);
 
 		// Part 2
 		
@@ -291,9 +285,9 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 		
 		accessLayout = FormLayoutContainer.createCustomFormLayout("accessConfig", getTranslator(), velocity_root + "/access_configuration.html");
 		formLayout.add(accessLayout);
-		accessLayout.setVisible(entry.getAccess() == RepositoryEntry.ACC_USERS
-				|| loginModule.isGuestLoginLinksEnabled() && entry.getAccess() == RepositoryEntry.ACC_USERS_GUESTS
-				|| entry.isMembersOnly());
+		accessLayout.setVisible(entry.isAllUsers()
+				|| loginModule.isGuestLoginLinksEnabled() && entry.isGuests()
+				|| entry.getEntryStatus() == RepositoryEntryStatusEnum.published);
 		
 		accessLayout.setFormTitle(translate("accesscontrol.title"));
 		
@@ -475,60 +469,22 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 		canReference.select(YES_KEY, entry.getCanReference()); 
 		canCopy.select(YES_KEY, entry.getCanCopy()); 
 		canDownload.select(YES_KEY, entry.getCanDownload());
-		if (entry.getAccess() >= RepositoryEntry.ACC_OWNERS_AUTHORS) {
-			authorsSwitch.select(YES_KEY, true);
-		} else {
-			authorsSwitch.select(NO_KEY, true);
-			authorConfigLayout.setVisible(false);
-		}
-		// init user visibility
-		if (entry.getAccess() == RepositoryEntry.ACC_USERS) {
-			publishedForUsers.select(OAU_KEY, true);
-			usersSwitch.select(YES_KEY, true);
-		} else if (loginModule.isGuestLoginLinksEnabled() && entry.getAccess() == RepositoryEntry.ACC_USERS_GUESTS){
-			publishedForUsers.select(OAUG_KEY, true);			
-			usersSwitch.select(YES_KEY, true);
-		} else if (entry.isMembersOnly()) {
-			publishedForUsers.select(MEMBERSONLY_KEY, true);
-			usersSwitch.select(YES_KEY, true);
-			authorsSwitch.setEnabled(false);
-		} else {
-			publishedForUsers.select(OAU_KEY, true);
-			usersSwitch.select(NO_KEY, true);
-			userConfigLayout.setVisible(false);
-		}
+		
+		publishedStatus.select(entry.getEntryStatus().name(), true);
+		allUsers.select(YES_KEY, entry.isAllUsers());
+		guests.select(YES_KEY, entry.isGuests());
+		
+		accessLayout.setVisible(allUsers.isSelected(0));
 	}
 	
 	@Override
 	protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
 		super.formInnerEvent(ureq, source, event);
-		if (source == authorsSwitch) {
-			if (authorsSwitch.getSelectedKey().equals(YES_KEY)) {			
-				authorConfigLayout.setVisible(true);
-			} else {
-				authorConfigLayout.setVisible(false);
-				if (!publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
-					usersSwitch.select(NO_KEY, false);
-					userConfigLayout.setVisible(false);
-				}
-			}
-		} else if (source == usersSwitch || source == publishedForUsers) {
-			if (usersSwitch.getSelectedKey().equals(YES_KEY)) {			
-				userConfigLayout.setVisible(true);
+		if (source == allUsers) {
+			if (allUsers.isSelected(0)) {
 				accessLayout.setVisible(true);
-				if (publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
-					authorConfigLayout.setVisible(false);
-					authorsSwitch.select(NO_KEY, true);
-					authorsSwitch.setEnabled(false);
-				} else {
-					authorsSwitch.select(YES_KEY, true);
-					authorsSwitch.setEnabled(true);
-					authorConfigLayout.setVisible(true);
-				}
 			} else {
-				userConfigLayout.setVisible(false);
 				accessLayout.setVisible(false);
-				authorsSwitch.setEnabled(true);
 			}
 		} else if(addMethods.contains(source)) {
 			AccessMethod method = (AccessMethod)source.getUserObject();
@@ -616,26 +572,18 @@ public class PublishStep01AccessForm extends StepFormBasicController {
 		}
 	}
 	
-	private int getAccess() {
+	private RepositoryEntryStatusEnum getEntryStatus() {
 		// default only for owners
-		int access = RepositoryEntry.ACC_OWNERS;
-		if (authorsSwitch.getSelectedKey().equals(YES_KEY)) {
-			// raise to author level
-			access = RepositoryEntry.ACC_OWNERS_AUTHORS;
-		}
-		if (usersSwitch.getSelectedKey().equals(YES_KEY)) {
-			if (publishedForUsers.getSelectedKey().equals(OAU_KEY)) {
-				// further raise to user level
-				access = RepositoryEntry.ACC_USERS;
-			} else if (publishedForUsers.getSelectedKey().equals(OAUG_KEY)) {
-				// further raise to guest level
-				access = RepositoryEntry.ACC_USERS_GUESTS;
-			} else if (publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
-			// Members-only is either owner or owner-author level, never user level
-				access = RepositoryEntry.ACC_OWNERS;
-			}
-		}
-		return access;
+		String selectedKey = publishedStatus.getSelectedKey();
+		return RepositoryEntryStatusEnum.valueOf(selectedKey);
+	}
+	
+	private boolean isAllUsers() {
+		return allUsers.isSelected(0);
+	}
+	
+	private boolean isGuests() {
+		return guests.isSelected(0);
 	}
 	
 	private void editMethod(UserRequest ureq, AccessInfo infos) {
diff --git a/src/main/java/org/olat/course/editor/QuickPublishController.java b/src/main/java/org/olat/course/editor/QuickPublishController.java
index 3cc653a3f61..992862f7476 100644
--- a/src/main/java/org/olat/course/editor/QuickPublishController.java
+++ b/src/main/java/org/olat/course/editor/QuickPublishController.java
@@ -72,25 +72,33 @@ public class QuickPublishController extends BasicController {
 		String accessI18CssClass = "o_success";
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
 		RepositoryEntry entry = repositoryManager.lookupRepositoryEntry(courseResource, false);
-		if(entry.isMembersOnly()) {
-			accessI18n = translate("cif.access.membersonly");
-		} else {
-			switch (entry.getAccess()) {
-				case 0: accessI18n = "ERROR";
-					accessI18CssClass = "o_error";
-					break;
-				case 1: accessI18n = translate("cif.access.owners");
-					accessI18CssClass = "o_warning";			
-					break;
-				case 2: accessI18n = translate("cif.access.owners_authors");
+
+		switch (entry.getEntryStatus()) {
+			case preparation:
+				accessI18n = translate("cif.status.preparation");
+				accessI18CssClass = "o_warning";
+				break;
+			case review:
+				accessI18n = translate("cif.status.review");
+				accessI18CssClass = "o_warning";			
+				break;
+			case coachpublished:
+				accessI18n = translate("cif.status.coachpublished");
+				accessI18CssClass = "o_warning";			
+				break;
+				
+			case published:
+				accessI18n = translate("cif.status.published");
+				if(!entry.isAllUsers() && !entry.isGuests()) {
 					accessI18CssClass = "o_warning";
-					break;
-				case 3: accessI18n = translate("cif.access.users");
-					break;
-				case 4: accessI18n = translate("cif.access.users_guests");
-					break;
-			}
+				}
+				break;
+			default:
+				accessI18n = "ERROR";
+				accessI18CssClass = "o_error";			
+				break;		
 		}
+
 		mainVC.contextPut("accessI18n", accessI18n);
 		mainVC.contextPut("accessI18CssClass", accessI18CssClass);
 		
diff --git a/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java b/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java
index 0f97acf9f5d..d9764d8c7af 100644
--- a/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java
+++ b/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java
@@ -59,6 +59,11 @@ public interface CourseGroupManager {
 	public OLATResource getCourseResource();
 	
 	public RepositoryEntry getCourseEntry();
+	
+	/**
+	 * @return true if the status of the course allow notifications
+	 */
+	public boolean isNotificationsAllowed();
 
 	/**
 	 * Checks users course rights in any of the available right group context of
diff --git a/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java b/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java
index 2f843be43bd..1d9dca0ca46 100644
--- a/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java
+++ b/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java
@@ -126,6 +126,11 @@ public class PersistingCourseGroupManager implements CourseGroupManager {
 		return courseRepoEntry;
 	}
 	
+	@Override
+	public boolean isNotificationsAllowed() {
+		return false;
+	}
+
 	public void updateRepositoryEntry(RepositoryEntry entry) {
 		courseRepoEntry = entry;
 	}
diff --git a/src/main/java/org/olat/course/nodes/dialog/manager/FileUploadNotificationHandler.java b/src/main/java/org/olat/course/nodes/dialog/manager/FileUploadNotificationHandler.java
index 59935910404..c271a93ec4d 100644
--- a/src/main/java/org/olat/course/nodes/dialog/manager/FileUploadNotificationHandler.java
+++ b/src/main/java/org/olat/course/nodes/dialog/manager/FileUploadNotificationHandler.java
@@ -98,7 +98,7 @@ public class FileUploadNotificationHandler implements NotificationsHandler {
 					if(!checkPublisher(subscriber.getPublisher())) {
 						return notificationsManager.getNoSubscriptionInfo();
 					}
-				} else if(re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+				} else if(re.getEntryStatus().decommissioned()) {
 					return notificationsManager.getNoSubscriptionInfo();
 				}
 
diff --git a/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java b/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java
index f6c210037ce..9f4f830024e 100644
--- a/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java
+++ b/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java
@@ -70,6 +70,7 @@ import org.olat.modules.assessment.Role;
 import org.olat.modules.assessment.manager.AssessmentEntryDAO;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.user.UserManager;
 
@@ -145,11 +146,13 @@ class GTANotifications {
 		}
 		CourseNode node = course.getRunStructure().getNode(subIdentifier);
 		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
-		if(entry.getRepositoryEntryStatus().isClosed() || entry.getRepositoryEntryStatus().isUnpublished()) {
+		if(entry == null || entry.getEntryStatus() == RepositoryEntryStatusEnum.closed
+				|| entry.getEntryStatus() == RepositoryEntryStatusEnum.trash
+				|| entry.getEntryStatus() == RepositoryEntryStatusEnum.deleted) {
 			return Collections.emptyList();
 		}
 		
-		if(entry != null && node instanceof GTACourseNode) {
+		if(node instanceof GTACourseNode) {
 			gtaNode = (GTACourseNode)node;
 			displayName = entry.getDisplayname();
 			courseEnv = course.getCourseEnvironment();
@@ -770,7 +773,7 @@ class GTANotifications {
 	 */
 	private Task checkRevisionStep(Identity assessedIdentity, BusinessGroup assessedGroup, Task task) {
 		if(task != null) {
-			if(task != null && task.getTaskStatus() == TaskProcess.revision
+			if(task.getTaskStatus() == TaskProcess.revision
 					&& task.getRevisionsDueDate() != null
 					&& task.getRevisionsDueDate().compareTo(new Date()) < 0) {
 				//push to the next step
@@ -791,7 +794,7 @@ class GTANotifications {
 				if(task.getTaskStatus() == TaskProcess.solution || task.getTaskStatus() == TaskProcess.grading || task.getTaskStatus() == TaskProcess.graded) {
 					// step solution or beyond
 					return true;
-				} else if((task == null || task.getTaskStatus() == TaskProcess.assignment || task.getTaskStatus() == TaskProcess.submit
+				} else if((task.getTaskStatus() == TaskProcess.assignment || task.getTaskStatus() == TaskProcess.submit
 						|| task.getTaskStatus() == TaskProcess.review || task.getTaskStatus() == TaskProcess.correction
 						|| task.getTaskStatus() == TaskProcess.revision)
 						&& gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false)) {
diff --git a/src/main/java/org/olat/course/nodes/ta/AbstractTaskNotificationHandler.java b/src/main/java/org/olat/course/nodes/ta/AbstractTaskNotificationHandler.java
index 7f0a26cfbdd..fcdca1a4540 100644
--- a/src/main/java/org/olat/course/nodes/ta/AbstractTaskNotificationHandler.java
+++ b/src/main/java/org/olat/course/nodes/ta/AbstractTaskNotificationHandler.java
@@ -89,7 +89,7 @@ public abstract class AbstractTaskNotificationHandler extends LogDelegator {
 					if(!checkPublisher(p)) {
 						return NotificationsManager.getInstance().getNoSubscriptionInfo();
 					}
-				} else if(re.getRepositoryEntryStatus().isClosed()) {
+				} else if(re.getEntryStatus().decommissioned()) {
 					return NotificationsManager.getInstance().getNoSubscriptionInfo();
 				}
 				
diff --git a/src/main/java/org/olat/course/run/CourseRuntimeController.java b/src/main/java/org/olat/course/run/CourseRuntimeController.java
index b1a8a60acb8..ed0bc40bfc6 100644
--- a/src/main/java/org/olat/course/run/CourseRuntimeController.java
+++ b/src/main/java/org/olat/course/run/CourseRuntimeController.java
@@ -136,6 +136,7 @@ import org.olat.note.NoteController;
 import org.olat.repository.LeavingStatusList;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryManagedFlag;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.controllers.EntryChangedEvent;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -453,7 +454,7 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im
 	}
 	
 	private void setCourseClosedMessage(UserCourseEnvironment uce) {
-		if(uce != null &&  getRepositoryEntry().getRepositoryEntryStatus().isClosed()) {
+		if(uce != null &&  getRepositoryEntry().getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 			toolbarPanel.setMessage(translate("course.closed"));
 			toolbarPanel.setMessageCssClass("o_warning");
 		} else {
diff --git a/src/main/java/org/olat/course/run/RunMainController.java b/src/main/java/org/olat/course/run/RunMainController.java
index 19fb3aadf27..e968ee4fb62 100644
--- a/src/main/java/org/olat/course/run/RunMainController.java
+++ b/src/main/java/org/olat/course/run/RunMainController.java
@@ -94,6 +94,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.ui.edit.BusinessGroupModifiedEvent;
 import org.olat.modules.cp.TreeNodeEvent;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
 import org.olat.util.logging.activity.LoggingResourceable;
@@ -180,7 +181,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 		luTree.setElementCssClass("o_course_menu");
 		contentP = new Panel("building_block_content");
 
-		// build up the running structure for this user;
+		// build up the running structure for this user
 		// get all group memberships for this course
 		uce = loadUserCourseEnvironment(ureq, reSecurity);
 
@@ -203,7 +204,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 
 		currentCourseNode = updateTreeAndContent(ureq, currentCourseNode, null);
 
-		if (courseRepositoryEntry != null && courseRepositoryEntry.getRepositoryEntryStatus().isClosed()) {
+		if (courseRepositoryEntry != null && courseRepositoryEntry.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 			wControl.setWarning(translate("course.closed"));
 		}
 
@@ -542,7 +543,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
 			if (needsRebuildAfterPublish) {
 				needsRebuildAfterPublish = false;
 				
-			  // rebuild up the running structure for this user, after publish;
+			  // rebuild up the running structure for this user, after publish
 				course = CourseFactory.loadCourse(course.getResourceableId());
 				uce = loadUserCourseEnvironment(ureq, reSecurity);
 				// build score now
diff --git a/src/main/java/org/olat/course/run/preview/PreviewCourseGroupManager.java b/src/main/java/org/olat/course/run/preview/PreviewCourseGroupManager.java
index 7d15e79eddc..70802ec0174 100644
--- a/src/main/java/org/olat/course/run/preview/PreviewCourseGroupManager.java
+++ b/src/main/java/org/olat/course/run/preview/PreviewCourseGroupManager.java
@@ -47,6 +47,7 @@ import org.olat.group.area.BGAreaManager;
 import org.olat.modules.curriculum.CurriculumElement;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 
@@ -96,6 +97,18 @@ final class PreviewCourseGroupManager extends BasicManager implements CourseGrou
 		return courseResource;
 	}
 
+	@Override
+	public boolean isNotificationsAllowed() {
+		RepositoryEntry re = getCourseEntry();
+		if(re == null || re.getEntryStatus() == null) {
+			return false;
+		}
+		RepositoryEntryStatusEnum status = re.getEntryStatus();
+		return status != RepositoryEntryStatusEnum.closed
+				&& status != RepositoryEntryStatusEnum.trash
+				&& status != RepositoryEntryStatusEnum.deleted;
+	}
+
 	@Override
 	public boolean hasRight(Identity identity, String courseRight) {
 		return !courseRight.equals(CourseRights.RIGHT_COURSEEDITOR);
diff --git a/src/main/java/org/olat/course/run/userview/UserCourseEnvironmentImpl.java b/src/main/java/org/olat/course/run/userview/UserCourseEnvironmentImpl.java
index 8c864bbf6a0..4f304446dba 100644
--- a/src/main/java/org/olat/course/run/userview/UserCourseEnvironmentImpl.java
+++ b/src/main/java/org/olat/course/run/userview/UserCourseEnvironmentImpl.java
@@ -43,6 +43,7 @@ import org.olat.course.run.scoring.ScoreAccounting;
 import org.olat.group.BusinessGroup;
 import org.olat.modules.curriculum.CurriculumElement;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 
 /**
@@ -73,7 +74,7 @@ public class UserCourseEnvironmentImpl implements UserCourseEnvironment {
 	public UserCourseEnvironmentImpl(IdentityEnvironment identityEnvironment, CourseEnvironment courseEnvironment) {
 		this(identityEnvironment, courseEnvironment, null, null, null, null, null, null, null, null);
 		if(courseEnvironment != null) {
-			courseReadOnly = courseEnvironment.getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed();
+			courseReadOnly = courseEnvironment.getCourseGroupManager().getCourseEntry().getEntryStatus() == RepositoryEntryStatusEnum.closed;
 		}
 	}
 	
diff --git a/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java b/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java
index b7230fc25a4..508f5f84849 100644
--- a/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java
+++ b/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java
@@ -43,6 +43,7 @@ import org.olat.core.util.Util;
 import org.olat.course.site.model.CourseSiteConfiguration;
 import org.olat.course.site.model.LanguageConfiguration;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
@@ -96,7 +97,7 @@ public class CourseSiteContextEntryControllerCreator extends DefaultContextEntry
 		
 		RepositoryManager rm = RepositoryManager.getInstance();
 		RepositoryEntrySecurity reSecurity = rm.isAllowed(ureq, re);
-		if(re.getAccess() == RepositoryEntry.DELETED) {
+		if(re.getEntryStatus() == RepositoryEntryStatusEnum.trash || re.getEntryStatus() == RepositoryEntryStatusEnum.deleted) {
 			Roles roles = usess.getRoles();
 			if(!reSecurity.isEntryAdmin() && !roles.isLearnResourceManager() && !roles.isAdministrator()) {
 				return messageController(ureq, wControl, "repositoryentry.deleted");
diff --git a/src/main/java/org/olat/group/manager/BusinessGroupDAO.java b/src/main/java/org/olat/group/manager/BusinessGroupDAO.java
index f83f8d9654b..81debfdee62 100644
--- a/src/main/java/org/olat/group/manager/BusinessGroupDAO.java
+++ b/src/main/java/org/olat/group/manager/BusinessGroupDAO.java
@@ -63,6 +63,7 @@ import org.olat.group.model.StatisticsBusinessGroupRow;
 import org.olat.properties.Property;
 import org.olat.repository.RepositoryEntryRef;
 import org.olat.repository.RepositoryEntryShort;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
 import org.olat.resource.accesscontrol.Price;
@@ -1390,8 +1391,8 @@ public class BusinessGroupDAO {
 		}
 
 		@Override
-		public int getStatusCode() {
-			return 0;
+		public RepositoryEntryStatusEnum getEntryStatus() {
+			return null;
 		}
 
 		@Override
diff --git a/src/main/java/org/olat/group/model/BGRepositoryEntryShortImpl.java b/src/main/java/org/olat/group/model/BGRepositoryEntryShortImpl.java
index beddc620fa2..11d2dbdd167 100644
--- a/src/main/java/org/olat/group/model/BGRepositoryEntryShortImpl.java
+++ b/src/main/java/org/olat/group/model/BGRepositoryEntryShortImpl.java
@@ -21,6 +21,7 @@ package org.olat.group.model;
 
 import org.olat.core.commons.persistence.PersistentObject;
 import org.olat.repository.RepositoryEntryShort;
+import org.olat.repository.RepositoryEntryStatusEnum;
 
 /**
  * Better caching, done in the first place for the list
@@ -44,7 +45,6 @@ public class BGRepositoryEntryShortImpl extends PersistentObject implements Repo
 		this.displayname = displayname;
 	}
 	
-	
 	@Override
 	public String getDisplayname() {
 		return displayname;
@@ -54,12 +54,12 @@ public class BGRepositoryEntryShortImpl extends PersistentObject implements Repo
 	public String getResourceType() {
 		return null;
 	}
-
+	
 	@Override
-	public int getStatusCode() {
-		return -1;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return null;
 	}
-	
+
 	@Override
 	public int hashCode() {
 		return getKey() == null ? 2939985 : getKey().hashCode();
diff --git a/src/main/java/org/olat/home/HomeCalendarManager.java b/src/main/java/org/olat/home/HomeCalendarManager.java
index 01d86f5aad8..2967e61759a 100644
--- a/src/main/java/org/olat/home/HomeCalendarManager.java
+++ b/src/main/java/org/olat/home/HomeCalendarManager.java
@@ -44,6 +44,7 @@ import org.olat.commons.calendar.model.CalendarUserConfiguration;
 import org.olat.commons.calendar.ui.components.KalendarRenderWrapper;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DB;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.id.Identity;
@@ -64,6 +65,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.model.SearchBusinessGroupParams;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 import org.olat.user.UserDataDeletable;
 import org.olat.user.UserDataExportable;
@@ -300,19 +302,19 @@ public class HomeCalendarManager implements PersonalCalendarManager, UserDataDel
 	 * @return List of array, first the repository entry, second the role
 	 */
 	private List<Object[]> getCourses(IdentityRef identity) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(2048);
 		sb.append("select v, membership.role from repositoryentry  v ")
 		  .append(" inner join fetch v.olatResource as resource ")
 		  .append(" inner join v.groups as retogroup")
 		  .append(" inner join retogroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as membership")
 		  .append(" where v.olatResource.resName='CourseModule' and membership.identity.key=:identityKey and")
-		  .append(" (")
-		  .append("   (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true and membership.role in ('").append(GroupRoles.owner.name()).append("','").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("'))")
+		  .append(" (")//TODO repo access
+		  .append("   (v.status ").in(RepositoryEntryStatusEnum.reviewToClosed()).append(" and membership.role='").append(GroupRoles.owner.name()).append("')")
 		  .append("   or")
-		  .append("   (v.access>=").append(RepositoryEntry.ACC_OWNERS).append(" and membership.role='").append(GroupRoles.owner.name()).append("')")
+		  .append("   (v.status ").in(RepositoryEntryStatusEnum.coachPublishedToClosed()).append(" and membership.role='").append(GroupRoles.coach.name()).append("')")
 		  .append("   or")
-		  .append("   (v.access>=").append(RepositoryEntry.ACC_USERS).append(" and membership.role in ('").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("'))")
+		  .append("   (v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and membership.role='").append(GroupRoles.participant.name()).append("')")
 		  .append(" )");
 		
 		return dbInstance.getCurrentEntityManager()
diff --git a/src/main/java/org/olat/ims/qti/repository/handlers/QTIHandler.java b/src/main/java/org/olat/ims/qti/repository/handlers/QTIHandler.java
index 7abe1704bd6..d25ab9f9fbf 100644
--- a/src/main/java/org/olat/ims/qti/repository/handlers/QTIHandler.java
+++ b/src/main/java/org/olat/ims/qti/repository/handlers/QTIHandler.java
@@ -52,6 +52,7 @@ import org.olat.ims.qti.qpool.QTIQPoolServiceProvider;
 import org.olat.modules.qpool.model.QItemList;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.FileHandler;
@@ -83,8 +84,8 @@ public abstract class QTIHandler extends FileHandler {
 			String displayname, String description, Object object, Organisation organisation, Locale locale) {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
-		RepositoryEntry re = repositoryService
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		
 		File fRepositoryQTI = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), "qti.zip");
@@ -106,8 +107,8 @@ public abstract class QTIHandler extends FileHandler {
 		File zipDir = new File(fResourceFileroot, FileResourceManager.ZIPDIR);
 		FileResource.copyResource(file, filename, zipDir);
 		ZipUtil.zipAll(zipDir, new File(fResourceFileroot, "qti.zip"));
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		//zip it
 		return re;
diff --git a/src/main/java/org/olat/ims/qti21/repository/handlers/QTI21AssessmentTestHandler.java b/src/main/java/org/olat/ims/qti21/repository/handlers/QTI21AssessmentTestHandler.java
index 428cb5a03f9..77eb9f16b69 100644
--- a/src/main/java/org/olat/ims/qti21/repository/handlers/QTI21AssessmentTestHandler.java
+++ b/src/main/java/org/olat/ims/qti21/repository/handlers/QTI21AssessmentTestHandler.java
@@ -77,6 +77,7 @@ import org.olat.ims.qti21.ui.editor.AssessmentTestComposerController;
 import org.olat.modules.qpool.model.QItemList;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.EditionSupport;
@@ -138,7 +139,8 @@ public class QTI21AssessmentTestHandler extends FileHandler {
 		ImsQTI21Resource ores = new ImsQTI21Resource();
 		
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		dbInstance.commit();
 		
 		File repositoryDir = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), FileResourceManager.ZIPDIR);
@@ -286,8 +288,8 @@ public class QTI21AssessmentTestHandler extends FileHandler {
 			}
 		} 
 
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description,
+					resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/modules/coach/manager/CoachingDAO.java b/src/main/java/org/olat/modules/coach/manager/CoachingDAO.java
index 7a688cb1d8d..af4b3930017 100644
--- a/src/main/java/org/olat/modules/coach/manager/CoachingDAO.java
+++ b/src/main/java/org/olat/modules/coach/manager/CoachingDAO.java
@@ -36,9 +36,11 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.NativeQueryBuilder;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.id.Identity;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
+import org.olat.core.util.CodeHelper;
 import org.olat.core.util.StringHelper;
 import org.olat.course.assessment.UserEfficiencyStatement;
 import org.olat.modules.coach.model.CourseStatEntry;
@@ -47,6 +49,7 @@ import org.olat.modules.coach.model.GroupStatEntry;
 import org.olat.modules.coach.model.SearchCoachedIdentityParams;
 import org.olat.modules.coach.model.StudentStatEntry;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.user.UserManager;
 import org.olat.user.propertyhandlers.UserPropertyHandler;
@@ -75,17 +78,17 @@ public class CoachingDAO {
 	private RepositoryManager repositoryManager;
 
 	public boolean isCoach(IdentityRef coach) {
-		StringBuilder sb = new StringBuilder(1024);
-		sb.append("select v.key from ").append(RepositoryEntry.class.getName()).append(" v ")
+		QueryBuilder sb = new QueryBuilder(1024);
+		sb.append("select v.key from repositoryentry v")
 		  .append(" inner join v.olatResource as res on res.resName='CourseModule'")
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as membership on membership.role in ('").append(GroupRoles.owner.name()).append("','").append(GroupRoles.coach.name()).append("')")
+		  .append(" inner join baseGroup.members as membership on membership.role ").in(GroupRoles.owner ,GroupRoles.coach.name())
 		  .append(" where membership.identity.key=:identityKey")
-		  .append(" and (")
-		  .append("  (membership.role = '").append(GroupRoles.coach.name()).append("' and (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true)))")
+		  .append(" and (")//TODO repo access
+		  .append("  (membership.role = '").append(GroupRoles.coach.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
 		  .append("  or")
-		  .append("  (membership.role = '").append(GroupRoles.owner.name()).append("' and v.access>=").append(RepositoryEntry.ACC_OWNERS).append(")")
+		  .append("  (membership.role = '").append(GroupRoles.owner.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
 		  .append(" )");
 		
 		List<Long> firstKey = dbInstance.getCurrentEntityManager()
@@ -94,7 +97,7 @@ public class CoachingDAO {
 				.setFirstResult(0)
 				.setMaxResults(1)
 				.getResultList();
-		return firstKey.size() > 0;
+		return !firstKey.isEmpty();
 	}
 
 	public EfficiencyStatementEntry getEfficencyStatementEntry(UserEfficiencyStatement statement,
@@ -156,18 +159,16 @@ public class CoachingDAO {
 		  .append("  inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=togroup.fk_group_id and sg_coach.g_role = 'coach') ")
 		  .append("  inner join o_repositoryentry sg_re on (togroup.fk_entry_id = sg_re.repositoryentry_id) ")
 		  .append("  inner join o_olatresource sg_res on (sg_res.resource_id = sg_re.fk_olatresource and sg_res.resname = 'CourseModule') ")
-		  .append("  where sg_coach.fk_identity_id=:coachKey and ( ")
-		  .append("   sg_re.accesscode>=").append(RepositoryEntry.ACC_USERS)
-		  .append("   or ")
-		  .append("   (sg_re.accesscode=").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+		  .append("  where sg_coach.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
 		  .append(" ) or infos.fk_group_id in ( select ")
 		  .append("	  distinct togroup.fk_group_id ")
 		  .append("  from o_re_to_group togroup ")
 		  .append("  inner join o_repositoryentry sg_re on (togroup.fk_entry_id = sg_re.repositoryentry_id) ")
 		  .append("  inner join o_olatresource sg_res on (sg_res.resource_id = sg_re.fk_olatresource and sg_res.resname = 'CourseModule') ")
-		  .append("  inner join o_re_to_group owngroup on (owngroup.r_defgroup=").appendTrue().append(" and owngroup.fk_entry_id = sg_re.repositoryentry_id) ")
-		  .append("  inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id and sg_owner.g_role = 'owner') ")
-		  .append("  where togroup.r_defgroup=").appendFalse().append(" and sg_owner.fk_identity_id=:coachKey and sg_re.accesscode>=").append(RepositoryEntry.ACC_OWNERS)
+		  .append("  inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id) ")
+		  .append("  inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id and sg_owner.g_role ")
+		     .in(GroupRoles.owner).append(")")
+		  .append("  where togroup.r_defgroup=").appendFalse().append(" and sg_owner.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
 		  .append(" ) ");
 
 		List<?> rawList = dbInstance.getCurrentEntityManager()
@@ -184,7 +185,7 @@ public class CoachingDAO {
 			entry.setCountDistinctStudents(((Number)rawStat[3]).intValue());
 			map.put(baseGroupKey, entry);
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getGroupsStatisticsInfosForCoach(Identity coach, Map<Long,GroupStatEntry> map) {
@@ -199,10 +200,8 @@ public class CoachingDAO {
 		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='participant') ")
 		  .append(" left join o_as_user_course_infos pg_initial_launch ")
 		  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant.fk_identity_id) ")
-		  .append(" where sg_coach.fk_identity_id=:coachKey and ( ")
-		  .append("   (sg_re.accesscode >= ").append(RepositoryEntry.ACC_USERS).append(" and sg_coach.g_role = 'coach') ")//BAR
-		  .append("   or ")
-		  .append("   (sg_re.accesscode = ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+		  .append(" where sg_coach.fk_identity_id=:coachKey")//TODO repo access
+		  .append(" and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and sg_coach.g_role ").in(GroupRoles.coach)//BAR
 		  .append(" group by togroup.fk_group_id, togroup.fk_entry_id ");
 		
 		List<?> rawList = dbInstance.getCurrentEntityManager()
@@ -224,7 +223,7 @@ public class CoachingDAO {
 				}
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getGroupsStatisticsInfosForOwner(Identity coach, Map<Long,GroupStatEntry> map) {
@@ -234,14 +233,15 @@ public class CoachingDAO {
 		  .append("  togroup.fk_entry_id as re_id, ")
 		  .append("  count(distinct pg_initial_launch.id) as pg_id ")
 		  .append(" from o_repositoryentry sg_re  ")
-		  .append(" inner join o_re_to_group owngroup on (owngroup.r_defgroup=").appendTrue().append(" and owngroup.fk_entry_id = sg_re.repositoryentry_id) ")
-		  .append(" inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id and sg_owner.g_role = 'owner') ")
+		  .append(" inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id) ")
+		  .append(" inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id and sg_owner.g_role ")
+				  .in(GroupRoles.owner).append(")")
 		  .append(" inner join o_re_to_group togroup on (togroup.r_defgroup=").appendFalse().append(" and togroup.fk_entry_id = sg_re.repositoryentry_id) ")
 		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant') ")
 		  .append(" left join o_as_user_course_infos pg_initial_launch ")
 		  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant.fk_identity_id) ")
-		  .append(" where sg_owner.fk_identity_id=:coachKey and sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS)
-		  .append(" group by togroup.fk_group_id, togroup.fk_entry_id ");
+		  .append(" where sg_owner.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
+		  .append(" group by togroup.fk_group_id, togroup.fk_entry_id ");//TODO repo access
 		
 		List<?> rawList = dbInstance.getCurrentEntityManager()
 				.createNativeQuery(sb.toString())
@@ -262,7 +262,7 @@ public class CoachingDAO {
 				}
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getGroupsStatisticsStatementForCoach(Identity coach, Map<Long,GroupStatEntry> map) {
@@ -284,10 +284,8 @@ public class CoachingDAO {
 		  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=togroup.fk_group_id and sg_coach.g_role = 'coach') ")
 		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='participant') ")
 		  .append(" inner join o_as_eff_statement sg_statement on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
-		  .append(" where sg_coach.fk_identity_id=:coachKey and ( ")
-		  .append("   (sg_re.accesscode >= ").append(RepositoryEntry.ACC_USERS).append(" and sg_coach.g_role = 'coach') ")//BAR
-		  .append("   or ")
-		  .append("   (sg_re.accesscode = ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+		  .append(" where sg_coach.fk_identity_id=:coachKey and sg_coach.g_role = 'coach'")
+		  .append("  and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())//TODO repo access
 		  .append(") ").appendAs().append(" fin_statement ")
 		  .append("group by fin_statement.bgp_id, fin_statement.re_id ");
 		
@@ -312,7 +310,7 @@ public class CoachingDAO {
 				entry.getRepoIds().add(repoKey);
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getGroupsStatisticsStatementForOwner(Identity coach, Map<Long,GroupStatEntry> map) {
@@ -328,16 +326,17 @@ public class CoachingDAO {
 		  .append("  togroup.fk_group_id as bgp_id,")
 		  .append("  togroup.fk_entry_id as re_id,")
 		  .append("  sg_statement.passed as passed,")
-		  .append("  sg_statement.score as score ")
-		  .append(" from o_repositoryentry sg_re ")
-		  .append(" inner join o_re_to_group owngroup on (owngroup.r_defgroup=").appendTrue().append(" and owngroup.fk_entry_id = sg_re.repositoryentry_id) ")
-		  .append(" inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id and sg_owner.g_role = 'owner') ")
-		  .append(" inner join o_re_to_group togroup on (togroup.r_defgroup=").appendFalse().append(" and togroup.fk_entry_id = sg_re.repositoryentry_id) ")
-		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant') ")
+		  .append("  sg_statement.score as score")
+		  .append(" from o_repositoryentry sg_re")
+		  .append(" inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id) ")
+		  .append(" inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id and sg_owner.g_role ")
+		  		.in(GroupRoles.owner).append(")")
+		  .append(" inner join o_re_to_group togroup on (togroup.r_defgroup=").appendFalse().append(" and togroup.fk_entry_id = sg_re.repositoryentry_id)")
+		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant')")
 		  .append(" inner join o_as_eff_statement sg_statement on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
-		  .append(" where sg_owner.fk_identity_id=:coachKey and sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS)
-		  .append(") ").appendAs().append(" fin_statement ")
-		  .append("group by fin_statement.bgp_id, fin_statement.re_id ");
+		  .append(" where sg_owner.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
+		  .append(") ").appendAs().append(" fin_statement ")//TODO repo access
+		  .append("group by fin_statement.bgp_id, fin_statement.re_id");
 		
 		List<?> rawList = dbInstance.getCurrentEntityManager()
 				.createNativeQuery(sb.toString())
@@ -360,7 +359,7 @@ public class CoachingDAO {
 				entry.getRepoIds().add(repoKey);
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	protected List<CourseStatEntry> getCoursesStatisticsNative(Identity coach) {
@@ -390,11 +389,10 @@ public class CoachingDAO {
 		  .append(" inner join v.olatResource as res")
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as coach on coach.role in ('").append(GroupRoles.coach.name()).append("','").append(GroupRoles.owner.name()).append("')")
-		  .append(" where coach.identity.key=:coachKey and res.resName='CourseModule'")
-		  .append(" and ((v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true)")
-		  .append(" or (v.access >= ").append(RepositoryEntry.ACC_USERS).append(" and coach.role='").append(GroupRoles.coach.name()).append("')")
-		  .append(" or (v.access >= ").append(RepositoryEntry.ACC_OWNERS).append(" and coach.role='").append(GroupRoles.owner.name()).append("'))");
+		  .append(" inner join baseGroup.members as coach on coach.role ")
+		  		.in(GroupRoles.coach, GroupRoles.owner.name())
+		  .append(" where coach.identity.key=:coachKey and res.resName='CourseModule'")//TODO repo access
+		  .append(" and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());
 
 		List<Object[]> rawList = dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), Object[].class)
@@ -407,7 +405,7 @@ public class CoachingDAO {
 			entry.setRepoDisplayName((String)rawStat[1]);
 			map.put(entry.getRepoKey(), entry);
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getCoursesStatisticsUserInfosForCoach(Identity coach, Map<Long,CourseStatEntry> map) {
@@ -418,14 +416,11 @@ public class CoachingDAO {
 		  .append("  count(distinct pg_initial_launch.id) as pg_id")
 		  .append(" from o_repositoryentry sg_re ")
 		  .append(" inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id)")
-		  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=togroup.fk_group_id and sg_coach.g_role = '").append(GroupRoles.coach.name()).append("')")
-		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='").append(GroupRoles.participant.name()).append("')")
+		  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=togroup.fk_group_id and sg_coach.g_role='").append(GroupRoles.coach).append("')")
+		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='").append(GroupRoles.participant).append("')")
 		  .append(" left join o_as_user_course_infos pg_initial_launch")
 		  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant.fk_identity_id)")
-		  .append(" where sg_coach.fk_identity_id=:coachKey and ( ")
-		  .append("   (sg_re.accesscode >= ").append(RepositoryEntry.ACC_USERS).append(" and sg_coach.g_role = 'coach') ")//BAR
-		  .append("   or ")
-		  .append("   (sg_re.accesscode = ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+		  .append(" where sg_coach.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())//TODO repo access
 		  .append(" group by sg_re.repositoryentry_id");
 
 		List<?> rawList = dbInstance.getCurrentEntityManager()
@@ -442,7 +437,7 @@ public class CoachingDAO {
 				entry.setInitialLaunch(((Number)rawStats[2]).intValue());
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getCoursesStatisticsUserInfosForOwner(Identity coach, Map<Long,CourseStatEntry> map) {
@@ -454,13 +449,14 @@ public class CoachingDAO {
 			  .append("  count(distinct pg_initial_launch.id) as pg_id")
 			  .append(" from o_repositoryentry sg_re ")
 			  .append(" inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id and owngroup.r_defgroup=").appendTrue().append(")")
-			  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=owngroup.fk_group_id and sg_coach.g_role = 'owner')")
+			  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=owngroup.fk_group_id and sg_coach.g_role ")
+			  		.in(GroupRoles.owner).append(")")
 			  .append(" inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id)")
 			  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant')")
 			  .append(" left join o_as_user_course_infos pg_initial_launch")
 			  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant.fk_identity_id)")
-			  .append(" where sg_coach.fk_identity_id=:coachKey and sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS)
-			  .append(" group by sg_re.repositoryentry_id");
+			  .append(" where sg_coach.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
+			  .append(" group by sg_re.repositoryentry_id");//TODO repo access
 		} else {
 			sb.append("select")
 			  .append("  sg_re.repositoryentry_id as re_id,")
@@ -469,13 +465,14 @@ public class CoachingDAO {
 			  .append(" from o_repositoryentry sg_re ")
 			  .append(" inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id)")
 			  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant')")
-			  .append(" left join o_as_user_course_infos pg_initial_launch")
+			  .append(" left join o_as_user_course_infos pg_initial_launch")//TODO repo access
 			  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant.fk_identity_id)")
-			  .append(" where sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.fk_olatresource in (")
+			  .append(" where sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and sg_re.fk_olatresource in (")
 			  .append("  select sg_res.resource_id from o_olatresource sg_res where sg_res.resname = 'CourseModule'")
 			  .append(" ) and exists (")
 			  .append("  select owngroup.id from o_re_to_group owngroup inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id)")
-			  .append("  where owngroup.fk_entry_id = sg_re.repositoryentry_id and owngroup.r_defgroup=").appendTrue().append(" and sg_owner.g_role='owner' and sg_owner.fk_identity_id=:coachKey")
+			  .append("  where owngroup.fk_entry_id = sg_re.repositoryentry_id and owngroup.r_defgroup=").appendTrue().append(" and sg_owner.fk_identity_id=:coachKey")
+			  .append("  and sg_owner.g_role ").in(GroupRoles.owner)
 			  .append(" )")
 			  .append(" group by sg_re.repositoryentry_id");
 		}
@@ -494,7 +491,7 @@ public class CoachingDAO {
 				entry.setInitialLaunch(((Number)rawStats[2]).intValue());
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getCoursesStatisticsStatements(Identity coach, Map<Long,CourseStatEntry> map) {
@@ -506,28 +503,24 @@ public class CoachingDAO {
 		  .append(" sum(case when fin_statement.passed=").appendFalse().append(" then 1 else 0 end) as num_of_failed, ")
 		  .append(" avg(fin_statement.score) ")
 		  .append("from o_as_eff_statement fin_statement ")
-		  .append("where fin_statement.id in ( select ")
+		  .append("where fin_statement.id in (select ")
 		  .append("  distinct sg_statement.id ")
 		  .append("	from o_repositoryentry sg_re ")
 		  .append("	inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id) ")
 		  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=togroup.fk_group_id and sg_coach.g_role in ('owner','coach')) ")
 		  .append("	inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='participant') ")
 		  .append(" inner join o_as_eff_statement sg_statement on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
-		  .append("	where sg_coach.fk_identity_id=:coachKey and ( ")
-		  .append("   (sg_re.accesscode >= ").append(RepositoryEntry.ACC_USERS).append(" and sg_coach.g_role = 'coach') ")//BAR
-		  .append("   or ")
-		  .append("   (sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_coach.g_role = 'owner') ")//B
-		  .append("   or ")
-		  .append("   (sg_re.accesscode = ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+		  .append("	where sg_coach.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
 		  .append(") or fin_statement.id in ( select ")
 		  .append("   distinct sg_statement.id ")
 		  .append(" from o_repositoryentry sg_re ")
 		  .append(" inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id and owngroup.r_defgroup=").appendTrue().append(") ")
-		  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=owngroup.fk_group_id and sg_coach.g_role = 'owner') ")
+		  .append(" inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=owngroup.fk_group_id and sg_coach.g_role")
+		  		.in(GroupRoles.owner).append(")")
 		  .append(" inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id) ")
 		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant') ")
 		  .append(" inner join o_as_eff_statement sg_statement on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
-		  .append(" where sg_coach.fk_identity_id=:coachKey and sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS).append(") ")
+		  .append(" where sg_coach.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(") ")
 		  .append("group by fin_statement.course_repo_key ");
 
 		List<?> rawList = dbInstance.getCurrentEntityManager()
@@ -549,17 +542,17 @@ public class CoachingDAO {
 				}
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	protected List<StudentStatEntry> getStudentsStatisticsNative(Identity coach, List<UserPropertyHandler> userPropertyHandlers) {
 		Map<Long, StudentStatEntry> map = new HashMap<>();
-		//long start1 = System.nanoTime();
+		long start1 = System.nanoTime();
 		boolean hasCoachedStudents = getStudentsStastisticInfosForCoach(coach, map, userPropertyHandlers);
-		//CodeHelper.printNanoTime(start1, "Coached infos");
-		//long start2 = System.nanoTime();
+		CodeHelper.printNanoTime(start1, "Coached infos");
+		long start2 = System.nanoTime();
 		boolean hasOwnedStudents = getStudentsStastisticInfosForOwner(coach, map, userPropertyHandlers);
-		//CodeHelper.printNanoTime(start2, "Owned infos");
+		CodeHelper.printNanoTime(start2, "Owned infos");
 		if(hasOwnedStudents || hasCoachedStudents) {
 			for(StudentStatEntry entry:map.values()) {
 				entry.setCountRepo(entry.getRepoIds().size());
@@ -567,9 +560,9 @@ public class CoachingDAO {
 				entry.setInitialLaunch(entry.getLaunchIds().size());
 				entry.setLaunchIds(null);
 			}
-			//long start3 = System.nanoTime();
+			long start3 = System.nanoTime();
 			getStudentsStatisticStatement(coach, hasCoachedStudents, hasOwnedStudents, map);
-			//CodeHelper.printNanoTime(start3, "Statistics students");
+			CodeHelper.printNanoTime(start3, "Statistics students");
 			for(StudentStatEntry entry:map.values()) {
 				int notAttempted = entry.getCountRepo() - entry.getCountPassed() - entry.getCountFailed();
 				entry.setCountNotAttempted(notAttempted);
@@ -596,10 +589,7 @@ public class CoachingDAO {
 		  .append(" inner join o_user sg_participant_user on (sg_participant_user.fk_identity=sg_participant_id.id)")
 		  .append(" left join o_as_user_course_infos pg_initial_launch")
 		  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant.fk_identity_id)")
-		  .append(" where sg_coach.fk_identity_id=:coachKey and ( ")
-		  .append("   (sg_re.accesscode >= ").append(RepositoryEntry.ACC_USERS).append(" and sg_coach.g_role = 'coach') ")//BAR
-		  .append("   or ")
-		  .append("   (sg_re.accesscode = ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+		  .append(" where sg_coach.fk_identity_id=:coachKey and sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())//TODO repo access
 		  .append(" group by sg_participant_id.id, sg_participant_user.user_id");
 		if(dbInstance.isOracle()) {
 			sb.append(", sg_participant_id.name");
@@ -631,7 +621,7 @@ public class CoachingDAO {
 			map.put(entry.getIdentityKey(), entry);
 		}
 		
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private void writeUserProperties(String user, NativeQueryBuilder sb, List<UserPropertyHandler> userPropertyHandlers) {
@@ -659,14 +649,15 @@ public class CoachingDAO {
 		  .append(" from o_repositoryentry sg_re")
 		  .append(" inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id)")
 		  .append(" inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id ")
-		  .append("  and owngroup.r_defgroup=").appendTrue().append(" and sg_owner.g_role='owner' and sg_owner.fk_identity_id=:coachKey)")
+		  .append("  and sg_owner.fk_identity_id=:coachKey and sg_owner.g_role ")
+		  		.in(GroupRoles.owner).append(")")
 		  .append(" inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id)")
 		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant')")
 		  .append(" inner join o_bs_identity sg_participant_id on (sg_participant_id.id=sg_participant.fk_identity_id)")
 		  .append(" inner join o_user sg_participant_user on (sg_participant_user.fk_identity=sg_participant_id.id)")
-		  .append(" left join o_as_user_course_infos pg_initial_launch")
+		  .append(" left join o_as_user_course_infos pg_initial_launch")//TODO repo access
 		  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = sg_participant_id.id)")
-		  .append(" where sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.fk_olatresource in (")
+		  .append(" where sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and sg_re.fk_olatresource in (")
 		  .append("  select sg_res.resource_id from o_olatresource sg_res where sg_res.resname = 'CourseModule'")
 		  .append(" )")
 		  .append(" group by sg_participant_id.id, sg_participant_user.user_id");
@@ -707,7 +698,7 @@ public class CoachingDAO {
 			appendArrayToSet(rawStat[pos++], entry.getLaunchIds());
 			stats.put(entry.getIdentityKey(), entry);
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	/**
@@ -748,19 +739,16 @@ public class CoachingDAO {
 		  .append(" from o_as_eff_statement fin_statement ")
 		  .append(" where ");
 		if(hasCoached) {
-			sb.append(" fin_statement.id in ( select ")
-			  .append("   distinct sg_statement.id as st_id ")
-			  .append("  from o_repositoryentry sg_re ")
-			  .append("  inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id) ")
+			sb.append(" fin_statement.id in ( select")
+			  .append("   distinct sg_statement.id as st_id")
+			  .append("  from o_repositoryentry sg_re")
+			  .append("  inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id)")
 			  .append("  inner join o_bs_group_member sg_coach on (sg_coach.fk_group_id=togroup.fk_group_id")
 			  .append("   and sg_coach.fk_identity_id=:coachKey and sg_coach.g_role = 'coach') ")
-			  .append("  inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='participant') ")
-			  .append("  inner join o_as_eff_statement sg_statement ")
-			  .append("    on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
-			  .append("  where  ( ")
-			  .append("    (sg_re.accesscode>").append(RepositoryEntry.ACC_OWNERS_AUTHORS).append(") ")
-			  .append("    or ")
-			  .append("    (sg_re.accesscode=").append(RepositoryEntry.ACC_OWNERS).append(" and sg_re.membersonly=").appendTrue().append(")) ")
+			  .append("  inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=sg_coach.fk_group_id and sg_participant.g_role='participant')")
+			  .append("  inner join o_as_eff_statement sg_statement")
+			  .append("    on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource)")
+			  .append("  where  sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())//TODO repo access
 			  .append(" )");
 		}
 		if(hasOwned) {
@@ -768,17 +756,17 @@ public class CoachingDAO {
 				sb.append(" or ");
 			}
 		
-			sb.append("  fin_statement.id in ( select  ")
-			  .append("    distinct sg_statement.id as st_id ")
-			  .append("  from o_repositoryentry sg_re ")
-			  .append("  inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id ) ")
+			sb.append("  fin_statement.id in ( select")
+			  .append("    distinct sg_statement.id as st_id")
+			  .append("  from o_repositoryentry sg_re")
+			  .append("  inner join o_re_to_group owngroup on (owngroup.fk_entry_id = sg_re.repositoryentry_id)")
 			  .append("  inner join o_bs_group_member sg_owner on (sg_owner.fk_group_id=owngroup.fk_group_id")
 			  .append("    and sg_owner.g_role='owner' and sg_owner.fk_identity_id=:coachKey and owngroup.r_defgroup=").appendTrue().append(")")
 			  .append("  inner join o_re_to_group togroup on (togroup.fk_entry_id = sg_re.repositoryentry_id) ")
-			  .append("  inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant') ")
-			  .append("  inner join o_as_eff_statement sg_statement ")
-			  .append("    on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
-			  .append("  where sg_re.accesscode>=").append(RepositoryEntry.ACC_OWNERS).append(") ");
+			  .append("  inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant')")
+			  .append("  inner join o_as_eff_statement sg_statement ")//TODO repo access
+			  .append("    on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource)")
+			  .append("  where sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")");
 		  
 		}
 		sb.append(" group by fin_statement.fk_identity");
@@ -799,7 +787,7 @@ public class CoachingDAO {
 				entry.setCountFailed(failed);
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	/**
@@ -837,7 +825,7 @@ public class CoachingDAO {
 		  .append(" left join o_as_user_course_infos pg_initial_launch ")
 		  .append("   on (pg_initial_launch.fk_resource_id = sg_re.fk_olatresource and pg_initial_launch.fk_identity = id_participant.id) ")
 		  .append(" inner join o_user user_participant on (user_participant.fk_identity=id_participant.id)")
-		  .append(" where sg_re.accesscode >= ").append(RepositoryEntry.ACC_OWNERS).append(" ");
+		  .append(" where sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" ");//TODO repo access
 		appendUsersStatisticsSearchParams(params, queryParams, sb)
 		  .append(" group by sg_participant_id.id, sg_participant_user.user_id");
 		if(dbInstance.isOracle()) {
@@ -870,7 +858,7 @@ public class CoachingDAO {
 			entry.setInitialLaunch(((Number)rawStat[pos++]).intValue());
 			map.put(identityKey, entry);
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 	private boolean getUsersStatisticsStatements(SearchCoachedIdentityParams params, Map<Long,StudentStatEntry> map) {
@@ -888,8 +876,8 @@ public class CoachingDAO {
 		  .append(" inner join o_bs_group_member sg_participant on (sg_participant.fk_group_id=togroup.fk_group_id and sg_participant.g_role='participant') ")
 		  .append(" inner join o_as_eff_statement sg_statement on (sg_statement.fk_identity = sg_participant.fk_identity_id and sg_statement.fk_resource_id = sg_re.fk_olatresource) ")
 		  .append(" inner join o_bs_identity id_participant on (sg_participant.fk_identity_id = id_participant.id) ");
-		appendUsersStatisticsJoins(params, sb)
-		  .append(" where  sg_re.accesscode>=").append(RepositoryEntry.ACC_OWNERS);
+		appendUsersStatisticsJoins(params, sb)//TODO repo access
+		  .append(" where  sg_re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());
 		appendUsersStatisticsSearchParams(params, queryParams, sb)
 		  .append(") ")
 		  .append("group by fin_statement.fk_identity ");
@@ -913,7 +901,7 @@ public class CoachingDAO {
 				entry.setCountNotAttempted(notAttempted);
 			}
 		}
-		return rawList.size() > 0;
+		return !rawList.isEmpty();
 	}
 	
 
@@ -1056,7 +1044,7 @@ public class CoachingDAO {
 	}
 
 	public List<RepositoryEntry> getStudentsCourses(Identity coach, Identity student) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(1024);
 		sb.append("select re from ").append(RepositoryEntry.class.getName()).append(" as re ")
 		  .append(" inner join re.olatResource res on res.resName='CourseModule'")
 		  .append(" inner join re.groups as relGroup ")
@@ -1064,8 +1052,7 @@ public class CoachingDAO {
 		  .append(" inner join baseGroup.members as coach on coach.role='coach'")
 		  .append(" inner join baseGroup.members as participant on participant.role='participant'")
 		  .append(" where coach.identity.key=:coachKey and participant.identity.key=:studentKey")
-		  .append(" and (re.access >= ").append(RepositoryEntry.ACC_USERS)
-		  .append("  or (re.access = ").append(RepositoryEntry.ACC_OWNERS).append(" and re.membersOnly=true))");
+		  .append(" and re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());//TODO repo access
 
 		List<RepositoryEntry> coachedEntries = dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
@@ -1073,7 +1060,7 @@ public class CoachingDAO {
 				.setParameter("studentKey", student.getKey())
 				.getResultList();
 		
-		StringBuilder sc = new StringBuilder();
+		QueryBuilder sc = new QueryBuilder(1024);
 		sc.append("select re from ").append(RepositoryEntry.class.getName()).append(" as re ")
 		  .append(" inner join re.olatResource res on res.resName='CourseModule'")
 		  .append(" inner join re.groups as ownedRelGroup on ownedRelGroup.defaultGroup=true ")
@@ -1083,7 +1070,7 @@ public class CoachingDAO {
 		  .append(" inner join relGroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as participant on participant.role='participant'")
 		  .append(" where owner.identity.key=:coachKey and participant.identity.key=:studentKey")
-		  .append(" and re.access >= ").append(RepositoryEntry.ACC_OWNERS);
+		  .append(" and re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());//TODO repo access
 
 		List<RepositoryEntry> ownedEntries = dbInstance.getCurrentEntityManager()
 				.createQuery(sc.toString(), RepositoryEntry.class)
@@ -1097,13 +1084,13 @@ public class CoachingDAO {
 	}
 	
 	public List<RepositoryEntry> getUserCourses(IdentityRef student) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(1024);
 		sb.append("select distinct(v) from ").append(RepositoryEntry.class.getName()).append(" as v ")
 		  .append(" inner join fetch v.olatResource res")
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as participant on participant.role='participant'")
-		  .append(" where res.resName='CourseModule' and v.access >= ").append(RepositoryEntry.ACC_OWNERS).append(" and participant.identity.key=:studentKey");
+		  .append(" inner join baseGroup.members as participant on participant.role='participant'")//TODO repo access
+		  .append(" where res.resName='CourseModule' and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and participant.identity.key=:studentKey");
 
 		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
diff --git a/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementListController.java b/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementListController.java
index 9521a54f384..c090e385d1f 100644
--- a/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementListController.java
+++ b/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementListController.java
@@ -304,7 +304,7 @@ public class CurriculumElementListController extends FormBasicController impleme
 		if(row.getRepositoryEntryKey() == null) return;
 			
 		List<PriceMethod> types = new ArrayList<>();
-		if (row.isMembersOnly()) {
+		if (!row.isAllUsers() && !row.isGuests()) {
 			// members only always show lock icon
 			types.add(new PriceMethod("", "o_ac_membersonly_icon", translate("cif.access.membersonly.short")));
 		} else {
@@ -345,17 +345,17 @@ public class CurriculumElementListController extends FormBasicController impleme
 	private void forgeStartLink(CurriculumElementWithViewsRow row) {
 		String label;
 		boolean isStart = true;
-		if(!row.isMembersOnly() && row.getAccessTypes() != null && !row.getAccessTypes().isEmpty() && !row.isMember()) {
-			if(guestOnly) {
+		if((row.isAllUsers() || row.isGuests()) && row.getAccessTypes() != null && !row.getAccessTypes().isEmpty() && !row.isMember()) {
+			/*if(guestOnly) {
 				if(row.getAccess() == RepositoryEntry.ACC_USERS_GUESTS) {
 					label = "start";
 				} else {
 					return;
 				}
-			} else {
+			} else {*/ //TODO repo access
 				label = "book";
 				isStart = false;
-			}
+			//}
 		} else {
 			label = "start";
 		}
diff --git a/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementWithViewsRow.java b/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementWithViewsRow.java
index 45f64701d64..7ec42dd6aae 100644
--- a/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementWithViewsRow.java
+++ b/src/main/java/org/olat/modules/curriculum/ui/CurriculumElementWithViewsRow.java
@@ -33,7 +33,7 @@ import org.olat.modules.curriculum.CurriculumElementMembership;
 import org.olat.modules.curriculum.CurriculumElementRef;
 import org.olat.modules.curriculum.CurriculumElementStatus;
 import org.olat.repository.RepositoryEntryMyView;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.ui.PriceMethod;
 import org.olat.repository.ui.RepositoyUIFactory;
 import org.olat.resource.OLATResource;
@@ -61,8 +61,9 @@ public class CurriculumElementWithViewsRow implements CurriculumElementRef, Flex
 	
 	private String shortenedDescription;
 	
-	private int access;
-	private boolean isMembersOnly;
+	private RepositoryEntryStatusEnum status;
+	private boolean allUsers;
+	private boolean guests;
 	private List<PriceMethod> accessTypes;
 
 	private boolean member;
@@ -96,10 +97,11 @@ public class CurriculumElementWithViewsRow implements CurriculumElementRef, Flex
 			parentKey = element.getKey();
 		}
 		
-		isMembersOnly = repositoryEntryView.isMembersOnly();
+		guests = repositoryEntryView.isGuests();
+		allUsers = repositoryEntryView.isAllUsers();
+		status = repositoryEntryView.getEntryStatus();
 		repositoryEntry = repositoryEntryView;
 		olatResource = repositoryEntryView.getOlatResource();
-		access = repositoryEntryView.getAccess();
 		marked = repositoryEntryView.isMarked();
 		setShortenedDescription(repositoryEntryView.getDescription());
 	}
@@ -111,8 +113,7 @@ public class CurriculumElementWithViewsRow implements CurriculumElementRef, Flex
 	
 	public boolean isActive() {
 		if(element != null) {
-			CurriculumElementStatus status = element.getStatus();
-			return status == null || status == CurriculumElementStatus.active;
+			return element.getStatus() == null || element.getStatus() == CurriculumElementStatus.active;
 		}
 		return true;
 	}
@@ -174,9 +175,7 @@ public class CurriculumElementWithViewsRow implements CurriculumElementRef, Flex
 	}
 	
 	public boolean isClosed() {
-		return repositoryEntry == null
-				? false : new RepositoryEntryStatus(repositoryEntry.getStatusCode()).isClosed()
-						|| new RepositoryEntryStatus(repositoryEntry.getStatusCode()).isUnpublished() ;
+		return status.decommissioned();
 	}
 
 	public boolean isSingleEntry() {
@@ -191,12 +190,16 @@ public class CurriculumElementWithViewsRow implements CurriculumElementRef, Flex
 		this.marked = marked;
 	}
 	
-	public int getAccess() {
-		return access;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return status;
 	}
 	
-	public boolean isMembersOnly() {
-		return isMembersOnly;
+	public boolean isAllUsers() {
+		return allUsers;
+	}
+	
+	public boolean isGuests() {
+		return guests;
 	}
 	
 	public boolean isThumbnailAvailable() {
diff --git a/src/main/java/org/olat/modules/fo/ForumNotificationsHandler.java b/src/main/java/org/olat/modules/fo/ForumNotificationsHandler.java
index c6b2bfe5f76..b08b9cfe6f1 100644
--- a/src/main/java/org/olat/modules/fo/ForumNotificationsHandler.java
+++ b/src/main/java/org/olat/modules/fo/ForumNotificationsHandler.java
@@ -52,6 +52,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.modules.fo.manager.ForumManager;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 
 /**
@@ -91,7 +92,9 @@ public class ForumNotificationsHandler extends LogDelegator implements Notificat
 				
 				if("CourseModule".equals(p.getResName())) {
 					RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(OresHelper.createOLATResourceableInstance(p.getResName(), p.getResId()), false);
-					if(re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+					if(re == null || re.getEntryStatus() == RepositoryEntryStatusEnum.closed
+							|| re.getEntryStatus() == RepositoryEntryStatusEnum.trash
+							|| re.getEntryStatus() == RepositoryEntryStatusEnum.deleted) {
 						return NotificationsManager.getInstance().getNoSubscriptionInfo();
 					}
 				}
diff --git a/src/main/java/org/olat/modules/forms/handler/EvaluationFormHandler.java b/src/main/java/org/olat/modules/forms/handler/EvaluationFormHandler.java
index 419fb60d4fc..128d896edcf 100644
--- a/src/main/java/org/olat/modules/forms/handler/EvaluationFormHandler.java
+++ b/src/main/java/org/olat/modules/forms/handler/EvaluationFormHandler.java
@@ -71,6 +71,7 @@ import org.olat.modules.forms.ui.EvaluationFormExecutionController;
 import org.olat.modules.forms.ui.EvaluationFormRuntimeController;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.EditionSupport;
@@ -121,7 +122,8 @@ public class EvaluationFormHandler implements RepositoryHandler {
 			Object createObject, Organisation organisation, Locale locale) {
 		EvaluationFormResource ores = new EvaluationFormResource();
 		OLATResource resource = olatResourceManager.findOrPersistResourceable(ores);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource,
+				RepositoryEntryStatusEnum.preparation, organisation);
 		dbInstance.commit();
 		
 		File repositoryDir = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), FileResourceManager.ZIPDIR);
@@ -155,7 +157,8 @@ public class EvaluationFormHandler implements RepositoryHandler {
 		File zipDir = new File(fResourceFileroot, FileResourceManager.ZIPDIR);
 		copyResource(file, filename, zipDir);
 
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource,
+				RepositoryEntryStatusEnum.preparation, organisation);
 		dbInstance.commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java b/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java
index f505f22f792..0c321828b96 100644
--- a/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java
+++ b/src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java
@@ -34,6 +34,7 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.id.Identity;
 import org.olat.core.util.StringHelper;
 import org.olat.modules.lecture.LectureBlock;
@@ -54,6 +55,7 @@ import org.olat.modules.lecture.model.LectureBlockStatistics;
 import org.olat.modules.lecture.model.LectureStatisticsSearchParameters;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.user.UserManager;
 import org.olat.user.propertyhandlers.UserPropertyHandler;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -550,7 +552,7 @@ public class LectureBlockRollCallDAO {
 			boolean absenceDefaultAuthorized, boolean countAuthorizedAbsenceAsAttendant,
 			boolean calculateAttendanceRate, double requiredAttendanceRateDefault) {
 		
-		StringBuilder sb = new StringBuilder(2048);
+		QueryBuilder sb = new QueryBuilder(2048);
 		sb.append("select ident.key as participantKey, ident.name as participantName,")
 		  .append("  call.lecturesAttendedNumber as attendedLectures,")
 		  .append("  call.lecturesAbsentNumber as absentLectures,")
@@ -589,11 +591,10 @@ public class LectureBlockRollCallDAO {
 		sb.append(" and (exists (select rel from repoentrytogroup as rel, bgroupmember as membership ")
 		  .append("     where re.key=rel.entry.key and membership.group.key=rel.group.key and rel.defaultGroup=true and membership.identity.key=:identityKey")
 		  .append("     and membership.role in ('").append(OrganisationRoles.administrator.name()).append("','").append(OrganisationRoles.lecturemanager.name()).append("','").append(GroupRoles.owner.name()).append("')")
-		  .append("     and re.access >= ").append(RepositoryEntry.ACC_OWNERS)
+		  .append("     and re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
 		  .append(" ) or exists (select membership.key from bgroupmember as membership ")
 		  .append("     where block.teacherGroup.key=membership.group.key and membership.identity.key=:identityKey")
-		  .append("     and (re.access >= ").append(RepositoryEntry.ACC_USERS)
-		  .append("     or (re.access = ").append(RepositoryEntry.ACC_OWNERS).append(" and re.membersOnly=true))")
+		  .append("     and re.status ").in(RepositoryEntryStatusEnum.publishedAndClosed())
 		  .append(" ))");
 	
 
@@ -715,7 +716,7 @@ public class LectureBlockRollCallDAO {
 	}
 	
 	private void appendUsersStatisticsSearchParams(LectureStatisticsSearchParameters params, Map<String,Object> queryParams,
-			List<UserPropertyHandler> userPropertyHandlers, StringBuilder sb) {
+			List<UserPropertyHandler> userPropertyHandlers, QueryBuilder sb) {
 		if(StringHelper.containsNonWhitespace(params.getLogin())) {
 			String login = PersistenceHelper.makeFuzzyQueryString(params.getLogin());
 			if (login.contains("_") && dbInstance.isOracle()) {
diff --git a/src/main/java/org/olat/modules/portfolio/handler/BinderTemplateHandler.java b/src/main/java/org/olat/modules/portfolio/handler/BinderTemplateHandler.java
index 8c833e20897..98e1b481973 100644
--- a/src/main/java/org/olat/modules/portfolio/handler/BinderTemplateHandler.java
+++ b/src/main/java/org/olat/modules/portfolio/handler/BinderTemplateHandler.java
@@ -64,6 +64,7 @@ import org.olat.modules.portfolio.ui.PortfolioAssessmentDetailsController;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryImportExport;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.EditionSupport;
@@ -101,7 +102,8 @@ public class BinderTemplateHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
 		OLATResource resource = portfolioService.createBinderTemplateResource();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource,
+				RepositoryEntryStatusEnum.preparation, organisation);
 		portfolioService.createAndPersistBinderTemplate(initialAuthor, re, locale);
 		DBFactory.getInstance().commit();
 		return re;
@@ -132,8 +134,8 @@ public class BinderTemplateHandler implements RepositoryHandler {
 			FileResource.copyResource(file, filename, zipRoot);
 
 			//create repository entry
-			RepositoryEntry re = repositoryService
-					.create(initialAuthor, initialAuthorAlt, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+			RepositoryEntry re = repositoryService.create(initialAuthor, initialAuthorAlt, "", displayname, description, resource,
+					RepositoryEntryStatusEnum.preparation, organisation);
 			
 			//import binder
 			File binderFile = new File(zipRoot, BinderTemplateResource.BINDER_XML);
diff --git a/src/main/java/org/olat/modules/portfolio/manager/BinderDAO.java b/src/main/java/org/olat/modules/portfolio/manager/BinderDAO.java
index 45b3173fdfa..1b2bd3baecf 100644
--- a/src/main/java/org/olat/modules/portfolio/manager/BinderDAO.java
+++ b/src/main/java/org/olat/modules/portfolio/manager/BinderDAO.java
@@ -36,6 +36,7 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.basesecurity.Invitation;
 import org.olat.basesecurity.manager.GroupDAO;
 import org.olat.core.commons.persistence.DB;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.id.Identity;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -59,6 +60,7 @@ import org.olat.modules.portfolio.model.PageImpl;
 import org.olat.modules.portfolio.model.SectionImpl;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -1175,16 +1177,15 @@ public class BinderDAO {
 	 * @return
 	 */
 	public List<RepositoryEntry> searchCourseTemplates(IdentityRef participant) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder();
 		sb.append("select v from ").append(RepositoryEntry.class.getName()).append(" as v ")
 		  .append(" inner join fetch v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as membership on (membership.identity.key=:identityKey and membership.role='").append(GroupRoles.participant.name()).append("')")
 		  .append(" inner join fetch v.olatResource as ores")
 		  .append(" inner join fetch v.statistics as statistics")
-		  .append(" left join fetch v.lifecycle as lifecycle")
-		  .append(" where (v.access >= ").append(RepositoryEntry.ACC_USERS).append(" or ")
-		  .append("  (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
+		  .append(" left join fetch v.lifecycle as lifecycle")//TODO repo access
+		  .append(" where v.status ").in(RepositoryEntryStatusEnum.published)
 		  .append(" and exists (select ref.key from references as ref ")
 		  .append("   inner join ref.target as targetOres")
 		  .append("   where ref.source.key=ores.key and targetOres.resName='BinderTemplate'")
diff --git a/src/main/java/org/olat/modules/reminder/manager/ReminderDAO.java b/src/main/java/org/olat/modules/reminder/manager/ReminderDAO.java
index 16020f3b17a..3fea946f65d 100644
--- a/src/main/java/org/olat/modules/reminder/manager/ReminderDAO.java
+++ b/src/main/java/org/olat/modules/reminder/manager/ReminderDAO.java
@@ -31,6 +31,7 @@ import javax.persistence.TypedQuery;
 
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.id.Identity;
 import org.olat.modules.reminder.Reminder;
 import org.olat.modules.reminder.SentReminder;
@@ -39,6 +40,7 @@ import org.olat.modules.reminder.model.ReminderInfos;
 import org.olat.modules.reminder.model.SentReminderImpl;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.user.UserManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -136,11 +138,11 @@ public class ReminderDAO {
 	 * @return A list of reminders
 	 */
 	public List<Reminder> getReminders(Date startDate) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(256);
 		sb.append("select rem from reminder rem")
 		  .append(" inner join rem.entry entry")
 		  .append(" where (rem.startDate is null or rem.startDate<=:startDate)")
-		  .append(" and entry.statusCode=0 and entry.access>").append(RepositoryEntry.DELETED);
+		  .append(" and entry.status ").in(RepositoryEntryStatusEnum.preparationToClosed());
 
 		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), Reminder.class)
diff --git a/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java b/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java
index 58ff6275e8e..d18faf91270 100644
--- a/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java
+++ b/src/main/java/org/olat/modules/sharedfolder/SharedFolderWebDAVMergeSource.java
@@ -34,6 +34,7 @@ import org.olat.core.logging.Tracing;
 import org.olat.core.util.vfs.VFSContainer;
 import org.olat.fileresource.types.SharedFolderFileResource;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
 
@@ -94,7 +95,8 @@ public class SharedFolderWebDAVMergeSource extends WebDAVMergeSource {
 				List<Long> publiclyReadableFoldersKeys = getSharedKeys();	
 				List<RepositoryEntry> entries = repoManager.lookupRepositoryEntries(publiclyReadableFoldersKeys);
 				for (RepositoryEntry entry:entries) {
-					if (entry.getAccess() >= RepositoryEntry.ACC_USERS || (entry.getAccess() == RepositoryEntry.ACC_OWNERS && entry.isMembersOnly())) {
+					if (entry.getEntryStatus() == RepositoryEntryStatusEnum.published
+							|| entry.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 						// add folder (which is a repo entry) to root container if not present
 						addReadonlyFolder(entry, sfm, addedEntries, containers);
 					} else {
diff --git a/src/main/java/org/olat/modules/video/ui/VideoListingController.java b/src/main/java/org/olat/modules/video/ui/VideoListingController.java
index 7df61f7b633..c0e6f957228 100644
--- a/src/main/java/org/olat/modules/video/ui/VideoListingController.java
+++ b/src/main/java/org/olat/modules/video/ui/VideoListingController.java
@@ -166,7 +166,7 @@ public class VideoListingController extends FormBasicController implements Activ
 		RepositoryEntry videoEntry = repositoryManager.lookupRepositoryEntry(id);
 		if (repositoryManager.isAllowed(ureq, videoEntry).canLaunch()) {
 			
-			boolean readOnly = repositoryManager.createRepositoryEntryStatus(videoEntry.getStatusCode()).isClosed();
+			boolean readOnly = videoEntry.getEntryStatus().decommissioned();
 			VideoDisplayController videoDisplayCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, true, true, true, true, null, false, true, null, readOnly);
 			listenTo(videoDisplayCtr);
 			toolbarPanel.pushController(videoEntry.getDisplayname(), videoDisplayCtr);
diff --git a/src/main/java/org/olat/modules/webFeed/dispatching/FeedMediaDispatcher.java b/src/main/java/org/olat/modules/webFeed/dispatching/FeedMediaDispatcher.java
index fcb58b9b072..19b712adde8 100644
--- a/src/main/java/org/olat/modules/webFeed/dispatching/FeedMediaDispatcher.java
+++ b/src/main/java/org/olat/modules/webFeed/dispatching/FeedMediaDispatcher.java
@@ -351,7 +351,7 @@ public class FeedMediaDispatcher extends LogDelegator implements Dispatcher {
 	 */
 	private boolean allowsGuestAccess(final RepositoryEntry repoEntry) {
 		boolean guestsAllowed = false;
-		if (repoEntry != null && repoEntry.getAccess() == RepositoryEntry.ACC_USERS_GUESTS) {
+		if (repoEntry != null && repoEntry.isGuests()) {
 			guestsAllowed = true;
 		}
 		return guestsAllowed;
diff --git a/src/main/java/org/olat/modules/webFeed/dispatching/Path.java b/src/main/java/org/olat/modules/webFeed/dispatching/Path.java
index 70d47f492bc..9da1482bbbe 100644
--- a/src/main/java/org/olat/modules/webFeed/dispatching/Path.java
+++ b/src/main/java/org/olat/modules/webFeed/dispatching/Path.java
@@ -519,7 +519,7 @@ public class Path {
 			// private.
 			boolean isPrivate = true;
 			RepositoryEntry entry = RepositoryManager.getInstance().lookupRepositoryEntry(feed, false);
-			if (entry != null && entry.getAccess() == RepositoryEntry.ACC_USERS_GUESTS) {
+			if (entry != null && entry.isGuests()) {
 				isPrivate = false;
 			}
 
diff --git a/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java b/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java
index 63dd9062b8c..f0900fbec40 100644
--- a/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java
+++ b/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java
@@ -49,6 +49,7 @@ import org.olat.modules.webFeed.Feed;
 import org.olat.modules.webFeed.Item;
 import org.olat.modules.webFeed.ui.FeedMainController;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.user.UserManager;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -88,7 +89,8 @@ public abstract class FeedNotificationsHandler implements NotificationsHandler {
 				try {
 					RepositoryEntry re = repoManager.lookupRepositoryEntry(
 							OresHelper.createOLATResourceableInstance(p.getResName(), p.getResId()), false);
-					if (re.getAccess() == RepositoryEntry.DELETED || re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) {
+					RepositoryEntryStatusEnum status = re.getEntryStatus();
+					if (status.decommissioned()) {
 						return notificationsManager.getNoSubscriptionInfo();
 					}
 					String displayName = re.getDisplayname();
diff --git a/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java b/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java
index 2642172fea7..7304da47750 100644
--- a/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java
+++ b/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java
@@ -213,9 +213,7 @@ public class WikiPageChangeOrCreateNotificationHandler implements NotificationsH
 	
 	private boolean courseStatus(ICourse course) {
 		return course != null
-				&& course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getAccess() !=  RepositoryEntry.DELETED
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isUnpublished()
-				&& !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed();
+				&& course.getCourseEnvironment().getCourseGroupManager().isNotificationsAllowed();
 	}
 	
 	private void checkPublisher(Publisher p) {
diff --git a/src/main/java/org/olat/repository/RepositoryEntry.hbm.xml b/src/main/java/org/olat/repository/RepositoryEntry.hbm.xml
index 6878dfcb6b6..6c9bf424895 100644
--- a/src/main/java/org/olat/repository/RepositoryEntry.hbm.xml
+++ b/src/main/java/org/olat/repository/RepositoryEntry.hbm.xml
@@ -15,9 +15,9 @@
 
 		<property name="displayname" column="displayname" type="string"/>
 		<property name="description" column="description" type="string"/>
-		<property name="access" column="accesscode" type="int"/>
-		<property name="statusCode" column="statuscode" type="int"/>
-		<property name="membersOnly" column="membersonly" type="boolean"/>
+		<property name="status" column="status" type="string"/>
+		<property name="allUsers" column="allusers" type="boolean"/>
+		<property name="guests" column="guests" type="boolean"/>
 
 		<many-to-one name="olatResource"
                      column="fk_olatresource"
diff --git a/src/main/java/org/olat/repository/RepositoryEntry.java b/src/main/java/org/olat/repository/RepositoryEntry.java
index 5999f144d61..1714a2ca32c 100644
--- a/src/main/java/org/olat/repository/RepositoryEntry.java
+++ b/src/main/java/org/olat/repository/RepositoryEntry.java
@@ -43,7 +43,6 @@ import javax.persistence.OneToMany;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
-import javax.persistence.Transient;
 import javax.persistence.Version;
 
 import org.hibernate.annotations.GenericGenerator;
@@ -81,33 +80,11 @@ import org.olat.resource.OLATResourceImpl;
 	@NamedQuery(name="getDisplayNameByResourceKey", query="select v.displayname from repositoryentry v where v.olatResource.key=:resKey"),
 	@NamedQuery(name="getDisplayNameByOlatResourceRedId", query="select v.displayname from repositoryentry v inner join v.olatResource as ores where ores.resId=:resid"),
 	@NamedQuery(name="getDisplayNameByRepositoryEntryKey", query="select v.displayname from repositoryentry v where v.key=:reKey")
-
 })
 public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntryRef, ModifiedInfo, OLATResourceable {
 
 	private static final long serialVersionUID = 5319576295875289054L;
-	// IMPORTANT: Keep relation ACC_OWNERS < ACC_OWNERS_AUTHORS < ACC_USERS < ACC_USERS_GUESTS
-	
-	public static final int DELETED = 0;
-	/**
-	 * limit access to owners
-	 */
-	public static final int ACC_OWNERS = 1; // limit access to owners
-	/**
-	 * limit access to owners and authors
-	 */
-	public static final int ACC_OWNERS_AUTHORS = 2; // limit access to owners and authors
-	/**
-	 * limit access to owners, authors and users
-	 */
-	public static final int ACC_USERS = 3; // limit access to owners, authors and users
-	/**
-	 * no limits
-	 */
-	public static final int ACC_USERS_GUESTS = 4; // no limits
-	
-	public static final String MEMBERS_ONLY =  "membersonly";
-	
+
 	@Id
 	@GeneratedValue(generator = "system-uuid")
 	@GenericGenerator(name = "system-uuid", strategy = "enhanced-sequence", parameters={
@@ -189,20 +166,19 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 	@JoinColumn(name="fk_stats", nullable=false, insertable=true, updatable=false)
 	private RepositoryEntryStatistics statistics;
 
-	@Column(name="accesscode", nullable=false, insertable=true, updatable=true)
-	private int access;
+	@Column(name="status", nullable=false, insertable=true, updatable=true)
+	private String status;
+	@Column(name="allusers", nullable=false, insertable=true, updatable=true)
+	private boolean allUsers;
+	@Column(name="guests", nullable=false, insertable=true, updatable=true)
+	private boolean guests;
+	
 	@Column(name="cancopy", nullable=false, insertable=true, updatable=true)
 	private boolean canCopy;
 	@Column(name="canreference", nullable=false, insertable=true, updatable=true)
 	private boolean canReference;
-	@Column(name="canlaunch", nullable=false, insertable=true, updatable=true)
-	private boolean canLaunch;
 	@Column(name="candownload", nullable=false, insertable=true, updatable=true)
 	private boolean canDownload;
-	@Column(name="membersonly", nullable=false, insertable=true, updatable=true)
-	private boolean membersOnly;
-	@Column(name="statuscode", nullable=false, insertable=true, updatable=true)
-	private int statusCode;
 	@Column(name="allowToLeave", nullable=true, insertable=true, updatable=true)
 	private String allowToLeave;
 
@@ -212,14 +188,12 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 	@ManyToOne(targetEntity=IdentityImpl.class,fetch=FetchType.LAZY, optional=true)
 	@JoinColumn(name="fk_deleted_by", nullable=true, insertable=true, updatable=true)
 	private Identity deletedBy;
-
 	
 	/**
 	 * Default constructor.
 	 */
 	public RepositoryEntry() {
 		softkey = CodeHelper.getGlobalForeverUniqueID();
-		access = ACC_OWNERS;
 	}
 
 	@Override
@@ -232,8 +206,6 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 		return creationDate;
 	}
 
-
-
 	/**
 	 * @return The softkey associated with this repository entry.
 	 */
@@ -318,8 +290,7 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 	 * @return description as HTML snippet
 	 */
 	public String getFormattedDescription() {
-		String descr = Formatter.formatLatexFormulas(getDescription());
-		return descr;		
+		return Formatter.formatLatexFormulas(getDescription());		
 	}
 	
 	/**
@@ -345,25 +316,6 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 	public void setAuthors(String authors) {
 		this.authors = authors;
 	}
-
-	/**
-	 * @return Returns the statusCode.
-	 */
-	public int getStatusCode() {
-		return statusCode;
-	}
-
-	/**
-	 * @param statusCode The statusCode to set.
-	 */
-	public void setStatusCode(int statusCode) {
-		this.statusCode = statusCode;
-	}
-	
-	@Transient
-	public RepositoryEntryStatus getRepositoryEntryStatus() {
-		return new RepositoryEntryStatus(statusCode);
-	}
 	
 	/**
 	 * @return Returns the name.
@@ -433,28 +385,6 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 		return canDownload;
 	}
 
-	/**
-	 * @return Wether this repo entry can be launched.
-	 */
-	public boolean getCanLaunch() {
-		return canLaunch;
-	}
-
-	/**
-	 * @return Access restrictions.
-	 */
-	public int getAccess() {
-		return access;
-	}
-	
-	/**
-	 * Is the repository entry exclusive
-	 * @return
-	 */
-	public boolean isMembersOnly() {
-		return membersOnly;
-	}
-
 	/**
 	 * @param b
 	 */
@@ -476,27 +406,36 @@ public class RepositoryEntry implements CreateInfo, Persistable , RepositoryEntr
 		canDownload = b;
 	}
 
-	/**
-	 * @param b
-	 */
-	public void setCanLaunch(boolean b) {
-		canLaunch = b;
+	public String getStatus() {
+		return status;
 	}
 
-	/**
-	 * Set access restrictions.
-	 * @param i
-	 */
-	public void setAccess(int i) {
-		access = i;
+	public void setStatus(String status) {
+		this.status = status;
 	}
 	
-	/**
-	 * Set if the repository entry is exclusive 
-	 * @param membersOnly
-	 */
-	public void setMembersOnly(boolean membersOnly) {
-		this.membersOnly = membersOnly;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return RepositoryEntryStatusEnum.valueOf(status);
+	}
+	
+	public void setEntryStatus(RepositoryEntryStatusEnum status) {
+		this.status = status.name();
+	}
+
+	public boolean isAllUsers() {
+		return allUsers;
+	}
+
+	public void setAllUsers(boolean allUsers) {
+		this.allUsers = allUsers;
+	}
+
+	public boolean isGuests() {
+		return guests;
+	}
+
+	public void setGuests(boolean guests) {
+		this.guests = guests;
 	}
 
 	public String getAllowToLeave() {
diff --git a/src/main/java/org/olat/repository/RepositoryEntryLight.java b/src/main/java/org/olat/repository/RepositoryEntryLight.java
index a8cb0d3d022..2247e7455ee 100644
--- a/src/main/java/org/olat/repository/RepositoryEntryLight.java
+++ b/src/main/java/org/olat/repository/RepositoryEntryLight.java
@@ -29,8 +29,10 @@ public interface RepositoryEntryLight extends RepositoryEntryShort {
 
 	public String getDescription();
 	
-	public int getAccess();
+	public RepositoryEntryStatusEnum getEntryStatus();
 	
-	public boolean isMembersOnly();
+	public boolean isAllUsers();
+	
+	public boolean isGuests();
 	
 }
diff --git a/src/main/java/org/olat/repository/RepositoryEntryMyView.java b/src/main/java/org/olat/repository/RepositoryEntryMyView.java
index f2f1d4bed37..f912642cd80 100644
--- a/src/main/java/org/olat/repository/RepositoryEntryMyView.java
+++ b/src/main/java/org/olat/repository/RepositoryEntryMyView.java
@@ -45,17 +45,17 @@ public interface RepositoryEntryMyView extends OLATResourceable {
 	
 	public Date getCreationDate();
 	
-	public int getAccess();
-	
-	public int getStatusCode();
-	
 	public String getAuthors();
 	
 	public String getLocation();
 	
 	public String getExpenditureOfWork();
 	
-	public boolean isMembersOnly();
+	public RepositoryEntryStatusEnum getEntryStatus();
+	
+	public boolean isAllUsers();
+	
+	public boolean isGuests();
 	
 	public OLATResource getOlatResource();
 	
diff --git a/src/main/java/org/olat/repository/RepositoryEntryShort.java b/src/main/java/org/olat/repository/RepositoryEntryShort.java
index 81662c2ab88..50fcb7d7bb6 100644
--- a/src/main/java/org/olat/repository/RepositoryEntryShort.java
+++ b/src/main/java/org/olat/repository/RepositoryEntryShort.java
@@ -31,6 +31,6 @@ public interface RepositoryEntryShort extends RepositoryEntryRef {
 	
 	public String getResourceType();
 	
-	public int getStatusCode();
+	public RepositoryEntryStatusEnum getEntryStatus();
 	
 }
diff --git a/src/main/java/org/olat/repository/RepositoryEntryStatusEnum.java b/src/main/java/org/olat/repository/RepositoryEntryStatusEnum.java
new file mode 100644
index 00000000000..1565c31c556
--- /dev/null
+++ b/src/main/java/org/olat/repository/RepositoryEntryStatusEnum.java
@@ -0,0 +1,109 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.repository;
+
+import org.olat.core.util.StringHelper;
+
+/**
+ * 
+ * Initial date: 20 juil. 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public enum RepositoryEntryStatusEnum {
+	
+	preparation,
+	review,
+	coachpublished,
+	published,
+	closed,
+	trash,
+	deleted;
+	
+	/**
+	 * @return true if the value is closed, trash or deleted
+	 */
+	public boolean decommissioned() {
+		return this == RepositoryEntryStatusEnum.closed
+				|| this == RepositoryEntryStatusEnum.trash
+				|| this == RepositoryEntryStatusEnum.deleted;
+	}
+	
+	public static RepositoryEntryStatusEnum[] preparationToClosed() {
+		return new RepositoryEntryStatusEnum[] {
+			RepositoryEntryStatusEnum.preparation, RepositoryEntryStatusEnum.review,
+			RepositoryEntryStatusEnum.coachpublished, RepositoryEntryStatusEnum.published,
+			RepositoryEntryStatusEnum.closed
+		};
+	}
+	
+	public static RepositoryEntryStatusEnum[] preparationToPublished() {
+		return new RepositoryEntryStatusEnum[] {
+			RepositoryEntryStatusEnum.preparation, RepositoryEntryStatusEnum.review,
+			RepositoryEntryStatusEnum.coachpublished, RepositoryEntryStatusEnum.published
+		};
+	}
+	
+	public static RepositoryEntryStatusEnum[] reviewToClosed() {
+		return new RepositoryEntryStatusEnum[] {
+			RepositoryEntryStatusEnum.review, RepositoryEntryStatusEnum.coachpublished,
+			RepositoryEntryStatusEnum.published, RepositoryEntryStatusEnum.closed
+		};
+	}
+	
+	public static RepositoryEntryStatusEnum[] publishedAndClosed() {
+		return new RepositoryEntryStatusEnum[] {
+			RepositoryEntryStatusEnum.published, RepositoryEntryStatusEnum.closed
+		};
+	}
+	
+	public static RepositoryEntryStatusEnum[] coachPublishedToClosed() {
+		return new RepositoryEntryStatusEnum[] {
+				RepositoryEntryStatusEnum.coachpublished, RepositoryEntryStatusEnum.published, RepositoryEntryStatusEnum.closed
+		};
+	}
+	
+	public static RepositoryEntryStatusEnum[] authors() {
+		return new RepositoryEntryStatusEnum[] {
+			RepositoryEntryStatusEnum.preparation, RepositoryEntryStatusEnum.review,
+			RepositoryEntryStatusEnum.coachpublished, RepositoryEntryStatusEnum.published,
+			RepositoryEntryStatusEnum.closed
+		};
+	}
+	
+	public static RepositoryEntryStatusEnum[] users() {
+		return new RepositoryEntryStatusEnum[] {
+			RepositoryEntryStatusEnum.published, RepositoryEntryStatusEnum.closed
+		};
+	}
+	
+	public static boolean isValid(String string) {
+		boolean allOk = false;
+		if(StringHelper.containsNonWhitespace(string)) {
+			for(RepositoryEntryStatusEnum status:values()) {
+				if(status.name().equals(string)) {
+					allOk = true;
+					break;
+				}
+			}
+		}
+		return allOk;
+	}	
+}
diff --git a/src/main/java/org/olat/repository/RepositoryManager.java b/src/main/java/org/olat/repository/RepositoryManager.java
index e09a76f9503..8904013424d 100644
--- a/src/main/java/org/olat/repository/RepositoryManager.java
+++ b/src/main/java/org/olat/repository/RepositoryManager.java
@@ -49,6 +49,7 @@ import org.olat.core.commons.modules.bc.meta.MetaInfo;
 import org.olat.core.commons.modules.bc.meta.tagged.MetaTagged;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.commons.services.image.ImageService;
 import org.olat.core.commons.services.image.Size;
 import org.olat.core.commons.services.mark.impl.MarkImpl;
@@ -144,13 +145,6 @@ public class RepositoryManager {
 		return CoreSpringFactory.getImpl(RepositoryManager.class);
 	}
 
-	/**
-	 * @param repositoryEntryStatusCode
-	 */
-	public RepositoryEntryStatus createRepositoryEntryStatus(int repositoryEntryStatusCode) {
-		return new RepositoryEntryStatus(repositoryEntryStatusCode);
-	}
-
 	/**
 	 * Copy the repo entry image from the source to the target repository entry.
 	 * If the source repo entry does not exists, nothing will happen
@@ -518,16 +512,6 @@ public class RepositoryManager {
 				.getResultList();
 	}
 
-	/**
-	 * Test a repo entry if identity is allowed to launch.
-	 * @param ureq
-	 * @param re
-	 * @return True if current identity is allowed to launch the given repo entry.
-	 */
-	public boolean isAllowedToLaunch(UserRequest ureq, RepositoryEntry re) {
-		return isAllowedToLaunch(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
-	}
-
 	public RepositoryEntrySecurity isAllowed(UserRequest ureq, RepositoryEntry re) {
 		return isAllowed(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
 	}
@@ -540,27 +524,8 @@ public class RepositoryManager {
 	 * @return True if current identity is allowed to launch the given repo entry.
 	 */
 	public boolean isAllowedToLaunch(Identity identity, Roles roles, RepositoryEntry re) {
-		// allow if identity is owner
-		// allow for administrators, institutional resource manager and principals
-		if (repositoryEntryRelationDao.hasRole(identity, re, true, OrganisationRoles.administrator.name(),
-				OrganisationRoles.learnresourcemanager.name(), OrganisationRoles.principal.name(),
-				GroupRoles.owner.name())) {
-			return true;
-		}
-		// allow for authors if access granted at least for authors
-		if (roles.isAuthor() && re.getAccess() >= RepositoryEntry.ACC_OWNERS_AUTHORS) return true;
-		// allow for guests if access granted for guests
-		if (roles.isGuestOnly()) {
-			return (re.getAccess() >= RepositoryEntry.ACC_USERS_GUESTS);
-		}
-		// else allow if access granted for users
-		if(re.getAccess() >= RepositoryEntry.ACC_USERS) {
-			return true;
-		} else if (re.getAccess() == RepositoryEntry.ACC_OWNERS && re.isMembersOnly()) {
-			return repositoryEntryRelationDao.isMember(identity, re);
-		}
-
-		return false;
+		RepositoryEntrySecurity reSecurity = isAllowed(identity, roles, re);
+		return reSecurity.canLaunch();
 	}
 
 	public RepositoryEntrySecurity isAllowed(Identity identity, Roles roles, RepositoryEntry re) {
@@ -580,11 +545,13 @@ public class RepositoryManager {
 		boolean isLearnRessourceManager = false;
 		
 		boolean canLaunch = false;
-
+		
+		RepositoryEntryStatusEnum status = re.getEntryStatus();
 		if (roles.isGuestOnly()) {
-			if (re.getAccess() >= RepositoryEntry.ACC_USERS_GUESTS) {
+			if (re.isGuests()) {
 				// allow for guests if access granted for guests
-				canLaunch = true;
+				canLaunch = status == RepositoryEntryStatusEnum.published
+						|| status == RepositoryEntryStatusEnum.closed;
 			}
 		} else {
 			// allow if identity is owner
@@ -655,22 +622,23 @@ public class RepositoryManager {
 				isEntryAdmin = true;
 			} else if(isPrincipal) {
 				canLaunch = true;
-			}
-			if (isAuthor && re.getAccess() >= RepositoryEntry.ACC_OWNERS_AUTHORS) {
+			} else if (isAuthor && (status == RepositoryEntryStatusEnum.review
+					|| status == RepositoryEntryStatusEnum.coachpublished
+					|| status == RepositoryEntryStatusEnum.published
+					|| status == RepositoryEntryStatusEnum.closed)) {
 				// allow for authors if access granted at least for authors
 				canLaunch = true;
-			} else if(re.getAccess() >= RepositoryEntry.ACC_USERS) {
+			} else if(re.isAllUsers() || re.isGuests()) {
 				// allow if access granted for users
-				canLaunch = true;
-			} else if (re.getAccess() == RepositoryEntry.ACC_OWNERS && re.isMembersOnly()) {
+				canLaunch = (status == RepositoryEntryStatusEnum.published || status == RepositoryEntryStatusEnum.closed);
+			} else if(!canLaunch && (isGroupParticipant || isGroupCoach || isCourseParticipant || isCourseCoach
+					|| isCurriculumParticipant || isCurriculumCoach)) {
 				// check if it's a member
-				if(!canLaunch && (isGroupParticipant || isGroupCoach || isCourseParticipant || isCourseCoach || isCurriculumParticipant || isCurriculumCoach)) {
-					canLaunch = true;
-				}
+				canLaunch = (status == RepositoryEntryStatusEnum.published || status == RepositoryEntryStatusEnum.closed);
 			}
 		}
 
-		boolean readOnly = new RepositoryEntryStatus(re.getStatusCode()).isClosed();
+		boolean readOnly = re.getEntryStatus() == RepositoryEntryStatusEnum.closed;
 
 		return new RepositoryEntrySecurity(isEntryAdmin, isOwner,
 				isCourseParticipant, isCourseCoach,
@@ -679,13 +647,14 @@ public class RepositoryManager {
 				isAuthor, isPrincipal, canLaunch, readOnly);
 	}
 
-	public RepositoryEntry setAccess(final RepositoryEntry re, int access, boolean membersOnly) {
+	public RepositoryEntry setAccess(final RepositoryEntry re, RepositoryEntryStatusEnum status, boolean allUsers, boolean guests) {
 		RepositoryEntry reloadedRe = repositoryEntryDao.loadForUpdate(re);
 		if(reloadedRe == null) {
 			return null;
 		}
-		reloadedRe.setAccess(access);
-		reloadedRe.setMembersOnly(membersOnly);
+		reloadedRe.setEntryStatus(status);
+		reloadedRe.setAllUsers(allUsers);
+		reloadedRe.setGuests(guests);
 		reloadedRe.setLastModified(new Date());
 		RepositoryEntry updatedRe = dbInstance.getCurrentEntityManager().merge(reloadedRe);
 		dbInstance.commit();
@@ -694,22 +663,21 @@ public class RepositoryManager {
 	}
 
 	public RepositoryEntry setAccessAndProperties(final RepositoryEntry re,
-			int access, boolean membersOnly,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests,
 			boolean canCopy, boolean canReference, boolean canDownload) {
 		RepositoryEntry reloadedRe = repositoryEntryDao.loadForUpdate(re);
 		if(reloadedRe == null) {
 			return null;
 		}
-		//access
-		reloadedRe.setAccess(access);
-		reloadedRe.setMembersOnly(membersOnly);
+		reloadedRe.setEntryStatus(status);
+		reloadedRe.setAllUsers(allUsers);
+		reloadedRe.setGuests(guests);
 		reloadedRe.setLastModified(new Date());
 		//properties
 		reloadedRe.setCanCopy(canCopy);
 		reloadedRe.setCanReference(canReference);
 		reloadedRe.setCanDownload(canDownload);
 		RepositoryEntry updatedRe = dbInstance.getCurrentEntityManager().merge(reloadedRe);
-
 		//fetch the values
 		updatedRe.getStatistics().getLaunchCounter();
 		if(updatedRe.getLifecycle() != null) {
@@ -913,36 +881,35 @@ public class RepositoryManager {
 	}
 
 	/**
-	 * Count by type, limit by role accessability.
+	 * Count by type, exclude deleted.
 	 * @param restrictedType
 	 * @param roles
 	 * @return Number of repo entries
 	 */
-	public int countByTypeLimitAccess(String restrictedType, int restrictedAccess) {
-		StringBuilder query = new StringBuilder(400);
-		query.append("select count(*) from org.olat.repository.RepositoryEntry v")
+	public int countByType(String restrictedType) {
+		QueryBuilder query = new QueryBuilder(400);
+		query.append("select count(*) from repositoryentry v")
 			 .append(" inner join v.olatResource res")
-		     .append(" where res.resName=:restrictedType and v.access>=:restrictedAccess");
+		     .append(" where res.resName=:restrictedType and v.status ").in(RepositoryEntryStatusEnum.authors());
 		List<Number> count = dbInstance.getCurrentEntityManager()
 				.createQuery(query.toString(), Number.class)
 				.setParameter("restrictedType", restrictedType)
-				.setParameter("restrictedAccess", restrictedAccess)
 				.getResultList();
 		return count == null || count.isEmpty() || count.get(0) == null ? null : count.get(0).intValue();
 	}
 
-	public long countPublished(String restrictedType) {
+	public int countPublished(String restrictedType) {
 		StringBuilder query = new StringBuilder(400);
-		query.append("select count(*) from org.olat.repository.RepositoryEntry v")
+		query.append("select count(*) from repositoryentry v")
 		     .append(" inner join v.olatResource res")
-		     .append(" where res.resName=:restrictedType ")
-		     .append(" and ((v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true) or v.access>=").append(RepositoryEntry.ACC_USERS).append(")");
+		     .append(" where res.resName=:restrictedType")
+		     .append(" and v.status='").append(RepositoryEntryStatusEnum.published).append("'");
 
 		List<Number> count = dbInstance.getCurrentEntityManager()
 				.createQuery(query.toString(), Number.class)
 				.setParameter("restrictedType", restrictedType)
 				.getResultList();
-		return count == null || count.isEmpty() || count.get(0) == null ? null : count.get(0).longValue();
+		return count == null || count.isEmpty() || count.get(0) == null ? null : count.get(0).intValue();
 	}
 
 	/**
@@ -954,7 +921,7 @@ public class RepositoryManager {
 	 */
 	public List<RepositoryEntry> queryByOwner(IdentityRef identity, String... limitTypes) {
 		if (identity == null) throw new AssertException("identity can not be null!");
-		StringBuilder sb = new StringBuilder(400);
+		QueryBuilder sb = new QueryBuilder(400);
 		sb.append("select v from repositoryentry v")
 		  .append(" inner join fetch v.olatResource as res")
 		  .append(" inner join fetch v.statistics as statistics")
@@ -962,7 +929,7 @@ public class RepositoryManager {
 		  .append(" inner join v.groups as relGroup on relGroup.defaultGroup=true")
 		  .append(" inner join relGroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as membership on membership.role='").append(GroupRoles.owner.name()).append("'")
-		  .append(" where v.access>=").append(RepositoryEntry.ACC_OWNERS).append(" and membership.identity.key=:identityKey");
+		  .append(" where membership.identity.key=:identityKey and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed());
 		if (limitTypes != null && limitTypes.length > 0) {
 			sb.append(" and res.resName in (:types)");
 		}
@@ -991,11 +958,11 @@ public class RepositoryManager {
 	 * @param limitTypes
 	 * @return The entries or an empty list if no role is specified
 	 */
-	public List<RepositoryEntry> queryByMembership(IdentityRef identity, boolean owner, boolean coach, boolean participant, String... limitTypes) {
+	public List<RepositoryEntry> queryByMembership(IdentityRef identity, boolean owner, boolean coach, boolean participant, String limitType) {
 		if (identity == null) throw new AssertException("identity can not be null!");
 		if (!owner && !coach && !participant) return Collections.emptyList();
 
-		StringBuilder sb = new StringBuilder(512);
+		QueryBuilder sb = new QueryBuilder(512);
 		sb.append("select v from repositoryentry v ")
 		  .append(" inner join fetch v.olatResource as res ")
 		  .append(" inner join fetch v.statistics as statistics")
@@ -1003,41 +970,29 @@ public class RepositoryManager {
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as membership")
-		  .append(" where membership.identity.key=:identityKey and (");
+		  .append(" where res.resName=:type and membership.identity.key=:identityKey and (");//TODO repo access
 		if(owner) {
-			sb.append(" (v.access >= ").append(RepositoryEntry.ACC_OWNERS).append(" and membership.role='").append(GroupRoles.owner.name()).append("')");
+			sb.append(" (v.status ").in(RepositoryEntryStatusEnum.preparationToClosed()).append(" and membership.role='").append(GroupRoles.owner).append("')");
 		}
-		if(coach || participant) {
+		if(coach) {
 			if(owner) {
 				sb.append(" or");
 			}
-			sb.append(" ((v.access >= ").append(RepositoryEntry.ACC_USERS).append(" or ")
-			  .append("  (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
-			  .append("   and membership.role");
-			if(coach && participant) {
-				sb.append(" in ('").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("')");
-			} else {
-				sb.append(" ='").append(coach ? GroupRoles.coach.name() : GroupRoles.participant.name()).append("'");
+			sb.append(" (v.status ").in(RepositoryEntryStatusEnum.coachPublishedToClosed()).append(" and membership.role='").append(GroupRoles.coach).append("')");
+		}
+		if(participant) {
+			if(owner || coach) {
+				sb.append(" or");
 			}
-			sb.append(")");
+			sb.append(" (v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and membership.role='").append(GroupRoles.participant).append("')");
 		}
 		sb.append(")");
 
-		if (limitTypes != null && limitTypes.length > 0) {
-			sb.append(" and res.resName in (:types)");
-		}
-
-		TypedQuery<RepositoryEntry> query = dbInstance.getCurrentEntityManager()
+		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
-				.setParameter("identityKey", identity.getKey());
-		if(limitTypes != null && limitTypes.length > 0) {
-			List<String> types = new ArrayList<>();
-			for(String type:limitTypes) {
-				types.add(type);
-			}
-			query.setParameter("types", types);
-		}
-		return query.getResultList();
+				.setParameter("identityKey", identity.getKey())
+				.setParameter("type", limitType)
+				.getResultList();
 	}
 
 	/**
@@ -1079,60 +1034,43 @@ public class RepositoryManager {
 
 		// Build the query
 		// 1) Joining tables
-		StringBuilder query = new StringBuilder(400);
-		query.append("select distinct v from repositoryentry v ")
-		     .append(" inner join fetch v.olatResource as res" )
-			 .append(" inner join fetch v.statistics as statistics")
-		     .append(" left join fetch v.lifecycle as lifecycle")
-			 .append(" left join v.groups as relGroup")
-			 .append(" left join relGroup.group as baseGroup")
-			 .append(" left join baseGroup.members as membership");
-		if(roles.isAdministrator()) {//TODO roles repo
-			query.append(" where v.access>=").append(RepositoryEntry.ACC_OWNERS);
-		} else {
-			query.append(" where membership.identity.key=:identityKey and (");
-			// as owner
-			query.append("(v.access>=").append(RepositoryEntry.ACC_OWNERS)
-			     .append(" and membership.role='").append(GroupRoles.owner.name()).append("')");
-			
-			if(roles.isLearnResourceManager()) {
-				// as learn resource manager
-				query.append(" or (v.access>=").append(RepositoryEntry.ACC_OWNERS);
-				if(checkCanReference) {
-					query.append(" and v.canReference=true");
-				}
-				if(checkCanCopy) {
-					query.append(" and v.canCopy=true");
-				}
-				query.append("  and membership.role='").append(OrganisationRoles.learnresourcemanager.name()).append("')");
-			} 
-			
-			if(roles.isAuthor()) {
-				// as author
-				query.append(" or (v.access>=").append(RepositoryEntry.ACC_OWNERS_AUTHORS);
-				if(checkCanReference) {
-					query.append(" and v.canReference=true");
-				}
-				if(checkCanCopy) {
-					query.append(" and v.canCopy=true");
-				}
-				query.append(" and membership.role='").append(OrganisationRoles.author.name()).append("')");
-				
-			}
-			query.append(")");
+		QueryBuilder sb = new QueryBuilder(400);
+		sb.append("select distinct v from repositoryentry v ")
+		  .append(" inner join fetch v.olatResource as res" )
+		  .append(" inner join fetch v.statistics as statistics")
+		  .append(" left join fetch v.lifecycle as lifecycle")
+		  .append(" left join v.groups as relGroup")
+		  .append(" left join relGroup.group as baseGroup")//TODO roles repo
+		  .append(" left join baseGroup.members as membership")
+		  .append(" where membership.identity.key=:identityKey")
+		  .append(" and (");
+		//owner, learn resource manager, administrator
+		sb.append("(membership.role ").in(GroupRoles.owner, OrganisationRoles.administrator, OrganisationRoles.learnresourcemanager)
+		  .append("  and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed()).append(")");
+		//author
+		if(roles.isAuthor()) {
+			sb.append(" or (membership.role ").in(OrganisationRoles.author)
+			  .append(" and v.status ").in(RepositoryEntryStatusEnum.reviewToClosed()).append(")")
+			  .append(" and (v.canReference=true or v.canCopy=true)");
 		}
-
+		sb.append(")");
+		if(checkCanReference) {
+			sb.append(" and v.canReference=true");
+		}
+		if(checkCanCopy) {
+			sb.append(" and v.canCopy=true");
+		}	 
 		// restrict on type
 		if (resourceTypes != null) {
-			query.append(" and res.resName in (:resourcetypes)");
+			sb.append(" and res.resName in (:resourcetypes)");
 		}
 		// restrict on author
 		if (author != null) { // fuzzy author search
 			author = author.replace('*','%');
 			author = '%' + author + '%';
-			query.append(" and exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership, ")
-			     .append(IdentityImpl.class.getName()).append(" as identity, ").append(UserImpl.class.getName()).append(" as user")
-		         .append("    where rel.entry=v and rel.group=baseGroup and membership.group=baseGroup and membership.identity=identity and user.identity.key=identity.key")
+			sb.append(" and exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership, ")
+			  .append(IdentityImpl.class.getName()).append(" as identity, ").append(UserImpl.class.getName()).append(" as user")
+		      .append("    where rel.entry=v and rel.group=baseGroup and membership.group=baseGroup and membership.identity=identity and user.identity.key=identity.key")
 		         .append("      and membership.role='").append(GroupRoles.owner.name()).append("'")
 		         .append("      and (user.firstName like :author or user.lastName like :author or identity.name like :author)")
 		         .append("  )");
@@ -1141,34 +1079,28 @@ public class RepositoryManager {
 		if (displayName != null) {
 			displayName = displayName.replace('*','%');
 			displayName = '%' + displayName + '%';
-			query.append(" and v.displayname like :displayname");
+			sb.append(" and v.displayname like :displayname");
 		}
 		// restrict on resource description
 		if (desc != null) {
 			desc = desc.replace('*','%');
 			desc = '%' + desc + '%';
-			query.append(" and v.description like :desc");
+			sb.append(" and v.description like :desc");
 		}
 
 		// create query an set query data
 		TypedQuery<RepositoryEntry> dbquery = dbInstance.getCurrentEntityManager()
-				.createQuery(query.toString(), RepositoryEntry.class);
-		if(!roles.isAdministrator()) {//TODO roles repo
-			dbquery.setParameter("identityKey", identity.getKey());
-		}
-		
+				.createQuery(sb.toString(), RepositoryEntry.class)
+				.setParameter("identityKey", identity.getKey());
 		if (author != null) {
 			dbquery.setParameter("author", author);
 		}
-		
 		if (displayName != null) {
 			dbquery.setParameter("displayname", displayName);
 		}
-		
 		if (desc != null) {
 			dbquery.setParameter("desc", desc);
 		}
-		
 		if (resourceTypes != null) {
 			dbquery.setParameter("resourcetypes", resourceTypes);
 		}
@@ -1183,18 +1115,16 @@ public class RepositoryManager {
 	 * @param limitAccess
 	 * @return Results
 	 */
-	public List<RepositoryEntry> queryByOwnerLimitAccess(Identity identity) {
-		StringBuilder sb = new StringBuilder();
+	public List<RepositoryEntry> queryByOwnerLimitAccess(IdentityRef identity) {
+		QueryBuilder sb = new QueryBuilder();
 		sb.append("select v from repositoryentry v")
 		  .append(" inner join fetch v.olatResource as res")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" left join fetch v.lifecycle as lifecycle")
 		  .append(" inner join v.groups as relGroup on relGroup.defaultGroup=true")
-		  .append(" inner join relGroup.group as baseGroup")
+		  .append(" inner join relGroup.group as baseGroup")//TODO repo access
 		  .append(" inner join baseGroup.members as membership on membership.role='").append(GroupRoles.owner.name()).append("'")
-		  .append(" where membership.identity.key=:identityKey and (v.access>=").append(RepositoryEntry.ACC_USERS)
-		  .append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true)")
-		  .append(")");
+		  .append(" where membership.identity.key=:identityKey and v.status ").in(RepositoryEntryStatusEnum.authors());
 		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
 				.setParameter("identityKey", identity.getKey())
@@ -1580,17 +1510,19 @@ public class RepositoryManager {
 		return allOk;
 	}
 
-	public int countLearningResourcesAsStudent(IdentityRef identity) {
-		StringBuilder sb = new StringBuilder(1200);
-		sb.append("select count(v) from ").append(RepositoryEntry.class.getName()).append(" as v ")
+	public int countLearningResourcesAsStudent(IdentityRef identity, String type) {
+		QueryBuilder sb = new QueryBuilder(1200);
+		sb.append("select count(distinct v) from repositoryentry as v")
+		  .append(" inner join v.olatResource as res")
 		  .append(" inner join v.groups as relGroup")
-		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as membership on membership.role='").append(GroupRoles.participant.name()).append("'")
-		  .append(" where (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
-		  .append(" and membership.identity.key=:identityKey");
+		  .append(" inner join relGroup.group as baseGroup")//TODO repo access
+		  .append(" inner join baseGroup.members as membership")
+		  .append(" where membership.identity.key=:identityKey and membership.role='").append(GroupRoles.participant).append("'")
+		  .append(" and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and res.resName=:resourceType");
 		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), Number.class)
 				.setParameter("identityKey", identity.getKey())
+				.setParameter("resourceType", type)
 				.getSingleResult().intValue();
 	}
 
@@ -1599,21 +1531,21 @@ public class RepositoryManager {
 	 * @param identity
 	 * @return list of RepositoryEntries
 	 */
-	public List<RepositoryEntry> getLearningResourcesAsStudent(Identity identity, String type, int firstResult, int maxResults, RepositoryEntryOrder... orderby) {
-		StringBuilder sb = new StringBuilder(1200);
-		sb.append("select v from ").append(RepositoryEntry.class.getName()).append(" as v ")
+	public List<RepositoryEntry> getLearningResourcesAsStudent(Identity identity, String type, int firstResult, int maxResults,
+			RepositoryEntryOrder... orderby) {
+		QueryBuilder sb = new QueryBuilder(1200);
+		sb.append("select distinct v from repositoryentry as v ")
 		  .append(" inner join fetch v.olatResource as res ")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" left join fetch v.lifecycle as lifecycle")
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as membership")
-		  .append(" where (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
-		  .append(" and membership.identity.key=:identityKey and membership.role='").append(GroupRoles.participant.name()).append("'");
+		  .append(" inner join baseGroup.members as membership")//TODO repo queries
+		  .append(" where membership.identity.key=:identityKey and membership.role ").in(GroupRoles.participant)
+		  .append(" and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());
 		if(StringHelper.containsNonWhitespace(type)) {
 			sb.append(" and res.resName=:resourceType");
 		}
-
 		appendOrderBy(sb, "v", orderby);
 
 		TypedQuery<RepositoryEntry> query = dbInstance.getCurrentEntityManager()
@@ -1626,94 +1558,83 @@ public class RepositoryManager {
 		if(StringHelper.containsNonWhitespace(type)) {
 			query.setParameter("resourceType", type);
 		}
-		List<RepositoryEntry> repoEntries = query.getResultList();
-		return repoEntries;
+		return query.getResultList();
 	}
 
 	/**
 	 * Gets all learning resources where the user is in a learning group as participant.
-	 * @param identity
+	 * 
+	 * @param identity The identity (mandatory)
+	 * @param type The resource type (mandatory)
 	 * @return list of RepositoryEntries
 	 */
 	public List<RepositoryEntry> getLearningResourcesAsParticipantAndCoach(Identity identity, String type) {
-		StringBuilder sb = new StringBuilder(1200);
-		sb.append("select v from ").append(RepositoryEntry.class.getName()).append(" as v ")
-		  .append(" inner join fetch v.olatResource as res ")
+		QueryBuilder sb = new QueryBuilder(1200);
+		sb.append("select distinct v from repositoryentry as v")
+		  .append(" inner join fetch v.olatResource as res")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" left join fetch v.lifecycle as lifecycle")
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as membership")
-		  .append(" where (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
-		  .append(" and membership.identity.key=:identityKey and membership.role in('").append(GroupRoles.participant.name()).append("','").append(GroupRoles.coach.name()).append("')");
-		if(StringHelper.containsNonWhitespace(type)) {
-			sb.append(" and res.resName=:resourceType");
-		}
-
-		TypedQuery<RepositoryEntry> query = dbInstance.getCurrentEntityManager()
+		  .append(" inner join baseGroup.members as membership")//TODO repo access
+		  .append(" where membership.identity.key=:identityKey and (")
+		  .append("   (membership.role='").append(GroupRoles.participant.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
+		  .append("   or")
+		  .append("   (membership.role='").append(GroupRoles.coach.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.coachPublishedToClosed()).append(")")
+		  .append(" ) and res.resName=:resourceType");
+		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
-				.setParameter("identityKey", identity.getKey());
-
-		if(StringHelper.containsNonWhitespace(type)) {
-			query.setParameter("resourceType", type);
-		}
-		return query.getResultList();
+				.setParameter("identityKey", identity.getKey())
+				.setParameter("resourceType", type)
+				.getResultList();
 	}
 
-	public List<RepositoryEntry> getLearningResourcesAsBookmark(Identity identity, Roles roles, String type, int firstResult, int maxResults, RepositoryEntryOrder... orderby) {
+	public List<RepositoryEntry> getLearningResourcesAsBookmark(Identity identity, Roles roles, String type, int firstResult, int maxResults) {
 		if(roles.isGuestOnly()) {
 			return Collections.emptyList();
 		}
 
-		StringBuilder sb = new StringBuilder(1200);
-		sb.append("select v from ").append(RepositoryEntry.class.getName()).append(" as v ")
+		QueryBuilder sb = new QueryBuilder(1200);
+		sb.append("select v from repositoryentry as v")
 		  .append(" inner join fetch v.olatResource as res ")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" left join fetch v.lifecycle as lifecycle")
 		  .append(" where exists (select mark.key from ").append(MarkImpl.class.getName()).append(" as mark ")
 		  .append("   where mark.creator.key=:identityKey and mark.resId=v.key and mark.resName='RepositoryEntry'")
-		  .append(" ) ");
-		if(StringHelper.containsNonWhitespace(type)) {
-			sb.append(" and res.resName=:resourceType");
-		}
-		sb.append(" and (v.access >= ");
-		if (roles.isAuthor()) {
-			sb.append(RepositoryEntry.ACC_OWNERS_AUTHORS);
-		} else {
-			sb.append(RepositoryEntry.ACC_USERS);
-		}
-		sb.append(" or (")
-		  .append("  v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true")
-		  .append("  and exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership")
+		  .append(" ) ")
+		  .append(" and res.resName=:resourceType")
+		  .append(" and (")
+		  .append("  (v.allUsers=true and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
+		  .append("  or exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership")
 		  .append("    where rel.entry=v and rel.group=baseGroup and membership.group=baseGroup and membership.identity.key=:identityKey")
-		  .append("      and membership.role in ('").append(GroupRoles.owner.name()).append("','").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("')")
-		  .append("  )")
-		  .append(" )")
-		  .append(")");
-
-		appendOrderBy(sb, "v", orderby);
+		  .append("    and (")
+		  .append("     (membership.role ").in(OrganisationRoles.administrator, OrganisationRoles.learnresourcemanager, GroupRoles.owner).append(" and v.status").in(RepositoryEntryStatusEnum.preparationToClosed()).append(")")
+		  .append("     or")
+		  .append("     (membership.role ").in(GroupRoles.coach).append(" and v.status").in(RepositoryEntryStatusEnum.coachPublishedToClosed()).append(")")
+		  .append("     or")
+		  .append("     (membership.role ").in(GroupRoles.participant).append(" and v.status").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
+		  .append("    )")
+		  .append(" ))");
 
 		TypedQuery<RepositoryEntry> query = dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
 				.setParameter("identityKey", identity.getKey())
+				.setParameter("resourceType", type)
 				.setFirstResult(firstResult);
 		if(maxResults > 0) {
 			query.setMaxResults(maxResults);
 		}
-		if(StringHelper.containsNonWhitespace(type)) {
-			query.setParameter("resourceType", type);
-		}
 		return query.getResultList();
 	}
 
 	public List<RepositoryEntryLight> getParticipantRepositoryEntry(IdentityRef identity, int maxResults, RepositoryEntryOrder... orderby) {
-		StringBuilder sb = new StringBuilder(512);
+		QueryBuilder sb = new QueryBuilder(512);
 		sb.append("select v from repoentrylight as v ")
 		  .append(" inner join fetch v.olatResource as res ")
-		  .append(" where exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership")
+		  .append(" where (exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership")
 		  .append("    where rel.entry=v and rel.group=baseGroup and membership.group=baseGroup and membership.identity.key=:identityKey")
 		  .append("      and membership.role='").append(GroupRoles.participant.name()).append("')")
-		  .append(" and (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))");
+		  .append(" or v.allUsers=true) and v.status").in(RepositoryEntryStatusEnum.publishedAndClosed());
 		appendOrderBy(sb, "v", orderby);
 
 		TypedQuery<RepositoryEntryLight> query = dbInstance.getCurrentEntityManager()
@@ -1725,33 +1646,13 @@ public class RepositoryManager {
 		return query.getResultList();
 	}
 
-	public List<RepositoryEntryLight> getTutorRepositoryEntry(IdentityRef identity, int maxResults, RepositoryEntryOrder... orderby) {
-		StringBuilder sb = new StringBuilder(512);
-		sb.append("select v from repoentrylight as v ")
-		  .append(" inner join fetch v.olatResource as res ")
-		  .append(" where exists (select rel from repoentrytogroup as rel, bgroup as baseGroup, bgroupmember as membership")
-		  .append("    where rel.entry=v and rel.group=baseGroup and membership.group=baseGroup and membership.identity.key=:identityKey")
-		  .append("      and membership.role='").append(GroupRoles.coach.name()).append("')")
-		  .append("  and (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))");
-		appendOrderBy(sb, "v", orderby);
-
-		TypedQuery<RepositoryEntryLight> query = dbInstance.getCurrentEntityManager()
-				.createQuery(sb.toString(), RepositoryEntryLight.class)
-				.setParameter("identityKey", identity.getKey());
-		if(maxResults > 0) {
-			query.setMaxResults(maxResults);
-		}
-
-		return query.getResultList();
-	}
-
 	public int countLearningResourcesAsOwner(IdentityRef identity) {
-		StringBuilder sb = new StringBuilder(200);
-		sb.append("select count(v) from ").append(RepositoryEntry.class.getName()).append(" v ")
-		  .append(" inner join v.groups as relGroup on relGroup.defaultGroup=true")
+		QueryBuilder sb = new QueryBuilder(512);
+		sb.append("select count(v) from repositoryentry v")
+		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as membership")
-		  .append(" where v.access>=").append(RepositoryEntry.ACC_OWNERS).append(" and membership.identity.key=:identityKey and membership.role='").append(GroupRoles.owner.name()).append("'");
+		  .append(" where v.status ").in(RepositoryEntryStatusEnum.preparationToClosed()).append(" and membership.identity.key=:identityKey and membership.role='").append(GroupRoles.owner.name()).append("'");
 
 		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), Number.class)
@@ -1772,9 +1673,9 @@ public class RepositoryManager {
 	}
 
 	public int countLearningResourcesAsTeacher(IdentityRef identity) {
-		StringBuilder sb = new StringBuilder(1200);
-		sb.append("select count(v) from ").append(RepositoryEntry.class.getName()).append(" v ")
-		  .append(" inner join v.olatResource as res ");
+		QueryBuilder sb = new QueryBuilder(1200);
+		sb.append("select count(v) from repositoryentry v")
+		  .append(" inner join v.olatResource as res");
 		whereClauseLearningResourcesAsTeacher(sb);
 
 		return dbInstance.getCurrentEntityManager()
@@ -1784,7 +1685,7 @@ public class RepositoryManager {
 	}
 
 	public List<RepositoryEntry> getLearningResourcesAsTeacher(Identity identity, int firstResult, int maxResults, RepositoryEntryOrder... orderby) {
-		StringBuilder sb = new StringBuilder(1200);
+		QueryBuilder sb = new QueryBuilder(1200);
 		sb.append("select distinct v from ").append(RepositoryEntry.class.getName()).append(" v ")
 		  .append(" inner join fetch v.olatResource as res ")
 		  .append(" inner join fetch v.statistics as statistics")
@@ -1806,17 +1707,17 @@ public class RepositoryManager {
 	 * Write the where clause for countLearningResourcesAsTeacher and getLearningResourcesAsTeacher
 	 * @param sb
 	 */
-	private final void whereClauseLearningResourcesAsTeacher(StringBuilder sb) {
+	private final void whereClauseLearningResourcesAsTeacher(QueryBuilder sb) {
 		sb.append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as membership on membership.role ='").append(GroupRoles.coach.name()).append("'")
-		  .append(" where (v.access>=").append(RepositoryEntry.ACC_USERS).append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
-		  .append(" and membership.identity.key=:identityKey");
+		  .append(" inner join baseGroup.members as membership")
+		  .append(" where membership.role ='").append(GroupRoles.coach.name()).append("' and membership.identity.key=:identityKey")
+		  .append(" and v.status ").in(RepositoryEntryStatusEnum.coachpublished, RepositoryEntryStatusEnum.published, RepositoryEntryStatusEnum.closed);
 	}
 
 	public int countFavoritLearningResourcesAsTeacher(Identity identity, List<String> types) {
-		StringBuilder sb = new StringBuilder();
-		sb.append("select count(v) from ").append(RepositoryEntry.class.getName()).append(" v ")
+		QueryBuilder sb = new QueryBuilder();
+		sb.append("select count(v) from repositoryentry v")
 		  .append(" inner join v.olatResource as res ")
 		  .append(" inner join v.groups as relGroup")
 		  .append(" inner join relGroup.group as baseGroup")
@@ -1839,8 +1740,8 @@ public class RepositoryManager {
 
 	public List<RepositoryEntry> getFavoritLearningResourcesAsTeacher(IdentityRef identity, List<String> types, int firstResult, int maxResults,
 			RepositoryEntryOrder... orderby) {
-		StringBuilder sb = new StringBuilder();
-		sb.append("select distinct v from ").append(RepositoryEntry.class.getName()).append(" v ")
+		QueryBuilder sb = new QueryBuilder();
+		sb.append("select distinct v from repositoryentry v")
 		  .append(" inner join fetch v.olatResource as res ")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" left join fetch v.lifecycle as lifecycle")
@@ -1876,34 +1777,22 @@ public class RepositoryManager {
 	 * @param identity
 	 * @return
 	 */
-	public List<RepositoryEntryMembership> getRepositoryEntryMembership(RepositoryEntryRef re, Identity... identity) {
-		if(re == null && (identity == null || identity.length == 0)) return Collections.emptyList();
+	public List<RepositoryEntryMembership> getRepositoryEntryMembership(RepositoryEntryRef re, IdentityRef identity) {
+		if(re == null || identity == null) return Collections.emptyList();
 
-		StringBuilder sb = new StringBuilder(400);
-		sb.append("select distinct membership from repoentrymembership as membership ");
-		boolean and = false;
+		QueryBuilder sb = new QueryBuilder(400);
+		sb.append("select distinct membership from repoentrymembership as membership")
+		  .append(" where membership.identityKey=:identityKey");
 		if(re != null) {
-			and = and(sb, and);
-			sb.append("membership.repoKey=:repoKey");
-		}
-		if(identity != null && identity.length > 0) {
-			and = and(sb, and);
-			sb.append("membership.identityKey=:identityKeys");
+			sb.append(" and membership.repoKey=:repoKey");
 		}
 
 		TypedQuery<RepositoryEntryMembership> query = dbInstance.getCurrentEntityManager()
-				.createQuery(sb.toString(), RepositoryEntryMembership.class);
+				.createQuery(sb.toString(), RepositoryEntryMembership.class)
+				.setParameter("identityKey", identity.getKey());
 		if(re != null) {
 			query.setParameter("repoKey", re.getKey());
 		}
-		if(identity != null && identity.length > 0) {
-			List<Long> ids = new ArrayList<>(identity.length);
-			for(Identity id:identity) {
-				ids.add(id.getKey());
-			}
-			query.setParameter("identityKeys", ids);
-		}
-
 		return query.getResultList();
 	}
 
@@ -1999,13 +1888,7 @@ public class RepositoryManager {
 		}
 	}
 
-	private final boolean and(StringBuilder sb, boolean and) {
-		if(and) sb.append(" and ");
-		else sb.append(" where ");
-		return true;
-	}
-
-	private void appendOrderBy(StringBuilder sb, String var, RepositoryEntryOrder... orderby) {
+	private void appendOrderBy(QueryBuilder sb, String var, RepositoryEntryOrder... orderby) {
 		if(orderby != null && orderby.length > 0) {
 			sb.append(" order by ");
 			for(RepositoryEntryOrder o:orderby) {
diff --git a/src/main/java/org/olat/repository/RepositoryService.java b/src/main/java/org/olat/repository/RepositoryService.java
index d1f580b8d7b..24fd83c8b04 100644
--- a/src/main/java/org/olat/repository/RepositoryService.java
+++ b/src/main/java/org/olat/repository/RepositoryService.java
@@ -58,7 +58,7 @@ public interface RepositoryService {
 
 	public RepositoryEntry create(Identity initialAuthor, String initialAuthorAlt,
 			String resourceName, String displayname, String description,
-			OLATResource resource, int access, Organisation organisation);
+			OLATResource resource, RepositoryEntryStatusEnum status, Organisation organisation);
 
 	public RepositoryEntry copy(RepositoryEntry sourceEntry, Identity author, String displayname);
 
diff --git a/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties
index a56a3d297d0..6c5ce072aa8 100644
--- a/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties
@@ -120,7 +120,6 @@ cif.error.resourcename.empty=Bitte f\u00FCllen Sie das Feld "Referenz" aus.
 cif.expenditureOfWork=Zeitaufwand
 cif.externalid=Extern ID
 cif.externalref=Kennzeichen
-ds=dy
 cif.externalref.hover=Eine externe Kennung f\u00FCr diese Ressource die in der Kurs\u00FCbersicht angezeigt wird.
 cif.freetext=Lizenztext
 cif.groups=Gruppen
@@ -148,6 +147,7 @@ cif.owned.resources.usage.notUsed=Nicht referenziert
 cif.owners=Autoren
 cif.private.dates=Datum
 cif.public.dates=Semester
+cif.publish=Publikation
 cif.requirements=Voraussetzungen
 cif.resources.status=Lebenszyklus
 cif.resources.status.all=Alle
@@ -155,9 +155,20 @@ cif.resources.status.active=$\:status.opened
 cif.resources.status.closed=$\:status.closed
 cif.resourcename=Dateiname
 cif.softkey=OpenOLAT-Soft-ID
+cif.status.closed=$\:status.closed
+cif.status.coachpublished=Ver\u00F6ffentlicht Betreuer
+cif.status.deleted=Gel\u00F6scht
+cif.status.preparation=Vorbereitung
+cif.status.published=Ver\u00F6ffentlicht
+cif.status.review=Review
+cif.status.trash=Papierkorb
+cif.allusers=Alle Benutzer
+cif.guests=G\u00E4ste
+cif.author.can=Authoren k\u00F6nnen
 cif.type=Typ
 cif.type.na=keine Angabe
 cif.usedbycnt=Momentane Benutzer
+cif.release=freigeben
 close.ressource.step1=Informationen zur Funktion "Beenden"
 close.ressource.step2=Optionale Einstellungen
 close.ressource.step3=E-Mail an Mitglieder versenden
@@ -578,6 +589,15 @@ table.search.author.desc=Suchen Sie entweder mit einem Schlagwort nach einer Ler
 table.search.mycourses.desc=Suchen Sie mit einem Schlagwort nach einem Kurs, oder in der erweiterten Suche nach Kurstitel, Autor oder ID.
 table.select=<i class\='o_icon o_icon-lg o_icon_select'> </i>
 table.sort=Sortierung
+table.status.preparation=$\:cif.status.preparation
+table.status.review=$\:cif.status.review
+table.status.coachpublished=$\:cif.status.coachpublished
+table.status.published=$\:cif.status.published
+table.status.closed=$\:status.closed
+table.status.trash=$\:cif.status.trash
+table.status.deleted=$\:cif.status.deleted
+table.allusers=$\:cif.allusers
+table.guests=$\:cif.guests
 table.subject.addeddate=Wann hinzugef\u00FCgt 
 table.subject.birthDay=Geburtsdatum
 table.subject.city=Stadt
diff --git a/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties
index 935940158f7..8de1a25d272 100644
--- a/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties
@@ -143,16 +143,28 @@ cif.owned.resources.usage.used=Referenced
 cif.owners=Authoring rights
 cif.private.dates=Dates
 cif.public.dates=Semester
+cif.publish=Publication
 cif.requirements=Requirements
 cif.resourcename=File name
 cif.resources.status=Life cycle
 cif.resources.status.active=$\:status.opened
 cif.resources.status.all=All
 cif.resources.status.closed=$\:status.closed
+cif.status.closed=$\:status.closed
+cif.status.coachpublished=Published coach
+cif.status.deleted=Deleted
+cif.status.preparation=Preparation
+cif.status.published=Published
+cif.status.review=Review
+cif.status.trash=Trash
+cif.allusers=All users
+cif.guests=Guests
 cif.softkey=OpenOLAT soft ID
 cif.type=Type
 cif.type.na=n/a
 cif.usedbycnt=Current users
+cif.release=release
+cif.author.can=Authors can
 close.ressource.step1=Information on the functionality "Finish"
 close.ressource.step2=Optional settings
 close.ressource.step3=Send E-mail to members
@@ -575,6 +587,15 @@ table.search.author.desc=You can either use the simple search with a keyword to
 table.search.mycourses.desc=You can either use the simple search with a keyword to search for a course, or use the advanced search to find courses by title, author or ID.
 table.select=<i class\='o_icon o_icon-lg o_icon_select'> </i>
 table.sort=Sort
+table.status.preparation=$\:cif.status.preparation
+table.status.review=$\:cif.status.review
+table.status.coachpublished=$\:cif.status.coachpublished
+table.status.published=$\:cif.status.published
+table.status.closed=$\:status.closed
+table.status.trash=$\:cif.status.trash
+table.status.deleted=$\:cif.status.deleted
+table.allusers=$\:cif.allusers
+table.guests=$\:cif.guests
 table.subject.addeddate=Added when? 
 table.subject.birthDay=Date of birth
 table.subject.city=City
diff --git a/src/main/java/org/olat/repository/controllers/RepositorySearchController.java b/src/main/java/org/olat/repository/controllers/RepositorySearchController.java
index 422714d8ffe..519d0696e3b 100644
--- a/src/main/java/org/olat/repository/controllers/RepositorySearchController.java
+++ b/src/main/java/org/olat/repository/controllers/RepositorySearchController.java
@@ -406,7 +406,7 @@ public class RepositorySearchController extends BasicController implements Activ
 		
 	private void doSearchMyCoursesStudent(UserRequest ureq, String limitType, boolean updateFilters) {
 		searchType = SearchType.myAsStudent;
-		List<RepositoryEntry> entries = repositoryManager.getLearningResourcesAsStudent(ureq.getIdentity(), null, 0, -1);
+		List<RepositoryEntry> entries = repositoryManager.getLearningResourcesAsStudent(getIdentity(), limitType, 0, -1);
 		filterRepositoryEntries(entries);
 		doSearchMyRepositoryEntries(ureq, entries, limitType, updateFilters);
 	}
diff --git a/src/main/java/org/olat/repository/handlers/BlogHandler.java b/src/main/java/org/olat/repository/handlers/BlogHandler.java
index 1cc5ac27045..4535a30c3ac 100644
--- a/src/main/java/org/olat/repository/handlers/BlogHandler.java
+++ b/src/main/java/org/olat/repository/handlers/BlogHandler.java
@@ -58,6 +58,7 @@ import org.olat.modules.webFeed.ui.FeedRuntimeController;
 import org.olat.modules.webFeed.ui.blog.BlogUIFactory;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -91,7 +92,7 @@ public class BlogHandler implements RepositoryHandler {
 		OLATResourceable ores = FeedManager.getInstance().createBlogResource();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
 		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -116,7 +117,7 @@ public class BlogHandler implements RepositoryHandler {
 		FileResource.copyResource(file, filename, blogRoot);
 		FeedManager.getInstance().importFeedFromXML(resource, true);
 		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/repository/handlers/CourseHandler.java b/src/main/java/org/olat/repository/handlers/CourseHandler.java
index bbb6ca97044..0a2073275e9 100644
--- a/src/main/java/org/olat/repository/handlers/CourseHandler.java
+++ b/src/main/java/org/olat/repository/handlers/CourseHandler.java
@@ -106,6 +106,7 @@ import org.olat.modules.sharedfolder.SharedFolderManager;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryImportExport;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryEntryImportExport.RepositoryEntryImport;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
@@ -145,8 +146,8 @@ public class CourseHandler implements RepositoryHandler {
 			Object createObject, Organisation organisation, Locale locale) {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		OLATResource resource = OLATResourceManager.getInstance().createOLATResourceInstance(CourseModule.class);
-		RepositoryEntry re = repositoryService
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource,
+						RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 
 		String shortDisplayname = Formatter.truncateOnly(displayname, 25);
@@ -230,8 +231,8 @@ public class CourseHandler implements RepositoryHandler {
 		}
 
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
-		RepositoryEntry re = repositoryService
-				.create(initialAuthor, null, "", displayname, description, newCourseResource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, newCourseResource,
+				RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 
 		// create empty run structure
@@ -340,7 +341,8 @@ public class CourseHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(resource);
 		RepositoryEntry importedRepositoryEntry = repositoryService.create(owner, null,
-				importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores, RepositoryEntry.ACC_OWNERS, organisation);
+				importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores,
+				RepositoryEntryStatusEnum.preparation, organisation);
 
 		// set the new shared folder reference
 		CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
@@ -374,7 +376,8 @@ public class CourseHandler implements RepositoryHandler {
 		OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(resource);
 		
 		RepositoryEntry importedRepositoryEntry = repositoryService.create(owner,
-				null, importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores, RepositoryEntry.ACC_OWNERS, organisation);
+				null, importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores,
+				RepositoryEntryStatusEnum.preparation, organisation);
 
 			// set the new glossary reference
 		CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
diff --git a/src/main/java/org/olat/repository/handlers/GlossaryHandler.java b/src/main/java/org/olat/repository/handlers/GlossaryHandler.java
index ce03178557f..445a03f3bb1 100644
--- a/src/main/java/org/olat/repository/handlers/GlossaryHandler.java
+++ b/src/main/java/org/olat/repository/handlers/GlossaryHandler.java
@@ -65,6 +65,7 @@ import org.olat.fileresource.types.ResourceEvaluation;
 import org.olat.modules.glossary.GlossaryManager;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -98,7 +99,8 @@ public class GlossaryHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		GlossaryResource glossaryResource = GlossaryManager.getInstance().createGlossary();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(glossaryResource);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource,
+				RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -127,7 +129,8 @@ public class GlossaryHandler implements RepositoryHandler {
 		//copy resources
 		File glossyPath = GlossaryManager.getInstance().getGlossaryRootFolder(glossaryResource).getBasefile();
 		FileResource.copyResource(file, filename, glossyPath);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource,
+				RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/repository/handlers/ImsCPHandler.java b/src/main/java/org/olat/repository/handlers/ImsCPHandler.java
index 272c02b3c5d..d8af69f2a6e 100644
--- a/src/main/java/org/olat/repository/handlers/ImsCPHandler.java
+++ b/src/main/java/org/olat/repository/handlers/ImsCPHandler.java
@@ -70,6 +70,7 @@ import org.olat.ims.cp.ui.CPRuntimeController;
 import org.olat.modules.cp.CPDisplayController;
 import org.olat.modules.cp.CPOfflineReadableManager;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -97,8 +98,8 @@ public class ImsCPHandler extends FileHandler {
 	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
 			Object createObject, Organisation organisation, Locale locale) {
 		OLATResource resource = OLATResourceManager.getInstance().createOLATResourceInstance("FileResource.IMSCP");
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 
 		Translator translator = Util.createPackageTranslator(CPContentController.class, locale);
@@ -128,8 +129,8 @@ public class ImsCPHandler extends FileHandler {
 
 		ImsCPFileResource cpResource = new ImsCPFileResource();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(cpResource);
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(resource).getBasefile();
 		File zipRoot = new File(fResourceFileroot, FileResourceManager.ZIPDIR);
diff --git a/src/main/java/org/olat/repository/handlers/PodcastHandler.java b/src/main/java/org/olat/repository/handlers/PodcastHandler.java
index 70f7b2e6038..6d11e7ba392 100644
--- a/src/main/java/org/olat/repository/handlers/PodcastHandler.java
+++ b/src/main/java/org/olat/repository/handlers/PodcastHandler.java
@@ -58,6 +58,7 @@ import org.olat.modules.webFeed.ui.FeedRuntimeController;
 import org.olat.modules.webFeed.ui.podcast.PodcastUIFactory;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -91,7 +92,8 @@ public class PodcastHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		OLATResourceable ores = FeedManager.getInstance().createPodcastResource();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -115,8 +117,8 @@ public class PodcastHandler implements RepositoryHandler {
 		File blogRoot = new File(fResourceFileroot, FeedManager.getInstance().getFeedKind(resource));
 		FileResource.copyResource(file, filename, blogRoot);
 		FeedManager.getInstance().importFeedFromXML(resource, true);
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/repository/handlers/PortfolioHandler.java b/src/main/java/org/olat/repository/handlers/PortfolioHandler.java
index 4b3a7bcb646..353ce808dc2 100644
--- a/src/main/java/org/olat/repository/handlers/PortfolioHandler.java
+++ b/src/main/java/org/olat/repository/handlers/PortfolioHandler.java
@@ -64,6 +64,7 @@ import org.olat.portfolio.ui.structel.EPCreateMapController;
 import org.olat.portfolio.ui.structel.EPMapViewController;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -102,7 +103,8 @@ public class PortfolioHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		
 		OLATResource resource = eSTMgr.createPortfolioMapTemplateResource();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 
 		PortfolioStructureMap mapTemp = eSTMgr.createAndPersistPortfolioMapTemplateFromEntry(initialAuthor, re);
 		// add a page, as each map should have at least one per default!
@@ -136,8 +138,8 @@ public class PortfolioHandler implements RepositoryHandler {
 		PortfolioStructure structure = EPXStreamHandler.getAsObject(file, false);
 		if(structure != null) {
 			OLATResource resource = eSTMgr.createPortfolioMapTemplateResource();
-			re = CoreSpringFactory.getImpl(RepositoryService.class)
-					.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+			re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description,
+					resource, RepositoryEntryStatusEnum.preparation, organisation);
 			ePFMgr.importPortfolioMapTemplate(structure, resource);
 		}
 		return re;
diff --git a/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java b/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java
index bce58c051ee..b8a1c407622 100644
--- a/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java
+++ b/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java
@@ -56,6 +56,7 @@ import org.olat.modules.scorm.ScormMainManager;
 import org.olat.modules.scorm.ScormPackageConfig;
 import org.olat.modules.scorm.ScormRuntimeController;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -105,8 +106,8 @@ public class SCORMCPHandler extends FileHandler {
 		
 		ScormCPFileResource scormResource = new ScormCPFileResource();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(scormResource);
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class) .create(initialAuthor, null, "", displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(resource).getBasefile();
 		File zipRoot = new File(fResourceFileroot, FileResourceManager.ZIPDIR);
diff --git a/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java b/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java
index 0e7096fd2b7..58f063d00c4 100644
--- a/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java
+++ b/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java
@@ -60,6 +60,7 @@ import org.olat.modules.sharedfolder.SharedFolderEditorController;
 import org.olat.modules.sharedfolder.SharedFolderManager;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -94,8 +95,8 @@ public class SharedFolderHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		SharedFolderFileResource folderResource = SharedFolderManager.getInstance().createSharedFolder();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(folderResource);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null,
-				SharedFolderFileResource.RESOURCE_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, SharedFolderFileResource.RESOURCE_NAME, displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/repository/handlers/VideoHandler.java b/src/main/java/org/olat/repository/handlers/VideoHandler.java
index 35cfc863bd8..07fe13d958f 100644
--- a/src/main/java/org/olat/repository/handlers/VideoHandler.java
+++ b/src/main/java/org/olat/repository/handlers/VideoHandler.java
@@ -55,6 +55,7 @@ import org.olat.modules.video.VideoManager;
 import org.olat.modules.video.ui.VideoDisplayController;
 import org.olat.modules.video.ui.VideoRuntimeController;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -116,7 +117,7 @@ public class VideoHandler extends FileHandler {
 		FileResource ores = new VideoFileResource();
 		OLATResource resource = OLATResourceManager.getInstance().createAndPersistOLATResourceInstance(ores);
 		RepositoryEntry repoEntry = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "",
-				displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+				displayname, description, resource, RepositoryEntryStatusEnum.preparation, organisation);
 		
 		if(fileName == null) {
 			fileName = file.getName();
diff --git a/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java b/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java
index 300de8b2157..829800158c3 100644
--- a/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java
+++ b/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java
@@ -63,6 +63,7 @@ import org.olat.fileresource.types.ResourceEvaluation;
 import org.olat.fileresource.types.SoundFileResource;
 import org.olat.fileresource.types.XlsFileResource;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
 import org.olat.repository.ui.RepositoryEntryRuntimeController;
@@ -173,8 +174,8 @@ public class WebDocumentHandler extends FileHandler {
 			log.error("", e);
 		}
 
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname,
+				description, resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/repository/handlers/WikiHandler.java b/src/main/java/org/olat/repository/handlers/WikiHandler.java
index 05118d8561e..198ec944fca 100644
--- a/src/main/java/org/olat/repository/handlers/WikiHandler.java
+++ b/src/main/java/org/olat/repository/handlers/WikiHandler.java
@@ -68,6 +68,7 @@ import org.olat.modules.wiki.WikiSecurityCallbackImpl;
 import org.olat.modules.wiki.WikiToZipUtils;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
@@ -105,8 +106,8 @@ public class WikiHandler implements RepositoryHandler {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		WikiResource wikiResource = WikiManager.getInstance().createWiki();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(wikiResource);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null,
-				WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname, description,
+				resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -128,8 +129,8 @@ public class WikiHandler implements RepositoryHandler {
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(wikiResource);
 		File rootDirectory = WikiManager.getInstance().getWikiRootContainer(resource).getBasefile();
 		WikiManager.getInstance().importWiki(file, filename, rootDirectory);
-		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-			.create(initialAuthor, null, WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname,
+				description, resource, RepositoryEntryStatusEnum.preparation, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
diff --git a/src/main/java/org/olat/repository/manager/AutomaticLifecycleService.java b/src/main/java/org/olat/repository/manager/AutomaticLifecycleService.java
index f20861cf93f..25bbccb6f3c 100644
--- a/src/main/java/org/olat/repository/manager/AutomaticLifecycleService.java
+++ b/src/main/java/org/olat/repository/manager/AutomaticLifecycleService.java
@@ -25,13 +25,14 @@ import java.util.List;
 
 import org.olat.commons.calendar.CalendarUtils;
 import org.olat.core.commons.persistence.DB;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.StringHelper;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryLifeCycleValue;
 import org.olat.repository.RepositoryEntryManagedFlag;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,7 +58,7 @@ public class AutomaticLifecycleService {
 	
 	public void manage() {
 		close();
-		unpublish();
+		//unpublish();
 		delete();
 	}
 	
@@ -84,13 +85,12 @@ public class AutomaticLifecycleService {
 	}
 	
 	public List<RepositoryEntry> getRepositoryEntriesToClose(Date date) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(512);//TODO repo unit
 		sb.append("select v from repositoryentry as v ")
 		  .append(" inner join fetch v.olatResource as ores")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" inner join fetch v.lifecycle as lifecycle")
-		  .append(" where lifecycle.validTo<:now and v.statusCode=").append(RepositoryEntryStatus.REPOSITORY_STATUS_OPEN)
-		  .append(" and v.access>=").append(RepositoryEntry.ACC_OWNERS);
+		  .append(" where lifecycle.validTo<:now and v.status ").in(RepositoryEntryStatusEnum.preparationToPublished());//TODO repo access
 		
 		Calendar cal = Calendar.getInstance();
 		cal.setTime(date);
@@ -102,7 +102,7 @@ public class AutomaticLifecycleService {
 				.setParameter("now", endOfDay)
 				.getResultList();
 	}
-	
+	/*
 	private void unpublish() {
 		String autoUnpublish = repositoryModule.getLifecycleAutoUnpublish();
 		if(StringHelper.containsNonWhitespace(autoUnpublish)) {
@@ -126,13 +126,13 @@ public class AutomaticLifecycleService {
 	}
 	
 	public List<RepositoryEntry> getRepositoryEntriesToUnpublish(Date date) {
-		StringBuilder sb = new StringBuilder();
+		StringBuilder sb = new StringBuilder();//TODO repo unit
 		sb.append("select v from repositoryentry as v ")
 		  .append(" inner join fetch v.olatResource as ores")
 		  .append(" inner join fetch v.statistics as statistics")
 		  .append(" inner join fetch v.lifecycle as lifecycle")
 		  .append(" where lifecycle.validTo<:now and not(v.statusCode=").append(RepositoryEntryStatus.REPOSITORY_STATUS_UNPUBLISHED).append(")")
-		  .append(" and v.access>=").append(RepositoryEntry.ACC_OWNERS);
+		  .append(" and v.access>=").append(RepositoryEntry.ACC_OWNERS);//TODO repo access
 		
 		Calendar cal = Calendar.getInstance();
 		cal.setTime(date);
@@ -143,7 +143,7 @@ public class AutomaticLifecycleService {
 				.createQuery(sb.toString(), RepositoryEntry.class)
 				.setParameter("now", endOfDay)
 				.getResultList();
-	}
+	}*/
 	
 	private void delete() {
 		String autoDelete = repositoryModule.getLifecycleAutoDelete();
@@ -168,12 +168,12 @@ public class AutomaticLifecycleService {
 	}
 	
 	public List<RepositoryEntry> getRepositoryEntriesToDelete(Date date) {
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(512);
 		sb.append("select v from repositoryentry as v ")
 		  .append(" inner join fetch v.olatResource as ores")
 		  .append(" inner join fetch v.statistics as statistics")
-		  .append(" inner join fetch v.lifecycle as lifecycle")
-		  .append(" where lifecycle.validTo<:now and v.access>=").append(RepositoryEntry.ACC_OWNERS);
+		  .append(" inner join fetch v.lifecycle as lifecycle")//TODO repo access
+		  .append(" where lifecycle.validTo<:now and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed());
 		
 		Calendar cal = Calendar.getInstance();
 		cal.setTime(date);
diff --git a/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java b/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java
index 8961dc3afb1..7fbb65529d0 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java
@@ -31,6 +31,7 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.commons.services.mark.impl.MarkImpl;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Roles;
@@ -39,6 +40,7 @@ import org.olat.core.logging.Tracing;
 import org.olat.core.util.StringHelper;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryAuthorView;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.model.RepositoryEntryAuthorImpl;
 import org.olat.repository.model.SearchAuthorRepositoryEntryViewParams;
 import org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy;
@@ -124,7 +126,7 @@ public class RepositoryEntryAuthorQueries {
 
 		boolean count = Number.class.equals(type);
 		boolean needIdentity = false;
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(2048);
 		if(count) {
 			sb.append("select count(v.key) ")
 			  .append(" from repositoryentry as v")
@@ -162,9 +164,9 @@ public class RepositoryEntryAuthorQueries {
 		
 		if(params.getClosed() != null) {
 			if(params.getClosed().booleanValue()) {
-				sb.append(" and v.statusCode>0");
+				sb.append(" and v.status ").in(RepositoryEntryStatusEnum.closed);
 			} else {
-				sb.append(" and v.statusCode=0");
+				sb.append(" and v.status ").in(RepositoryEntryStatusEnum.preparationToPublished());
 			}
 		}
 		
@@ -312,62 +314,52 @@ public class RepositoryEntryAuthorQueries {
 		return dbQuery;
 	}
 	
-	private boolean appendAccessSubSelect(StringBuilder sb, SearchAuthorRepositoryEntryViewParams params) {
+	private boolean appendAccessSubSelect(QueryBuilder sb, SearchAuthorRepositoryEntryViewParams params) {
 		if(params.isOwnedResourcesOnly()) {
 			sb.append(" v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
 			  .append("    where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
 			  .append("      and membership.role='").append(GroupRoles.owner.name()).append("'")
 			  .append(" )");
 			if(params.isDeleted()) {
-				sb.append(" and v.access=").append(RepositoryEntry.DELETED);
+				sb.append(" and v.status='").append(RepositoryEntryStatusEnum.trash).append("'");
 			} else {
-				sb.append(" and v.access>=").append(RepositoryEntry.ACC_OWNERS);
+				sb.append(" and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed());
 			}
 			return true;
 		}
 		
 		Roles roles = params.getRoles();
 		if(roles == null) {
-			sb.append(" v.access>=").append(RepositoryEntry.ACC_USERS);
+			sb.append(" v.allUsers=true and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());
 			return false;
 		}
 
-		if(roles.isAdministrator()) {//TODO roles repo
-			if(params.isDeleted()) {
-				sb.append(" v.access=").append(RepositoryEntry.DELETED);
-			} else {
-				sb.append(" v.access>=").append(RepositoryEntry.ACC_OWNERS);
-			}
-			return false;
-		}
-		if(roles.isPrincipal()) {//TODO roles repo
-			sb.append(" v.access>=").append(RepositoryEntry.ACC_OWNERS);
-			return false;
+		sb.append("(")
+		  .append(" (v.allUsers=true and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
+		  // or owner, principal, lear resource manager and administrator which can see all
+		  .append(" or (v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
+		  .append("     where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
+		  .append("     and membership.role ").in(OrganisationRoles.administrator, OrganisationRoles.principal, OrganisationRoles.learnresourcemanager, GroupRoles.owner).append(")")
+		  .append("     and v.status ");
+		if(params.isDeleted() && (roles.isAdministrator() || roles.isLearnResourceManager())) {// only administrator and learn resource manager see the trash
+			sb.append("='").append(RepositoryEntryStatusEnum.trash).append("'");
+		} else {
+			sb.in(RepositoryEntryStatusEnum.preparationToClosed());
 		}
+		sb.append(")");// End or of owner
 		
-		sb.append(" (v.access>=").append(RepositoryEntry.ACC_USERS);
 		if(roles.isAuthor()) {
-			sb.append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS_AUTHORS)
-			  .append("   and v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
+			sb.append(" or (v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
 			  .append("     where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
-			  .append("       and membership.role = '").append(OrganisationRoles.author).append("'")
-			  .append("   )")
-			  .append(" )");
-		} 
-		sb.append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS)
-		  .append("   and v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
-		  .append("     where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
-		  .append("       and membership.role in ('").append(GroupRoles.owner.name()).append("'");
-		if(roles.isLearnResourceManager()) {
-			sb.append(",'").append(OrganisationRoles.learnresourcemanager.name()).append("'");
+			  .append("     and membership.role ='").append(OrganisationRoles.author).append("')")
+			  .append("     and v.status ").in(RepositoryEntryStatusEnum.reviewToClosed())
+			  .append(")");// End or of autho
 		}
-		sb.append("     )")//close in
-		  .append("   )")
-		  .append(" ))");
+		sb.append(")");
 		return true;
 	}
 	
-	private void appendAuthorViewOrderBy(SearchAuthorRepositoryEntryViewParams params, StringBuilder sb) {
+	private void appendAuthorViewOrderBy(SearchAuthorRepositoryEntryViewParams params, QueryBuilder sb) {
 		OrderBy orderBy = params.getOrderBy();
 		boolean asc = params.isOrderByAsc();
 		
@@ -406,9 +398,9 @@ public class RepositoryEntryAuthorQueries {
 					break;
 				case access:
 					if(asc) {
-						sb.append(" order by v.membersOnly asc, v.access asc, lower(v.displayname) asc");
+						sb.append(" order by v.allUsers asc, v.status asc, lower(v.displayname) asc");
 					} else {
-						sb.append(" order by v.membersOnly desc, v.access desc, lower(v.displayname) desc");
+						sb.append(" order by v.allUsers desc, v.status desc, lower(v.displayname) desc");
 					}
 					break;
 				case ac:
@@ -477,7 +469,7 @@ public class RepositoryEntryAuthorQueries {
 		}
 	}
 	
-	private final StringBuilder appendAsc(StringBuilder sb, boolean asc) {
+	private final QueryBuilder appendAsc(QueryBuilder sb, boolean asc) {
 		if(asc) {
 			sb.append(" asc");
 		} else {
diff --git a/src/main/java/org/olat/repository/manager/RepositoryEntryMyCourseQueries.java b/src/main/java/org/olat/repository/manager/RepositoryEntryMyCourseQueries.java
index 730e9af6de6..def21aaccb8 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryEntryMyCourseQueries.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryEntryMyCourseQueries.java
@@ -32,6 +32,7 @@ import org.olat.basesecurity.GroupRoles;
 import org.olat.basesecurity.IdentityImpl;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.commons.services.mark.impl.MarkImpl;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Roles;
@@ -44,6 +45,7 @@ import org.olat.course.assessment.model.UserEfficiencyStatementLight;
 import org.olat.fileresource.types.VideoFileResource;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryMyView;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.model.CatalogEntryImpl;
 import org.olat.repository.model.RepositoryEntryMyCourseImpl;
@@ -114,7 +116,7 @@ public class RepositoryEntryMyCourseQueries {
 		for(Object[] object:objects) {
 			RepositoryEntry re = (RepositoryEntry)object[0];
 			Number numOfMarks = (Number)object[1];
-			boolean hasMarks = numOfMarks == null ? false : numOfMarks.longValue() > 0;
+			boolean hasMarks = numOfMarks != null && numOfMarks.longValue() > 0;
 			Number numOffers = (Number)object[2];
 			long offers = numOffers == null ? 0l : numOffers.longValue();
 			Integer myRating = (Integer)object[3];
@@ -135,7 +137,7 @@ public class RepositoryEntryMyCourseQueries {
 			}
 		}
 		
-		if(effKeys.size() > 0) {
+		if(!effKeys.isEmpty()) {
 			List<UserEfficiencyStatementLight> efficiencyStatements =
 					efficiencyStatementManager.findEfficiencyStatementsLight(effKeys);
 			for(UserEfficiencyStatementLight efficiencyStatement:efficiencyStatements) {
@@ -157,7 +159,7 @@ public class RepositoryEntryMyCourseQueries {
 		boolean needIdentityKey = false;
 		boolean count = Number.class.equals(type);
 		boolean oracle = "oracle".equals(dbInstance.getDbVendor());
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder(2048);
 		
 		if(count) {
 			sb.append("select count(v.key) ")
@@ -211,9 +213,9 @@ public class RepositoryEntryMyCourseQueries {
 
 		if(params.getClosed() != null) {
 			if(params.getClosed().booleanValue()) {
-				sb.append(" and v.statusCode>0");
+				sb.append(" and v.status ").in(RepositoryEntryStatusEnum.closed);
 			} else {
-				sb.append(" and v.statusCode=0");
+				sb.append(" and v.status ").in(RepositoryEntryStatusEnum.preparationToPublished());
 			}
 		}
 		
@@ -257,8 +259,6 @@ public class RepositoryEntryMyCourseQueries {
 
 		String text = params.getText();
 		if (StringHelper.containsNonWhitespace(text)) {
-			//displayName = '%' + displayName.replace('*', '%') + '%';
-			//query.append(" and v.displayname like :displayname");
 			text = PersistenceHelper.makeFuzzyQueryString(text);
 			sb.append(" and (");
 			PersistenceHelper.appendFuzzyLike(sb, "v.displayname", "displaytext", dbInstance.getDbVendor());
@@ -362,66 +362,49 @@ public class RepositoryEntryMyCourseQueries {
 		return dbQuery;
 	}
 	
-	private boolean appendMyViewAccessSubSelect(StringBuilder sb, Roles roles, List<Filter> filters, boolean membershipMandatory) {
-		boolean needIdentityKey = false;
-		
-		sb.append("(v.access >= ");
-		if (roles.isAuthor()) {
-			sb.append(RepositoryEntry.ACC_OWNERS_AUTHORS);
-		} else if (roles.isGuestOnly()) {
-			sb.append(RepositoryEntry.ACC_USERS_GUESTS);
-		} else {
-			sb.append(RepositoryEntry.ACC_USERS);
+	private boolean appendMyViewAccessSubSelect(QueryBuilder sb, Roles roles, List<Filter> filters, boolean membershipMandatory) {
+		if(roles.isGuestOnly()) {
+			sb.append(" v.allUsers=true and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed());//TODO repo access	
+			return false;
 		}
 
-		StringBuilder inRoles = new StringBuilder();
-		if(filters != null && filters.size() > 0) {
+		List<GroupRoles> inRoles = new ArrayList<>();
+		if(filters != null && !filters.isEmpty()) {
 			for(Filter filter: filters) {
 				if(Filter.asAuthor.equals(filter)) {
-					if(inRoles.length() > 0) inRoles.append(",");
-					inRoles.append("'").append(GroupRoles.owner.name()).append("'");
+					inRoles.add(GroupRoles.owner);
 				} else if(Filter.asCoach.equals(filter)) {
-					if(inRoles.length() > 0) inRoles.append(",");
-					inRoles.append("'").append(GroupRoles.coach.name()).append("'");
+					inRoles.add(GroupRoles.coach);
 				} else if (Filter.asParticipant.equals(filter)) {
-					if(inRoles.length() > 0) inRoles.append(",");
-					inRoles.append("'").append(GroupRoles.participant.name()).append("'");
+					inRoles.add(GroupRoles.participant);
 				}
 			}
 		}
-
 		//+ membership
-		if(roles.isGuestOnly()) {
-			sb.append(")");
+		sb.append(" v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(" and ");
+		if(inRoles.isEmpty() && !membershipMandatory) {
+			//sub select are very quick
+			sb.append(" (v.allUsers=true or v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
+			  .append("    where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
+			  .append("    and membership.role ").in(GroupRoles.owner, GroupRoles.coach, GroupRoles.participant)
+			  .append(" ))");
 		} else {
-			if(inRoles.length() == 0 && !membershipMandatory) {
-				needIdentityKey = true;
-				//sub select are very quick
-				sb.append(" or (")
-				  .append("  v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true")
-				  .append("  and v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
-				  .append("    where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
-				  .append("      and membership.role in ('").append(GroupRoles.owner.name()).append("','").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("')")
-				  .append("  )")
-				  .append(" )")
-				  .append(")");
-			} else {
-				if(inRoles.length() == 0) {
-					inRoles.append("'").append(GroupRoles.owner.name()).append("','").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("'");
-				}
-				needIdentityKey = true;
-				//make sure that in all case the role is mandatory
-				sb.append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true))")
-				  .append(" and v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
-				  .append("    where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
-				  .append("      and membership.role in (").append(inRoles).append(")")
-				  .append(" )");
+			if(inRoles.isEmpty()) {
+				inRoles.add(GroupRoles.owner);
+				inRoles.add(GroupRoles.coach);
+				inRoles.add(GroupRoles.participant);
 			}
+		
+			//make sure that in all case the role is mandatory
+			sb.append(" v.key in (select rel.entry.key from repoentrytogroup as rel, bgroupmember as membership")
+			  .append("    where rel.group.key=membership.group.key and membership.identity.key=:identityKey")
+			  .append("    and membership.role ").in(inRoles.toArray(new GroupRoles[inRoles.size()]))
+			  .append(" )");
 		}
-		return needIdentityKey;
+		return true;
 	}
 	
-	private boolean appendFiltersInWhereClause(Filter filter, StringBuilder sb) {
+	private boolean appendFiltersInWhereClause(Filter filter, QueryBuilder sb) {
 		boolean needIdentityKey = false;
 		switch(filter) {
 			case showAll: break;
@@ -465,7 +448,7 @@ public class RepositoryEntryMyCourseQueries {
 	 * @param sb
 	 * @return
 	 */
-	private boolean appendOrderByInSelect(SearchMyRepositoryEntryViewParams params, StringBuilder sb) {
+	private boolean appendOrderByInSelect(SearchMyRepositoryEntryViewParams params, QueryBuilder sb) {
 		boolean needIdentityKey = false;
 		OrderBy orderBy = params.getOrderBy();
 		if(orderBy != null) {
@@ -495,7 +478,7 @@ public class RepositoryEntryMyCourseQueries {
 		return needIdentityKey;
 	}
 	
-	private void appendOrderBy(OrderBy orderBy, boolean asc, StringBuilder sb) {
+	private void appendOrderBy(OrderBy orderBy, boolean asc, QueryBuilder sb) {
 		if(orderBy != null) {
 			switch(orderBy) {
 				case automatic://! the sorting is reverse
@@ -595,8 +578,8 @@ public class RepositoryEntryMyCourseQueries {
 					appendAsc(sb, asc).append(" nulls last, lower(v.displayname) asc");
 					break;
 				case lifecycleStart:
-					sb.append(" order by lifecycle.validFrom ");
-					appendAsc(sb, asc).append(" nulls last, lower(v.displayname) asc");
+					sb.append(" order by lifecycle.validFrom ")
+					  .appendAsc(asc).append(" nulls last, lower(v.displayname) asc");
 					break;
 				case lifecycleEnd:
 					sb.append(" order by lifecycle.validTo ");
@@ -613,7 +596,7 @@ public class RepositoryEntryMyCourseQueries {
 		}
 	}
 	
-	private final StringBuilder appendAsc(StringBuilder sb, boolean asc) {
+	private final QueryBuilder appendAsc(QueryBuilder sb, boolean asc) {
 		if(asc) {
 			sb.append(" asc");
 		} else {
diff --git a/src/main/java/org/olat/repository/manager/RepositoryEntryQueries.java b/src/main/java/org/olat/repository/manager/RepositoryEntryQueries.java
index b962338f48a..70f212015c7 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryEntryQueries.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryEntryQueries.java
@@ -28,10 +28,12 @@ import org.olat.basesecurity.IdentityImpl;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.id.Roles;
 import org.olat.core.util.StringHelper;
 import org.olat.repository.CatalogEntry;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
 import org.olat.user.UserImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,7 +71,7 @@ public class RepositoryEntryQueries {
 		String displayName = params.getDisplayName();
 		List<String> resourceTypes = params.getResourceTypes();
 
-		StringBuilder query = new StringBuilder(2048);
+		QueryBuilder query = new QueryBuilder(2048);
 		if(Number.class.equals(type)) {
 			query.append("select count(v.key) from repositoryentry v ");
 			query.append(" inner join v.olatResource as res");
@@ -190,13 +192,9 @@ public class RepositoryEntryQueries {
 	 * @param roles
 	 * @return
 	 */
-	private boolean appendAccessSubSelects(StringBuilder sb, Roles roles, boolean onlyExplicitMember) {
-		if(roles.isAdministrator()) {//TODO roles repo
-			sb.append(" where v.access>=").append(RepositoryEntry.ACC_OWNERS);
-			return false;	
-		}
+	private boolean appendAccessSubSelects(QueryBuilder sb, Roles roles, boolean onlyExplicitMember) {
 		if(roles.isGuestOnly()) {
-			sb.append(" where v.access>=").append(RepositoryEntry.ACC_USERS_GUESTS);
+			sb.append(" where v.guests=true and v.status not in ('").append(RepositoryEntryStatusEnum.trash).append("','").append(RepositoryEntryStatusEnum.deleted).append("')");
 			return false;
 		}
 		
@@ -205,35 +203,39 @@ public class RepositoryEntryQueries {
 		  .append(" inner join relGroup.group as baseGroup")
 		  .append(" inner join baseGroup.members as membership")
 		  .append(" where membership.identity.key=:identityKey and");
-		
+
 		if(onlyExplicitMember) {
-			sb.append(" (v.access>=").append(RepositoryEntry.ACC_USERS)
-		      .append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true")
-		      .append("   and membership.role in ('").append(GroupRoles.owner.name()).append("','").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("')")
-		      .append(" ))");
+			sb.append("(")
+			  .append(" (v.allUsers=true and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
+			  .append(" or")
+			  .append(" (membership.role='").append(GroupRoles.owner.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed()).append(")")
+			  .append(" or")
+			  .append(" (membership.role='").append(GroupRoles.coach.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.coachPublishedToClosed()).append(")")
+			  .append(" or")
+			  .append(" (membership.role='").append(GroupRoles.participant.name()).append("' and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")")
+			  .append(")");
 			return true;
 		}
 
 		//access rules as user
-		sb.append("(v.access>=").append(RepositoryEntry.ACC_USERS);
-		if(roles.isLearnResourceManager()) {
-			// as learn resource manager
-			sb.append(" or (v.access>=").append(RepositoryEntry.ACC_OWNERS)
-			  .append("  and membership.role='").append(OrganisationRoles.learnresourcemanager.name()).append("')");
-		}
-		
+		sb.append("(")
+		  .append(" (v.allUsers=true and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")");
+		// administrator, learn resource manager and owner
+		sb.append(" or (membership.role ").in(OrganisationRoles.administrator, OrganisationRoles.learnresourcemanager, GroupRoles.owner)
+		  .append("  and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed()).append(")");
 		if(roles.isAuthor()) {
 			// as author
-			sb.append(" or (v.access>=").append(RepositoryEntry.ACC_OWNERS_AUTHORS)
-			  .append("  and membership.role='").append(OrganisationRoles.author.name()).append("')");
+			sb.append(" or (membership.role ").in(OrganisationRoles.author)
+			  .append("  and v.status ").in(RepositoryEntryStatusEnum.reviewToClosed()).append(")");
 		}
-		// as owner
-		sb.append(" or (v.access>=").append(RepositoryEntry.ACC_OWNERS)
-		  .append("  and membership.role='").append(GroupRoles.owner.name()).append("')");
+		// as coach
+		sb.append(" or (membership.role ").in(GroupRoles.coach)
+		  .append("  and v.status ").in(RepositoryEntryStatusEnum.coachPublishedToClosed()).append(")");
 		// as member
-		sb.append(" or (v.access=").append(RepositoryEntry.ACC_OWNERS).append(" and v.membersOnly=true")
-		  .append("  and membership.role in ('").append(GroupRoles.coach.name()).append("','").append(GroupRoles.participant.name()).append("'))")
-		  .append(")");
+		sb.append(" or (membership.role ").in(GroupRoles.participant)
+		  .append("  and v.status ").in(RepositoryEntryStatusEnum.publishedAndClosed()).append(")");
+		
+		sb.append(")");
 
 		return true;
 	}
diff --git a/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java b/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java
index c907417be4a..4073996363c 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java
@@ -76,7 +76,7 @@ import org.olat.repository.RepositoryEntryAuthorView;
 import org.olat.repository.RepositoryEntryMyView;
 import org.olat.repository.RepositoryEntryRef;
 import org.olat.repository.RepositoryEntryRelationType;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryEntryToOrganisation;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryModule;
@@ -164,12 +164,12 @@ public class RepositoryServiceImpl implements RepositoryService {
 
 	@Override
 	public RepositoryEntry create(Identity initialAuthor, String initialAuthorAlt, String resourceName,
-			String displayname, String description, OLATResource resource, int access, Organisation organisation) {
-		return create(initialAuthorAlt, initialAuthor, resourceName, displayname, description, resource, access, organisation);
+			String displayname, String description, OLATResource resource, RepositoryEntryStatusEnum status, Organisation organisation) {
+		return create(initialAuthorAlt, initialAuthor, resourceName, displayname, description, resource, status, organisation);
 	}
 
 	private RepositoryEntry create(String initialAuthorName, Identity initialAuthor, String resourceName,
-			String displayname, String description, OLATResource resource, int access, Organisation organisation) {
+			String displayname, String description, OLATResource resource, RepositoryEntryStatusEnum status, Organisation organisation) {
 		Date now = new Date();
 
 		RepositoryEntry re = new RepositoryEntry();
@@ -182,11 +182,10 @@ public class RepositoryServiceImpl implements RepositoryService {
 		}
 		re.setCreationDate(now);
 		re.setLastModified(now);
-		re.setAccess(access);
+		re.setEntryStatus(status);
 		re.setCanDownload(false);
 		re.setCanCopy(false);
 		re.setCanReference(false);
-		re.setCanLaunch(true);
 		re.setDisplayname(displayname);
 		re.setResourcename(StringHelper.containsNonWhitespace(resourceName) ? resourceName : "-");
 		re.setDescription(description == null ? "" : description);
@@ -251,7 +250,7 @@ public class RepositoryServiceImpl implements RepositoryService {
 		OLATResource sourceResource = sourceEntry.getOlatResource();
 		OLATResource copyResource = resourceManager.createOLATResourceInstance(sourceResource.getResourceableTypeName());
 		RepositoryEntry copyEntry = create(author, null, sourceEntry.getResourcename(), displayname,
-				sourceEntry.getDescription(), copyResource, RepositoryEntry.ACC_OWNERS, null);
+				sourceEntry.getDescription(), copyResource, RepositoryEntryStatusEnum.preparation, null);
 
 		//copy all fields
 		copyEntry.setAuthors(sourceEntry.getAuthors());
@@ -367,7 +366,10 @@ public class RepositoryServiceImpl implements RepositoryService {
 	@Override
 	public RepositoryEntry deleteSoftly(RepositoryEntry re, Identity deletedBy, boolean owners) {
 		RepositoryEntry reloadedRe = repositoryEntryDAO.loadForUpdate(re);
-		reloadedRe.setAccess(RepositoryEntry.DELETED);
+		reloadedRe.setAllUsers(false);
+		reloadedRe.setGuests(false);
+		reloadedRe.setEntryStatus(RepositoryEntryStatusEnum.trash);
+		
 		if(reloadedRe.getDeletionDate() == null) {
 			// don't write the name of an admin which make a restore -> delete operation
 			reloadedRe.setDeletedBy(deletedBy);
@@ -397,11 +399,12 @@ public class RepositoryServiceImpl implements RepositoryService {
 	@Override
 	public RepositoryEntry restoreRepositoryEntry(RepositoryEntry entry) {
 		RepositoryEntry reloadedRe = repositoryEntryDAO.loadForUpdate(entry);
-		reloadedRe.setAccess(RepositoryEntry.ACC_OWNERS);
+		reloadedRe.setAllUsers(false);
+		reloadedRe.setGuests(false);
 		if("CourseModule".equals(reloadedRe.getOlatResource().getResourceableTypeName())) {
-			reloadedRe.setStatusCode(RepositoryEntryStatus.REPOSITORY_STATUS_CLOSED);
+			reloadedRe.setEntryStatus(RepositoryEntryStatusEnum.closed);
 		} else {
-			reloadedRe.setStatusCode(RepositoryEntryStatus.REPOSITORY_STATUS_OPEN);
+			reloadedRe.setEntryStatus(RepositoryEntryStatusEnum.preparation);
 		}
 		reloadedRe = dbInstance.getCurrentEntityManager().merge(reloadedRe);
 		dbInstance.commit();
@@ -509,7 +512,7 @@ public class RepositoryServiceImpl implements RepositoryService {
 	@Override
 	public RepositoryEntry closeRepositoryEntry(RepositoryEntry entry) {
 		RepositoryEntry reloadedEntry = repositoryEntryDAO.loadForUpdate(entry);
-		reloadedEntry.setStatusCode(RepositoryEntryStatus.REPOSITORY_STATUS_CLOSED);
+		reloadedEntry.setEntryStatus(RepositoryEntryStatusEnum.closed);
 		reloadedEntry = dbInstance.getCurrentEntityManager().merge(reloadedEntry);
 		dbInstance.commit();
 		return reloadedEntry;
@@ -518,7 +521,7 @@ public class RepositoryServiceImpl implements RepositoryService {
 	@Override
 	public RepositoryEntry uncloseRepositoryEntry(RepositoryEntry entry) {
 		RepositoryEntry reloadedEntry = repositoryEntryDAO.loadForUpdate(entry);
-		reloadedEntry.setStatusCode(RepositoryEntryStatus.REPOSITORY_STATUS_OPEN);
+		reloadedEntry.setEntryStatus(RepositoryEntryStatusEnum.published);
 		reloadedEntry = dbInstance.getCurrentEntityManager().merge(reloadedEntry);
 		dbInstance.commit();
 		return reloadedEntry;
@@ -527,7 +530,7 @@ public class RepositoryServiceImpl implements RepositoryService {
 	@Override
 	public RepositoryEntry unpublishRepositoryEntry(RepositoryEntry entry) {
 		RepositoryEntry reloadedEntry = repositoryEntryDAO.loadForUpdate(entry);
-		reloadedEntry.setStatusCode(RepositoryEntryStatus.REPOSITORY_STATUS_UNPUBLISHED);
+		reloadedEntry.setEntryStatus(RepositoryEntryStatusEnum.trash);
 		reloadedEntry = dbInstance.getCurrentEntityManager().merge(reloadedEntry);
 		dbInstance.commit();
 		// remove catalog entries
diff --git a/src/main/java/org/olat/repository/model/RepositoryEntryAuthorImpl.java b/src/main/java/org/olat/repository/model/RepositoryEntryAuthorImpl.java
index 3cf4430374d..ce1e58a8060 100644
--- a/src/main/java/org/olat/repository/model/RepositoryEntryAuthorImpl.java
+++ b/src/main/java/org/olat/repository/model/RepositoryEntryAuthorImpl.java
@@ -25,6 +25,7 @@ import org.olat.core.util.resource.OresHelper;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryAuthorView;
 import org.olat.repository.RepositoryEntryManagedFlag;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 
 /**
@@ -50,9 +51,9 @@ public class RepositoryEntryAuthorImpl implements RepositoryEntryAuthorView {
 	private final String externalRef;
 	private final RepositoryEntryManagedFlag[] managedFlags;
 	
-	private final boolean membersOnly;
-	private final int access;
-	private final int statusCode;
+	private final RepositoryEntryStatusEnum status;
+	private final boolean allUsers;
+	private final boolean guests;
 	
 	private final Date lastUsage;
 	
@@ -83,9 +84,9 @@ public class RepositoryEntryAuthorImpl implements RepositoryEntryAuthorView {
 		externalRef = re.getExternalRef();
 		managedFlags = re.getManagedFlags();
 		
-		membersOnly = re.isMembersOnly();
-		access = re.getAccess();
-		statusCode = re.getStatusCode();
+		status = re.getEntryStatus();
+		allUsers = re.isAllUsers();
+		guests = re.isGuests();
 		
 		lastUsage = re.getStatistics().getLastUsage();
 		
@@ -115,11 +116,6 @@ public class RepositoryEntryAuthorImpl implements RepositoryEntryAuthorView {
 		return olatResource.getResourceableTypeName();
 	}
 
-	@Override
-	public int getStatusCode() {
-		return statusCode;
-	}
-
 	@Override
 	public Long getResourceableId() {
 		return getKey();
@@ -175,13 +171,18 @@ public class RepositoryEntryAuthorImpl implements RepositoryEntryAuthorView {
 	}
 
 	@Override
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return status;
+	}
+
+	@Override
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
 	@Override
-	public int getAccess() {
-		return access;
+	public boolean isGuests() {
+		return guests;
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/model/RepositoryEntryLightImpl.java b/src/main/java/org/olat/repository/model/RepositoryEntryLightImpl.java
index 5a0f8b1876a..4364c75f47a 100644
--- a/src/main/java/org/olat/repository/model/RepositoryEntryLightImpl.java
+++ b/src/main/java/org/olat/repository/model/RepositoryEntryLightImpl.java
@@ -38,6 +38,7 @@ import org.hibernate.annotations.GenericGenerator;
 import org.hibernate.annotations.Parameter;
 import org.olat.core.id.Persistable;
 import org.olat.repository.RepositoryEntryLight;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceImpl;
 
@@ -72,18 +73,15 @@ public class RepositoryEntryLightImpl implements RepositoryEntryLight, Persistab
 
 	@Column(name="displayname", nullable=false, insertable=false, updatable=false)
 	private String displayname;
-	
 	@Column(name="description", nullable=false, insertable=false, updatable=false)
 	private String description;
 
-	@Column(name="accesscode", nullable=false, insertable=false, updatable=false)
-	private int access;
-
-	@Column(name="membersonly", nullable=false, insertable=false, updatable=false)
-	private boolean membersOnly;
-	
-	@Column(name="statuscode", nullable=false, insertable=false, updatable=false)
-	private int statusCode;
+	@Column(name="status", nullable=false, insertable=true, updatable=true)
+	private String status;
+	@Column(name="allusers", nullable=false, insertable=true, updatable=true)
+	private boolean allUsers;
+	@Column(name="guests", nullable=false, insertable=true, updatable=true)
+	private boolean guests;
 	
 	@ManyToOne(targetEntity=OLATResourceImpl.class,fetch=FetchType.LAZY, optional=false)
 	@JoinColumn(name="fk_olatresource", nullable=false, insertable=true, updatable=false)
@@ -136,29 +134,34 @@ public class RepositoryEntryLightImpl implements RepositoryEntryLight, Persistab
 		this.groups = groups;
 	}
 
-	public int getAccess() {
-		return access;
+	public String getStatus() {
+		return status;
 	}
 
-	public void setAccess(int access) {
-		this.access = access;
+	public void setStatus(String status) {
+		this.status = status;
 	}
 
-	public boolean isMembersOnly() {
-		return membersOnly;
+	@Override
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return RepositoryEntryStatusEnum.valueOf(status);
 	}
 
-	public void setMembersOnly(boolean membersOnly) {
-		this.membersOnly = membersOnly;
+	@Override
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
+	public void setAllUsers(boolean allUsers) {
+		this.allUsers = allUsers;
+	}
 	@Override
-	public int getStatusCode() {
-		return statusCode;
+	public boolean isGuests() {
+		return guests;
 	}
-	
-	public void setStatusCode(int statusCode) {
-		this.statusCode = statusCode;
+
+	public void setGuests(boolean guests) {
+		this.guests = guests;
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/model/RepositoryEntryMyCourseImpl.java b/src/main/java/org/olat/repository/model/RepositoryEntryMyCourseImpl.java
index a723de25b14..b4db4dc15bc 100644
--- a/src/main/java/org/olat/repository/model/RepositoryEntryMyCourseImpl.java
+++ b/src/main/java/org/olat/repository/model/RepositoryEntryMyCourseImpl.java
@@ -26,6 +26,7 @@ import org.olat.core.id.ModifiedInfo;
 import org.olat.course.assessment.model.UserEfficiencyStatementLight;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryMyView;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 
 /**
@@ -49,9 +50,9 @@ public class RepositoryEntryMyCourseImpl implements RepositoryEntryMyView, Creat
 	private final String authors;
 	private final String location;
 	private final String expenditureOfWork;
-	private final boolean membersOnly;
-	private final int access;
-	private final int statusCode;
+	private final RepositoryEntryStatusEnum status;
+	private final boolean allUsers;
+	private final boolean guests;
 	
 	private final OLATResource olatResource;
 	private final RepositoryEntryLifecycle lifecycle;
@@ -82,9 +83,9 @@ public class RepositoryEntryMyCourseImpl implements RepositoryEntryMyView, Creat
 		authors = re.getAuthors();
 		location = re.getLocation();
 		expenditureOfWork = re.getExpenditureOfWork();
-		membersOnly = re.isMembersOnly();
-		access = re.getAccess();
-		statusCode = re.getStatusCode();
+		status = re.getEntryStatus();
+		allUsers = re.isAllUsers();
+		guests = re.isGuests();
 		
 		olatResource = re.getOlatResource();
 		lifecycle = re.getLifecycle();
@@ -145,19 +146,20 @@ public class RepositoryEntryMyCourseImpl implements RepositoryEntryMyView, Creat
 		this.lastModified = lastModified;
 	}
 
+
 	@Override
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return status;
 	}
 
 	@Override
-	public int getAccess() {
-		return access;
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
 	@Override
-	public int getStatusCode() {
-		return statusCode;
+	public boolean isGuests() {
+		return guests;
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/model/RepositoryEntryShortImpl.java b/src/main/java/org/olat/repository/model/RepositoryEntryShortImpl.java
index bfef99bf9a0..192b88e4f0d 100644
--- a/src/main/java/org/olat/repository/model/RepositoryEntryShortImpl.java
+++ b/src/main/java/org/olat/repository/model/RepositoryEntryShortImpl.java
@@ -21,6 +21,7 @@ package org.olat.repository.model;
 
 import org.olat.core.commons.persistence.PersistentObject;
 import org.olat.repository.RepositoryEntryShort;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 
 /**
@@ -34,9 +35,9 @@ public class RepositoryEntryShortImpl extends PersistentObject implements Reposi
 	private String displayName;
 	private String description;
 	private OLATResource resource;
-	private int access;
-	private int statusCode;
-	private boolean membersOnly;
+	private String status;
+	private boolean allUsers;
+	private boolean guests;
 	
 	
 	@Override
@@ -69,30 +70,34 @@ public class RepositoryEntryShortImpl extends PersistentObject implements Reposi
 	public void setOlatResource(OLATResource resource) {
 		this.resource = resource;
 	}
-
-	public int getAccess() {
-		return access;
+	
+	public String getStatus() {
+		return status;
 	}
 
-	public void setAccess(int access) {
-		this.access = access;
+	public void setStatus(String status) {
+		this.status = status;
 	}
 
 	@Override
-	public int getStatusCode() {
-		return statusCode;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return RepositoryEntryStatusEnum.valueOf(status);
 	}
-	
-	public void setStatusCode(int statusCode) {
-		this.statusCode = statusCode;
+
+	public boolean isAllUsers() {
+		return allUsers;
+	}
+
+	public void setAllUsers(boolean allUsers) {
+		this.allUsers = allUsers;
 	}
 
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public boolean isGuests() {
+		return guests;
 	}
 
-	public void setMembersOnly(boolean membersOnly) {
-		this.membersOnly = membersOnly;
+	public void setGuests(boolean guests) {
+		this.guests = guests;
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/portlet/RepositoryPortletEntry.java b/src/main/java/org/olat/repository/portlet/RepositoryPortletEntry.java
index dac1b6bea1a..cc951911203 100644
--- a/src/main/java/org/olat/repository/portlet/RepositoryPortletEntry.java
+++ b/src/main/java/org/olat/repository/portlet/RepositoryPortletEntry.java
@@ -22,6 +22,7 @@ package org.olat.repository.portlet;
 import org.olat.core.gui.control.generic.portal.PortletEntry;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryLight;
+import org.olat.repository.RepositoryEntryStatusEnum;
 
 /**
  * Description:<br>
@@ -60,18 +61,18 @@ public class RepositoryPortletEntry implements PortletEntry<RepositoryEntryLight
 		private final String displayname;
 		private final String description;
 		private final String type;
-		private final int access;
-		private final int statusCode;
-		private final boolean membersOnly;
+		private final RepositoryEntryStatusEnum status;
+		private final boolean allUsers;
+		private final boolean guests;
 		
 		public REShort(RepositoryEntryLight entry) {
 			key = entry.getKey();
 			displayname = entry.getDisplayname();
 			description = entry.getDescription();
 			type = entry.getResourceType();
-			statusCode = entry.getStatusCode();
-			access = entry.getAccess();
-			membersOnly = entry.isMembersOnly();
+			status = entry.getEntryStatus();
+			allUsers = entry.isAllUsers();
+			guests = entry.isGuests();
 		}
 		
 		public REShort(RepositoryEntry entry) {
@@ -79,9 +80,9 @@ public class RepositoryPortletEntry implements PortletEntry<RepositoryEntryLight
 			displayname = entry.getDisplayname();
 			description = entry.getDescription();
 			type = entry.getOlatResource().getResourceableTypeName();
-			statusCode = entry.getStatusCode();
-			access = entry.getAccess();
-			membersOnly = entry.isMembersOnly();
+			status = entry.getEntryStatus();
+			allUsers = entry.isAllUsers();
+			guests = entry.isGuests();
 		}
 
 		@Override
@@ -100,23 +101,23 @@ public class RepositoryPortletEntry implements PortletEntry<RepositoryEntryLight
 		}
 
 		@Override
-		public int getAccess() {
-			return access;
+		public RepositoryEntryStatusEnum getEntryStatus() {
+			return status;
 		}
 
 		@Override
-		public boolean isMembersOnly() {
-			return membersOnly;
+		public boolean isAllUsers() {
+			return allUsers;
 		}
 
 		@Override
-		public String getResourceType() {
-			return type;
+		public boolean isGuests() {
+			return guests;
 		}
 
 		@Override
-		public int getStatusCode() {
-			return statusCode;
+		public String getResourceType() {
+			return type;
 		}
 	}
 }
diff --git a/src/main/java/org/olat/repository/portlet/RepositoryPortletRunController.java b/src/main/java/org/olat/repository/portlet/RepositoryPortletRunController.java
index 630085a71f7..6192f1072c3 100644
--- a/src/main/java/org/olat/repository/portlet/RepositoryPortletRunController.java
+++ b/src/main/java/org/olat/repository/portlet/RepositoryPortletRunController.java
@@ -49,6 +49,7 @@ import org.olat.core.util.event.GenericEventListener;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryLight;
 import org.olat.repository.RepositoryEntryOrder;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.ui.RepositoryEntryTypeColumnDescriptor;
 
@@ -127,7 +128,7 @@ public class RepositoryPortletRunController extends AbstractPortletRunController
 		} else {
 			List<RepositoryEntry> fullEntries = RepositoryManager.getInstance()
 					.getLearningResourcesAsTeacher(getIdentity(), 0, maxResults, orderBy);
-			entries = new ArrayList<RepositoryEntryLight>();
+			entries = new ArrayList<>();
 			for(RepositoryEntry fullEntry:fullEntries) {
 				entries.add(new FullReWrapper(fullEntry));
 			}
@@ -136,10 +137,10 @@ public class RepositoryPortletRunController extends AbstractPortletRunController
 	}
 
 	private List<PortletEntry<RepositoryEntryLight>> convertShortRepositoryEntriesToPortletEntryList(List<RepositoryEntryLight> items) {
-		List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
+		List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<>();
 		for(RepositoryEntryLight item:items) {
-			boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
-			if(!closed) {
+			RepositoryEntryStatusEnum status = item.getEntryStatus();
+			if(!status.decommissioned()) {
 				RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
 				convertedList.add(entry);
 			}
@@ -148,10 +149,10 @@ public class RepositoryPortletRunController extends AbstractPortletRunController
 	}
 	
 	private List<PortletEntry<RepositoryEntryLight>> convertRepositoryEntriesToPortletEntryList(List<RepositoryEntry> items) {
-		List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
+		List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<>();
 		for(RepositoryEntry item:items) {
-			boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
-			if(!closed) {
+			RepositoryEntryStatusEnum status = item.getEntryStatus();
+			if(!status.decommissioned()) {
 				RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
 				convertedList.add(entry);
 			}
@@ -305,23 +306,23 @@ public class RepositoryPortletRunController extends AbstractPortletRunController
 		}
 
 		@Override
-		public int getStatusCode() {
-			return re.getStatusCode();
+		public String getDescription() {
+			return re.getDescription();
 		}
 
 		@Override
-		public String getDescription() {
-			return re.getDescription();
+		public RepositoryEntryStatusEnum getEntryStatus() {
+			return re.getEntryStatus();
 		}
 
 		@Override
-		public int getAccess() {
-			return re.getAccess();
+		public boolean isAllUsers() {
+			return re.isAllUsers();
 		}
 
 		@Override
-		public boolean isMembersOnly() {
-			return re.isMembersOnly();
-		} 
+		public boolean isGuests() {
+			return re.isGuests();
+		}
 	}
 }
\ No newline at end of file
diff --git a/src/main/java/org/olat/repository/ui/RepositoryEntryAccessColumnDescriptor.java b/src/main/java/org/olat/repository/ui/RepositoryEntryAccessColumnDescriptor.java
index 090bea91e6f..234f8e85638 100644
--- a/src/main/java/org/olat/repository/ui/RepositoryEntryAccessColumnDescriptor.java
+++ b/src/main/java/org/olat/repository/ui/RepositoryEntryAccessColumnDescriptor.java
@@ -50,31 +50,12 @@ public class RepositoryEntryAccessColumnDescriptor implements CustomCellRenderer
 	public void render(StringOutput sb, Renderer renderer, Object val, Locale locale, int alignment, String action) {
 		if(val instanceof RepositoryEntry) {
 			RepositoryEntry re = (RepositoryEntry)val;
-			if(re.isMembersOnly()) {
-				sb.append(translator.translate("table.header.access.membersonly")); 
-			} else {
-				switch (re.getAccess()) {
-					case RepositoryEntry.ACC_OWNERS:
-						sb.append(translator.translate("table.header.access.owner"));
-						break;
-					case RepositoryEntry.ACC_OWNERS_AUTHORS:
-						sb.append(translator.translate("table.header.access.author"));
-						break;
-					case RepositoryEntry.ACC_USERS:
-						sb.append(translator.translate("table.header.access.user"));
-						break;
-					case RepositoryEntry.ACC_USERS_GUESTS: {
-						if(!guestLoginEnabled) {
-							sb.append(translator.translate("table.header.access.user"));
-						} else {
-							sb.append(translator.translate("table.header.access.guest"));
-						}
-						break;
-					} default:						
-						// OLAT-6272 in case of broken repo entries with no access code
-						// return error instead of nothing
-						sb.append("ERROR");
-				}
+			sb.append(translator.translate("table.status.".concat(re.getEntryStatus().name())));
+			if(re.isAllUsers()) {
+				sb.append(translator.translate("table.allusers"));
+			}
+			if(re.isGuests() && guestLoginEnabled) {
+				sb.append(translator.translate("table.guests"));
 			}
 		}
 	}
diff --git a/src/main/java/org/olat/repository/ui/RepositoryEntryLifeCycleChangeController.java b/src/main/java/org/olat/repository/ui/RepositoryEntryLifeCycleChangeController.java
index f5a5a56c4eb..6808b455508 100644
--- a/src/main/java/org/olat/repository/ui/RepositoryEntryLifeCycleChangeController.java
+++ b/src/main/java/org/olat/repository/ui/RepositoryEntryLifeCycleChangeController.java
@@ -42,8 +42,7 @@ import org.olat.core.util.Util;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryLifeCycleValue;
 import org.olat.repository.RepositoryEntryManagedFlag;
-import org.olat.repository.RepositoryEntryStatus;
-import org.olat.repository.RepositoryManager;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.controllers.EntryChangedEvent;
@@ -86,8 +85,6 @@ public class RepositoryEntryLifeCycleChangeController extends BasicController{
 	private RepositoryModule repositoryModule;
 	@Autowired
 	private RepositoryService repositoryService;
-	@Autowired
-	private RepositoryManager repositoryManager;
 	
 	public RepositoryEntryLifeCycleChangeController(UserRequest ureq, WindowControl wControl, RepositoryEntry re, RepositoryEntrySecurity reSecurity, RepositoryHandler handler) {
 		super(ureq, wControl);
@@ -98,8 +95,7 @@ public class RepositoryEntryLifeCycleChangeController extends BasicController{
 		lifeCycleVC = createVelocityContainer("lifecycle_change");
 		putInitialPanel(lifeCycleVC);
 		
-		RepositoryEntryStatus reStatus = repositoryManager.createRepositoryEntryStatus(re.getStatusCode());
-		boolean isClosed = reStatus.isClosed();
+		boolean isClosed = re.getEntryStatus() == RepositoryEntryStatusEnum.closed;
 		boolean closeManaged = RepositoryEntryManagedFlag.isManaged(re, RepositoryEntryManagedFlag.close);
 		if (!closeManaged) {
 			closeLink = LinkFactory.createButton("close", lifeCycleVC, this);
diff --git a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java
index 0a096dc2a30..fc228ffd17d 100644
--- a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java
+++ b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java
@@ -68,6 +68,7 @@ import org.olat.course.assessment.model.TransientAssessmentMode;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryManagedFlag;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
@@ -447,11 +448,11 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 	@Override
 	public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
 		entries = removeRepositoryEntry(entries);
-		if(entries != null && entries.size() > 0) {
+		if(entries != null && !entries.isEmpty()) {
 			String type = entries.get(0).getOLATResourceable().getResourceableTypeName();
 			if("Editor".equalsIgnoreCase(type)) {
 				if(handler.supportsEdit(re) == EditionSupport.yes
-						&& !repositoryManager.createRepositoryEntryStatus(re.getStatusCode()).isClosed()) {
+						&& re.getEntryStatus() != RepositoryEntryStatusEnum.closed) {
 					doEdit(ureq);
 				}
 			} else if("Catalog".equalsIgnoreCase(type)) {
@@ -794,15 +795,14 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 			launchContent(ureq, security);
 		} else {
 			// guest are allowed to see resource with BARG 
-			if(re.getAccess() == RepositoryEntry.ACC_USERS_GUESTS && ureq.getUserSession().getRoles().isGuestOnly()) {
+			if(re.isAllUsers() && ureq.getUserSession().getRoles().isGuestOnly()) {
 				launchContent(ureq, security);
 			} else {
 				AccessResult acResult = acService.isAccessible(re, getIdentity(), security.isMember(), false);
 				if(acResult.isAccessible()) {
 					launchContent(ureq, security);
 				} else if (re != null
-						&& !re.getRepositoryEntryStatus().isUnpublished()
-						&& !re.getRepositoryEntryStatus().isClosed()
+						&& !re.getEntryStatus().decommissioned()
 						&& !acResult.getAvailableMethods().isEmpty()) {
 					//try auto booking
 					ACResultAndSecurity autoResult = tryAutoBooking(ureq, acResult, security);
diff --git a/src/main/java/org/olat/repository/ui/RepositoryFlexiTableModel.java b/src/main/java/org/olat/repository/ui/RepositoryFlexiTableModel.java
index a40ea260ebc..e79da6db02e 100644
--- a/src/main/java/org/olat/repository/ui/RepositoryFlexiTableModel.java
+++ b/src/main/java/org/olat/repository/ui/RepositoryFlexiTableModel.java
@@ -176,7 +176,7 @@ implements SortableFlexiTableDataModel<RepositoryEntry> {
 	}
 	
 	private Object getAccessControl(RepositoryEntry re) {
-		if (re.isMembersOnly()) {
+		if (!re.isAllUsers() && !re.isGuests()) {
 			// members only always show lock icon
 			return Collections.singletonList("o_ac_membersonly");
 		}
@@ -200,7 +200,7 @@ implements SortableFlexiTableDataModel<RepositoryEntry> {
 	 */
 	private String getDisplayName(RepositoryEntry repositoryEntry, Locale locale) {
 		String displayName = repositoryEntry.getDisplayname();
-		if (repositoryEntry.getRepositoryEntryStatus().isClosed()) {
+		if (repositoryEntry.getEntryStatus().decommissioned()) {
 			Translator pT = Util.createPackageTranslator(RepositoryEntryStatus.class, locale);
 			displayName = "[" + pT.translate("title.prefix.closed") + "] ".concat(displayName);
 		}
diff --git a/src/main/java/org/olat/repository/ui/RepositoryTableModel.java b/src/main/java/org/olat/repository/ui/RepositoryTableModel.java
index f58bc867a23..c84092548f6 100644
--- a/src/main/java/org/olat/repository/ui/RepositoryTableModel.java
+++ b/src/main/java/org/olat/repository/ui/RepositoryTableModel.java
@@ -51,7 +51,7 @@ import org.olat.core.util.Util;
 import org.olat.login.LoginModule;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryStatus;
-import org.olat.repository.RepositoryManager;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.manager.RepositoryEntryLifecycleDAO;
@@ -133,16 +133,16 @@ public class RepositoryTableModel extends DefaultTableDataModel<RepositoryEntry>
 			public int compareTo(int rowa, int rowb) {
 				Object o1 = table.getTableDataModel().getObject(rowa);
 				Object o2 = table.getTableDataModel().getObject(rowb);
-				if(o1 == null || !(o1 instanceof RepositoryEntry)) return -1;
-				if(o2 == null || !(o2 instanceof RepositoryEntry)) return 1;
+				if(!(o1 instanceof RepositoryEntry)) return -1;
+				if(!(o2 instanceof RepositoryEntry)) return 1;
 				RepositoryEntry re1 = (RepositoryEntry)o1;
 				RepositoryEntry re2 = (RepositoryEntry)o2;
 				
-				if(re1.isMembersOnly()) {
-					if(!re2.isMembersOnly()) {
+				if(!re1.isAllUsers() && !re1.isGuests()) {
+					if(re2.isAllUsers() || re2.isGuests()) {
 						return 1;
 					}
-				} else if(re2.isMembersOnly()) {
+				} else if(!re1.isAllUsers() && !re1.isGuests()) {
 					return -1;
 				}
 				
@@ -186,18 +186,18 @@ public class RepositoryTableModel extends DefaultTableDataModel<RepositoryEntry>
 				Object o1 = table.getTableDataModel().getValueAt(rowa, 1);
 				Object o2 = table.getTableDataModel().getValueAt(rowb, 1);
 				
-				if(o1 == null || !(o1 instanceof RepositoryEntry)) return -1;
-				if(o2 == null || !(o2 instanceof RepositoryEntry)) return 1;
+				if(!(o1 instanceof RepositoryEntry)) return -1;
+				if(!(o2 instanceof RepositoryEntry)) return 1;
 				RepositoryEntry re1 = (RepositoryEntry)o1;
 				RepositoryEntry re2 = (RepositoryEntry)o2;
-				boolean c1 = RepositoryManager.getInstance().createRepositoryEntryStatus(re1.getStatusCode()).isClosed();
-				boolean c2 = RepositoryManager.getInstance().createRepositoryEntryStatus(re2.getStatusCode()).isClosed();
+				boolean c1 = re1.getEntryStatus() == RepositoryEntryStatusEnum.closed;
+				boolean c2 = re2.getEntryStatus() == RepositoryEntryStatusEnum.closed;
 				int result = (c2 == c1 ? 0 : (c1 ? 1 : -1));//same as Boolean compare
 				if(result == 0) {
 					Object a = table.getTableDataModel().getValueAt(rowa, dataColumn);
 					Object b = table.getTableDataModel().getValueAt(rowb, dataColumn);
-					if(a == null || !(a instanceof String)) return -1;
-					if(b == null || !(b instanceof String)) return 1;
+					if(!(a instanceof String)) return -1;
+					if(!(b instanceof String)) return 1;
 					String s1 = (String)a;
 					String s2 = (String)b;
 					result = compareString(s1, s2);
@@ -222,16 +222,18 @@ public class RepositoryTableModel extends DefaultTableDataModel<RepositoryEntry>
 				Object o1 = table.getTableDataModel().getValueAt(rowa, 1);
 				Object o2 = table.getTableDataModel().getValueAt(rowb, 1);
 				
-				if(o1 == null || !(o1 instanceof RepositoryEntry)) return -1;
-				if(o2 == null || !(o2 instanceof RepositoryEntry)) return 1;
+				if(!(o1 instanceof RepositoryEntry)) return -1;
+				if(!(o2 instanceof RepositoryEntry)) return 1;
 				RepositoryEntry re1 = (RepositoryEntry)o1;
 				RepositoryEntry re2 = (RepositoryEntry)o2;
-				int ar1 = re1.getAccess();
-				if(re1.isMembersOnly()) {
+				
+				int ar1 = re1.getEntryStatus().ordinal();
+				if(!re1.isAllUsers() && !re1.isGuests()) {//TODO repo access
 					ar1 = 99;
 				}
-				int ar2 = re2.getAccess();
-				if(re2.isMembersOnly()) {
+				
+				int ar2 = re2.getEntryStatus().ordinal();
+				if(!re2.isAllUsers() && !re2.isGuests()) {
 					ar2 = 99;
 				}
 				if(ar1 < ar2) return -1;
@@ -271,7 +273,7 @@ public class RepositoryTableModel extends DefaultTableDataModel<RepositoryEntry>
 		RepositoryEntry re = getObject(row);
 		switch (RepoCols.values()[col]) {
 			case ac: {
-				if (re.isMembersOnly()) {
+				if (!re.isAllUsers() && !re.isGuests()) {
 					// members only always show lock icon
 					return Collections.singletonList("o_ac_membersonly");
 				}
@@ -285,24 +287,15 @@ public class RepositoryTableModel extends DefaultTableDataModel<RepositoryEntry>
 			case displayname: return getDisplayName(re, translator.getLocale());
 			case author: return getFullname(re.getInitialAuthor());
 			case access: {
-				if(re.isMembersOnly()) {
-					return translator.translate("table.header.access.membersonly"); 
+				StringBuilder sb = new StringBuilder(32);
+				sb.append(translator.translate("table.status.".concat(re.getEntryStatus().name())));
+				if(re.isAllUsers()) {
+					sb.append(translator.translate("table.allusers"));
 				}
-				switch (re.getAccess()) {
-					case RepositoryEntry.ACC_OWNERS: return translator.translate("table.header.access.owner");
-					case RepositoryEntry.ACC_OWNERS_AUTHORS: return translator.translate("table.header.access.author");
-					case RepositoryEntry.ACC_USERS: return translator.translate("table.header.access.user");
-					case RepositoryEntry.ACC_USERS_GUESTS: {
-						if(!loginModule.isGuestLoginLinksEnabled()) {
-							return translator.translate("table.header.access.user");
-						}
-						return translator.translate("table.header.access.guest");
-					}
-					default:						
-						// OLAT-6272 in case of broken repo entries with no access code
-						// return error instead of nothing
-						return "ERROR";
+				if(re.isGuests() && loginModule.isGuestLoginEnabled()) {
+					sb.append(translator.translate("table.guests"));
 				}
+				return sb.toString();
 			}
 			case creationDate: return re.getCreationDate();
 			case lastUsage: return re.getStatistics().getLastUsage();
@@ -414,7 +407,7 @@ public class RepositoryTableModel extends DefaultTableDataModel<RepositoryEntry>
 	 */
 	private String getDisplayName(RepositoryEntry repositoryEntry, Locale locale) {
 		String displayName = repositoryEntry.getDisplayname();
-		if (repositoryEntry.getRepositoryEntryStatus().isClosed()) {
+		if (repositoryEntry.getEntryStatus().decommissioned()) {
 			Translator pT = Util.createPackageTranslator(RepositoryEntryStatus.class, locale);
 			displayName = "[" + pT.translate("title.prefix.closed") + "] ".concat(displayName);
 		}
diff --git a/src/main/java/org/olat/repository/ui/RepositoyUIFactory.java b/src/main/java/org/olat/repository/ui/RepositoyUIFactory.java
index be672af7e08..2136142a62a 100644
--- a/src/main/java/org/olat/repository/ui/RepositoyUIFactory.java
+++ b/src/main/java/org/olat/repository/ui/RepositoyUIFactory.java
@@ -36,7 +36,7 @@ import org.olat.core.gui.control.generic.messages.MessageUIFactory;
 import org.olat.core.util.Util;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryShort;
-import org.olat.repository.RepositoryManager;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryModule;
 
 /**
@@ -56,8 +56,10 @@ public class RepositoyUIFactory {
 	}
 	
 	public static String getIconCssClass(RepositoryEntryShort re) {
+		if(re == null) return "";
+		
 		String iconCSSClass = "o_" + re.getResourceType().replace(".", "-");
-		if (re != null && RepositoryManager.getInstance().createRepositoryEntryStatus(re.getStatusCode()).isClosed()) {
+		if (re.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 			iconCSSClass = iconCSSClass.concat("_icon_closed");
 		} else {
 			iconCSSClass = iconCSSClass.concat("_icon");
@@ -66,8 +68,10 @@ public class RepositoyUIFactory {
 	}
 	
 	public static String getIconCssClass(RepositoryEntry re) {
+		if(re == null) return "";
+		
 		String iconCSSClass = "o_" + re.getOlatResource().getResourceableTypeName().replace(".", "-");
-		if (re != null && RepositoryManager.getInstance().createRepositoryEntryStatus(re.getStatusCode()).isClosed()) {
+		if (re.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 			iconCSSClass = iconCSSClass.concat("_icon_closed");
 		} else {
 			iconCSSClass = iconCSSClass.concat("_icon");
diff --git a/src/main/java/org/olat/repository/ui/author/AccessRenderer.java b/src/main/java/org/olat/repository/ui/author/AccessRenderer.java
index 9baf502ae5b..2f5e2c23658 100644
--- a/src/main/java/org/olat/repository/ui/author/AccessRenderer.java
+++ b/src/main/java/org/olat/repository/ui/author/AccessRenderer.java
@@ -32,6 +32,7 @@ import org.olat.core.util.Util;
 import org.olat.login.LoginModule;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryLight;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 
 /**
@@ -55,24 +56,22 @@ public class AccessRenderer implements FlexiCellRenderer {
 			int row, FlexiTableComponent source, URLBuilder ubu, Translator trans)  {
 		if(val instanceof RepositoryEntryLight) {
 			RepositoryEntryLight re = (RepositoryEntryLight)val;
-			render(sb, re.getAccess(), re.isMembersOnly());
+			render(sb, re.getEntryStatus(), re.isAllUsers(), re.isGuests());
 		} else if(val instanceof RepositoryEntry) {
 			RepositoryEntry re = (RepositoryEntry)val;
-			render(sb, re.getAccess(), re.isMembersOnly());
+			render(sb, re.getEntryStatus(), re.isAllUsers(), re.isGuests());
 		}
 	}
 	
-	private void render(StringOutput sb, int access, boolean membersOnly) {
-		if(access == RepositoryEntry.DELETED) {
+	private void render(StringOutput sb, RepositoryEntryStatusEnum status, boolean allUsers, boolean guests) {
+		if(status == RepositoryEntryStatusEnum.trash || status == RepositoryEntryStatusEnum.deleted) {
 			sb.append(translator.translate("table.header.access.deleted"));
-		} else if(membersOnly) {
+		} else if(!allUsers && !guests) {
 			sb.append(translator.translate("table.header.access.membersonly")); 
 		} else {
+			//TODO repo access
+			/*
 			switch (access) {
-				case RepositoryEntry.DELETED: {
-					sb.append(translator.translate("table.header.access.deleted"));
-					break;
-				}
 				case RepositoryEntry.ACC_OWNERS:
 					sb.append(translator.translate("table.header.access.owner"));
 					break;
@@ -94,6 +93,7 @@ public class AccessRenderer implements FlexiCellRenderer {
 					// return error instead of nothing
 					sb.append("ERROR");
 			}
+			*/
 		}
 	}
 }
diff --git a/src/main/java/org/olat/repository/ui/author/AuthorListController.java b/src/main/java/org/olat/repository/ui/author/AuthorListController.java
index de9879d4ded..f7713b939f5 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthorListController.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthorListController.java
@@ -95,6 +95,7 @@ import org.olat.course.CourseModule;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryManagedFlag;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
@@ -407,15 +408,17 @@ public class AuthorListController extends FormBasicController implements Activat
 	@Override
 	public String getRowCssClass(FlexiTableRendererType type, int pos) {
 		AuthoringEntryRow row = model.getObject(pos);
-		if(row == null || row.getAccess() == 0) {
+		if(row == null || row.getEntryStatus() == RepositoryEntryStatusEnum.trash
+				|| row.getEntryStatus() == RepositoryEntryStatusEnum.deleted) {
 			return "o_entry_deleted";
 		}
-		if(row.getRepositoryEntryStatus().isClosed()) {
+		if(row.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 			return "o_entry_closed";
 		}
-		if(row.getRepositoryEntryStatus().isUnpublished()) {
+		/*
+		if(row.getRepositoryEntryStatus().isUnpublished()) {//TODO repo unpublished
 			return "o_entry_unpublished";
-		}
+		}*/
 		return null;
 	}
 
@@ -1260,8 +1263,7 @@ public class AuthorListController extends FormBasicController implements Activat
 			
 			boolean canClose = OresHelper.isOfType(entry.getOlatResource(), CourseModule.class)
 					&& !RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.close)
-					&& !entry.getRepositoryEntryStatus().isClosed()
-					&& !entry.getRepositoryEntryStatus().isUnpublished();
+					&& !entry.getEntryStatus().decommissioned();
 			
 			if(isOwner) {
 				boolean deleteManaged = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.delete);
@@ -1269,7 +1271,7 @@ public class AuthorListController extends FormBasicController implements Activat
 					links.add("-");
 				}
 				
-				boolean closed = entry.getRepositoryEntryStatus().isClosed();
+				boolean closed = entry.getEntryStatus() == RepositoryEntryStatusEnum.closed;
 				if(closed && "CourseModule".equals(entry.getOlatResource().getResourceableTypeName())) {
 					addLink("details.override.close", "override-close", "o_icon o_icon-fw o_icon_close_resource", links);
 				} else if(canClose) {
diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEditAccessController.java b/src/main/java/org/olat/repository/ui/author/AuthoringEditAccessController.java
index 14cb837d70e..c07c36bd906 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthoringEditAccessController.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthoringEditAccessController.java
@@ -32,6 +32,7 @@ import org.olat.core.util.event.MultiUserEvent;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryAllowToLeaveOptions;
 import org.olat.repository.RepositoryEntryManagedFlag;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.controllers.EntryChangedEvent;
@@ -80,12 +81,12 @@ public class AuthoringEditAccessController extends BasicController {
 		boolean managedBookings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.bookings);
 		acCtr = new AccessConfigurationController(ureq, getWindowControl(), entry.getOlatResource(), entry.getDisplayname(), true, !managedBookings);
 		listenTo(acCtr);
-		int access = propPupForm.getAccess();
+		
 		int numOfBookingConfigs = acCtr.getNumOfBookingConfigurations();
-		if(access == RepositoryEntry.ACC_USERS || access == RepositoryEntry.ACC_USERS_GUESTS) {
+		if(propPupForm.isAllUsers() || propPupForm.isGuests()) {
 			if((!managedBookings && acModule.isEnabled()) || numOfBookingConfigs > 0) {
 				editproptabpubVC.put("accesscontrol", acCtr.getInitialComponent());
-				editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(access == RepositoryEntry.ACC_USERS_GUESTS));
+				editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(propPupForm.isGuests()));
 			}
 		}
 		putInitialPanel(editproptabpubVC);
@@ -110,24 +111,24 @@ public class AuthoringEditAccessController extends BasicController {
 		if (source == propPupForm) {
 			if (event == Event.DONE_EVENT) {
 				// inform user about inconsistent configuration: doesn't make sense to set a repositoryEntry canReference=true if it is only accessible to owners
-				if (!entry.getCanReference() && propPupForm.canReference() && (propPupForm.getAccess() < RepositoryEntry.ACC_OWNERS_AUTHORS && !propPupForm.isMembersOnly())) {					
-					showError("warn.config.reference.no.access");
-				}
-			
-				int access = propPupForm.getAccess();
+				//TODO repo access				
+				// showError("warn.config.reference.no.access");
+
 				int numOfBookingConfigs = acCtr.getNumOfBookingConfigurations();
-				entry = repositoryManager.setAccessAndProperties(entry,
-						access, propPupForm.isMembersOnly(),
+				boolean guests = propPupForm.isGuests();
+				boolean allUsers = propPupForm.isAllUsers();
+				RepositoryEntryStatusEnum status = propPupForm.getEntryStatus();
+				entry = repositoryManager.setAccessAndProperties(entry, status, allUsers, guests,
 						propPupForm.canCopy(), propPupForm.canReference(), propPupForm.canDownload());
 				if(entry == null) {
 					showWarning("repositoryentry.not.existing");
 					fireEvent(ureq, Event.CLOSE_EVENT);
 				} else {
 					boolean managedBookings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.bookings);
-					if(access == RepositoryEntry.ACC_USERS || access == RepositoryEntry.ACC_USERS_GUESTS) {
+					if(allUsers || guests) {
 						if((!managedBookings && acModule.isEnabled()) || numOfBookingConfigs > 0) {
 							editproptabpubVC.put("accesscontrol", acCtr.getInitialComponent());
-							editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(access == RepositoryEntry.ACC_USERS_GUESTS));
+							editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(guests));
 						}
 					} else {
 						editproptabpubVC.remove(acCtr.getInitialComponent());
diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java
index b27ff353859..60901d7143a 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java
@@ -25,7 +25,7 @@ import java.util.List;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiTableDataSourceModel;
 import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.handlers.EditionSupport;
 import org.olat.repository.handlers.RepositoryHandler;
 import org.olat.repository.handlers.RepositoryHandlerFactory;
@@ -128,8 +128,8 @@ class AuthoringEntryDataModel extends DefaultFlexiTableDataSourceModel<Authoring
 				if(handler.supportsEdit(item.getOLATResourceable()) == EditionSupport.no) {
 					return Boolean.FALSE;
 				}
-				RepositoryEntryStatus status = new RepositoryEntryStatus(item.getStatusCode());
-				if(status.isClosed() || status.isUnpublished()) {
+				RepositoryEntryStatusEnum status = item.getEntryStatus();
+				if(status.decommissioned()) {
 					return Boolean.FALSE;
 				}
 				return Boolean.TRUE;
diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java
index c5489f44474..12f1ba1c7c0 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java
@@ -168,7 +168,7 @@ public class AuthoringEntryDataSource implements FlexiTableDataSourceDelegate<Au
 
 			// access control
 			List<PriceMethod> types = new ArrayList<>();
-			if (entry.isMembersOnly()) {
+			if (!entry.isAllUsers() && !entry.isGuests()) {//TODO repo access
 				// members only always show lock icon
 				types.add(new PriceMethod("", "o_ac_membersonly_icon", uifactory.getTranslator().translate("cif.access.membersonly.short")));
 			} else {
diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEntryPublishController.java b/src/main/java/org/olat/repository/ui/author/AuthoringEntryPublishController.java
index 97e9f7564a5..e302168437c 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthoringEntryPublishController.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthoringEntryPublishController.java
@@ -20,7 +20,6 @@
 package org.olat.repository.ui.author;
 
 import org.olat.core.gui.UserRequest;
-import org.olat.core.gui.components.form.flexible.FormItem;
 import org.olat.core.gui.components.form.flexible.FormItemContainer;
 import org.olat.core.gui.components.form.flexible.elements.SelectionElement;
 import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
@@ -28,7 +27,6 @@ import org.olat.core.gui.components.form.flexible.elements.StaticTextElement;
 import org.olat.core.gui.components.form.flexible.elements.TextElement;
 import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
 import org.olat.core.gui.components.form.flexible.impl.FormEvent;
-import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
@@ -40,6 +38,7 @@ import org.olat.ims.qti.fileresource.TestFileResource;
 import org.olat.login.LoginModule;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryManagedFlag;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
 import org.olat.repository.handlers.RepositoryHandlerFactory;
@@ -55,6 +54,9 @@ import org.springframework.beans.factory.annotation.Autowired;
  * 
  */
 public class AuthoringEntryPublishController extends FormBasicController {
+	
+	private static final String YES_KEY = "y";
+	private static final String[] yesKeys = new String[] { YES_KEY };
 
 	private RepositoryEntry entry;
 	private StaticTextElement resourceName;
@@ -63,21 +65,13 @@ public class AuthoringEntryPublishController extends FormBasicController {
 	private SelectionElement canCopy;
 	private SelectionElement canReference;
 	private SelectionElement canDownload;
+	private SelectionElement allUsers;
+	private SelectionElement guests;
+	private SingleSelection publishedStatus;
 	
 	private RepositoryHandler handler;
-
-	private SingleSelection authorsSwitch, usersSwitch;
-	private SingleSelection publishedForUsers;
-	private FormLayoutContainer authorConfigLayout, userConfigLayout;
 	
-	private static final String YES_KEY = "y";
-	private static final String NO_KEY = "n";
-	private static final String[] yesNoKeys = new String[]{YES_KEY, NO_KEY};
-
-	private static final String OAU_KEY = "u";
-	private static final String OAUG_KEY = "g";
-	private static final String MEMBERSONLY_KEY = "m";
-	private String[] publishedKeys;
+	
 
 	@Autowired
 	private LoginModule loginModule;
@@ -99,13 +93,7 @@ public class AuthoringEntryPublishController extends FormBasicController {
 		if (typeName != null) {
 			handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(typeName);
 		}
-		
-		if (loginModule.isGuestLoginLinksEnabled()) {
-			publishedKeys = new String[]{OAU_KEY, OAUG_KEY, MEMBERSONLY_KEY};
-		} else {
-			publishedKeys = new String[]{OAU_KEY, MEMBERSONLY_KEY};
-		} 
-						
+				
 		initForm(ureq);
 	}
 
@@ -150,35 +138,20 @@ public class AuthoringEntryPublishController extends FormBasicController {
 	public boolean canDownload() {
 		return canDownload.isSelected(0);
 	}
+	
+	public boolean isAllUsers() {
+		return allUsers.isSelected(0);
+	}
+	
+	public boolean isGuests() {
+		return guests.isSelected(0);
+	}
 
 	/**
-	 * Return selected access key (ACC_OWNERS, ACC_OWNERS_AUTHORS, ACC_USERS,
-	 * ACC_USERS_GUESTS)
+	 * Return the publication status
 	 */
-	public int getAccess() {
-		// default only for owners
-		int access = RepositoryEntry.ACC_OWNERS;
-		if (authorsSwitch.getSelectedKey().equals(YES_KEY)) {
-			// raise to author level
-			access = RepositoryEntry.ACC_OWNERS_AUTHORS;
-		}
-		if (usersSwitch.getSelectedKey().equals(YES_KEY)) {
-			if (publishedForUsers.getSelectedKey().equals(OAU_KEY)) {
-				// further raise to user level
-				access = RepositoryEntry.ACC_USERS;
-			} else if (publishedForUsers.getSelectedKey().equals(OAUG_KEY)) {
-				// further raise to guest level
-				access = RepositoryEntry.ACC_USERS_GUESTS;
-			} else if (publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
-			// Members-only is either owner or owner-author level, never user level
-				access = RepositoryEntry.ACC_OWNERS;
-			}
-		}
-		return access;
-	}
-
-	public boolean isMembersOnly() {
-		return (usersSwitch.getSelectedKey().equals(YES_KEY) && publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY));
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return RepositoryEntryStatusEnum.valueOf(publishedStatus.getSelectedKey());
 	}
 
 	@Override
@@ -203,38 +176,39 @@ public class AuthoringEntryPublishController extends FormBasicController {
 		// make configuration read only when managed by external system
 		final boolean managedSettings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.settings);
 		final boolean managedAccess = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.access);
+		
+		String[] publishedKeys = new String[] {
+				RepositoryEntryStatusEnum.preparation.name(), RepositoryEntryStatusEnum.review.name(),
+				RepositoryEntryStatusEnum.coachpublished.name(), RepositoryEntryStatusEnum.published.name()
+		};
+		String[] publishedValues = new String[] {
+				translate("cif.status.preparation"), translate("cif.status.review"),
+				translate("cif.status.coachpublished"), translate("cif.status.published")
+		};
+		publishedStatus = uifactory.addDropdownSingleselect("publishedStatus", "cif.publish", formLayout, publishedKeys, publishedValues, null);
+		publishedStatus.setElementCssClass("o_sel_repositoryentry_access_publication");
+		publishedStatus.setEnabled(!managedAccess);
+		publishedStatus.addActionListener(FormEvent.ONCHANGE);
+
+		uifactory.addSpacerElement("usersSpacer", formLayout, true);
+		
+		allUsers = uifactory.addCheckboxesVertical("cif.allusers", "cif.allusers", formLayout, yesKeys, new String[] { translate("cif.release") }, 1);
+		allUsers.setElementCssClass("o_sel_repositoryentry_access_all_users");
+		allUsers.setEnabled(!managedAccess);
+		guests = uifactory.addCheckboxesVertical("cif.guests", "cif.guests", formLayout, yesKeys, new String[] { translate("cif.release") }, 1);
+		guests.setElementCssClass("o_sel_repositoryentry_access_all_users");
+		guests.setEnabled(!managedAccess);
+		guests.setVisible(loginModule.isGuestLoginEnabled());
+		
+		uifactory.addSpacerElement("authorSpacer", formLayout, true);
 
-		String[] yesNoValues = new String[]{translate("yes"), translate("no")};		
-		authorsSwitch = uifactory.addRadiosHorizontal("authorsSwitch", "rentry.publish.authors", formLayout, yesNoKeys, yesNoValues);
-		authorsSwitch.setEnabled(!managedAccess);
-		authorsSwitch.addActionListener(FormEvent.ONCHANGE);
-		authorConfigLayout = FormLayoutContainer.createBareBoneFormLayout("authorConfigLayout", getTranslator());
-		formLayout.add(authorConfigLayout);
-		canReference = uifactory.addCheckboxesVertical("cif_canReference",null, authorConfigLayout, new String[] { YES_KEY }, new String[] { translate("cif.canReference") }, 1);
+		canReference = uifactory.addCheckboxesVertical("cif_canReference", "cif.author.can", formLayout, yesKeys, new String[] { translate("cif.canReference") }, 1);
 		canReference.setEnabled(!managedSettings);
-		canCopy = uifactory.addCheckboxesVertical("cif_canCopy", null, authorConfigLayout, new String[] { YES_KEY }, new String[] { translate("cif.canCopy") }, 1);
+		canCopy = uifactory.addCheckboxesVertical("cif_canCopy", null, formLayout, yesKeys, new String[] { translate("cif.canCopy") }, 1);
 		canCopy.setEnabled(!managedSettings);
-		canDownload = uifactory.addCheckboxesVertical("cif_canDownload", null, authorConfigLayout, new String[] { YES_KEY }, new String[] { translate("cif.canDownload") }, 1);
+		canDownload = uifactory.addCheckboxesVertical("cif_canDownload", null, formLayout, yesKeys, new String[] { translate("cif.canDownload") }, 1);
 		canDownload.setEnabled(!managedSettings);
 		canDownload.setVisible(handler.supportsDownload());
-		uifactory.addSpacerElement("authorSpacer", authorConfigLayout, true);
-
-		String[] publishedValues;
-		if (loginModule.isGuestLoginLinksEnabled()) {
-			publishedValues = new String[]{translate("cif.access.users"), translate("cif.access.users_guests"), translate("cif.access.membersonly")};
-		} else {
-			publishedValues = new String[]{translate("cif.access.users"), translate("cif.access.membersonly")};
-		}
-			
-		usersSwitch = uifactory.addRadiosHorizontal("usersSwitch", "rentry.publish.users", formLayout, yesNoKeys, yesNoValues);
-		usersSwitch.addActionListener(FormEvent.ONCHANGE);
-		usersSwitch.setEnabled(!managedAccess);
-		userConfigLayout = FormLayoutContainer.createBareBoneFormLayout("userConfigLayout", getTranslator());
-		formLayout.add(userConfigLayout);
-		publishedForUsers = uifactory.addDropdownSingleselect("publishedForUsers", null, userConfigLayout, publishedKeys, publishedValues, null);
-		publishedForUsers.setEnabled(!managedAccess);
-		publishedForUsers.addActionListener(FormEvent.ONCHANGE);
-		uifactory.addSpacerElement("userSpacer", userConfigLayout, true);
 
 		if (!managedAccess || !managedSettings) {
 			uifactory.addFormSubmitButton("submit", formLayout);
@@ -248,60 +222,9 @@ public class AuthoringEntryPublishController extends FormBasicController {
 		canReference.select(YES_KEY, entry.getCanReference()); 
 		canCopy.select(YES_KEY, entry.getCanCopy()); 
 		canDownload.select(YES_KEY, entry.getCanDownload());
-		if (entry.getAccess() >= RepositoryEntry.ACC_OWNERS_AUTHORS) {
-			authorsSwitch.select(YES_KEY, true);
-		} else {
-			authorsSwitch.select(NO_KEY, true);
-			authorConfigLayout.setVisible(false);
-		}
-		// init user visibility
-		if (entry.getAccess() == RepositoryEntry.ACC_USERS) {
-			publishedForUsers.select(OAU_KEY, true);
-			usersSwitch.select(YES_KEY, true);
-		} else if (loginModule.isGuestLoginLinksEnabled() && entry.getAccess() == RepositoryEntry.ACC_USERS_GUESTS){
-			publishedForUsers.select(OAUG_KEY, true);			
-			usersSwitch.select(YES_KEY, true);
-		} else if (entry.isMembersOnly()) {
-			publishedForUsers.select(MEMBERSONLY_KEY, true);
-			usersSwitch.select(YES_KEY, true);
-			authorsSwitch.setEnabled(false);
-		} else {
-			publishedForUsers.select(OAU_KEY, true);
-			usersSwitch.select(NO_KEY, true);
-			userConfigLayout.setVisible(false);
-		}
-	}
-
-	@Override
-	protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
-		super.formInnerEvent(ureq, source, event);
-		if (source == authorsSwitch) {
-			if (authorsSwitch.getSelectedKey().equals(YES_KEY)) {			
-				authorConfigLayout.setVisible(true);
-			} else {
-				authorConfigLayout.setVisible(false);
-				if (!publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
-					usersSwitch.select(NO_KEY, false);
-					userConfigLayout.setVisible(false);
-				}
-			}
-		} else if (source == usersSwitch || source == publishedForUsers) {
-			if (usersSwitch.getSelectedKey().equals(YES_KEY)) {			
-				userConfigLayout.setVisible(true);
-				if (publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
-					authorConfigLayout.setVisible(false);
-					authorsSwitch.select(NO_KEY, true);
-					authorsSwitch.setEnabled(false);
-				} else {
-					authorsSwitch.select(YES_KEY, true);
-					authorsSwitch.setEnabled(true);
-					authorConfigLayout.setVisible(true);
-				}
-			} else {
-				userConfigLayout.setVisible(false);
-				authorsSwitch.setEnabled(true);
-			}
-		}
+		allUsers.select(YES_KEY, entry.isAllUsers());
+		guests.select(YES_KEY, entry.isGuests());
+		publishedStatus.select(entry.getEntryStatus().name(), true);
 	}
 	
 	@Override
diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEntryRow.java b/src/main/java/org/olat/repository/ui/author/AuthoringEntryRow.java
index 6e1e1245161..eafee6a3d50 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthoringEntryRow.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthoringEntryRow.java
@@ -31,7 +31,7 @@ import org.olat.repository.RepositoryEntryAuthorView;
 import org.olat.repository.RepositoryEntryLight;
 import org.olat.repository.RepositoryEntryManagedFlag;
 import org.olat.repository.RepositoryEntryRef;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 import org.olat.repository.ui.PriceMethod;
 
@@ -52,9 +52,9 @@ public class AuthoringEntryRow implements RepositoryEntryRef, RepositoryEntryLig
 	private final String location;
 	private final String shortenedDescription;
 	
-	private final boolean membersOnly;
-	private final int access;
-	private final int statusCode;
+	private RepositoryEntryStatusEnum status;
+	private final boolean allUsers;
+	private final boolean guests;
 
 	private final Date lastUsage;
 	private final Date creationDate;
@@ -109,9 +109,9 @@ public class AuthoringEntryRow implements RepositoryEntryRef, RepositoryEntryLig
 		managed = view.getManagedFlags() != null && view.getManagedFlags().length > 0;
 		managedFlags = view.getManagedFlags();
 		
-		membersOnly = view.isMembersOnly();
-		access = view.getAccess();
-		statusCode = view.getStatusCode();
+		status = view.getEntryStatus();
+		allUsers = view.isAllUsers();
+		guests = view.isGuests();
 		
 		olatResource = OresHelper.clone(view.getOlatResource());
 		
@@ -145,22 +145,18 @@ public class AuthoringEntryRow implements RepositoryEntryRef, RepositoryEntryLig
 	}
 	
 	@Override
-	public int getStatusCode() {
-		return statusCode;
-	}
-	
-	public RepositoryEntryStatus getRepositoryEntryStatus() {
-		return new RepositoryEntryStatus(statusCode);
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return status;
 	}
 
 	@Override
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
 	@Override
-	public int getAccess() {
-		return access;
+	public boolean isGuests() {
+		return guests;
 	}
 
 	public Date getLastUsage() {
diff --git a/src/main/java/org/olat/repository/ui/author/TypeRenderer.java b/src/main/java/org/olat/repository/ui/author/TypeRenderer.java
index eed923cf9c1..640dd8f5c57 100644
--- a/src/main/java/org/olat/repository/ui/author/TypeRenderer.java
+++ b/src/main/java/org/olat/repository/ui/author/TypeRenderer.java
@@ -30,6 +30,7 @@ import org.olat.core.gui.translator.Translator;
 import org.olat.core.util.StringHelper;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryShort;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.ui.RepositoyUIFactory;
 
 /**
@@ -60,12 +61,12 @@ public class TypeRenderer implements FlexiCellRenderer {
 		
 		String cssClass = "";
 		boolean managed = false;
-		int access = -1;
+		RepositoryEntryStatusEnum status = null;
 		if(cellValue instanceof AuthoringEntryRow) {
 			AuthoringEntryRow re = (AuthoringEntryRow) cellValue;
 			cssClass = RepositoyUIFactory.getIconCssClass(re);
 			managed = re.isManaged();
-			access = re.getAccess();
+			status = re.getEntryStatus();
 		} else if (cellValue instanceof RepositoryEntryShort) {
 			RepositoryEntryShort re = (RepositoryEntryShort) cellValue;
 			cssClass = RepositoyUIFactory.getIconCssClass(re);
@@ -73,7 +74,7 @@ public class TypeRenderer implements FlexiCellRenderer {
 			RepositoryEntry re = (RepositoryEntry) cellValue;
 			cssClass = RepositoyUIFactory.getIconCssClass(re);
 			managed = StringHelper.containsNonWhitespace(re.getManagedFlagsString());
-			access = re.getStatusCode();
+			status = re.getEntryStatus();
 		}
 		
 		if(renderer == null) {
@@ -85,7 +86,7 @@ public class TypeRenderer implements FlexiCellRenderer {
 			if (managed) {
 				target.append(" <i class='o_icon o_icon_managed' title=\"").append(translator.translate("cif.managedflags")).append("\"> </i> ");
 			}
-			if (access == 0) {
+			if (status == null || status == RepositoryEntryStatusEnum.trash || status == RepositoryEntryStatusEnum.deleted) {
 				target.append(" <i class='o_icon o_icon-lg o_icon_deleted'> </i> ");
 			}
 			target.append("</div>");
diff --git a/src/main/java/org/olat/repository/ui/author/wizard/UnpublishResourceCallback.java b/src/main/java/org/olat/repository/ui/author/wizard/UnpublishResourceCallback.java
index e87acc8c4a8..0b1776e1d0f 100644
--- a/src/main/java/org/olat/repository/ui/author/wizard/UnpublishResourceCallback.java
+++ b/src/main/java/org/olat/repository/ui/author/wizard/UnpublishResourceCallback.java
@@ -52,7 +52,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.manager.CatalogManager;
 
@@ -118,7 +118,8 @@ public class UnpublishResourceCallback implements StepRunnerCallback {
 
 		//update status
 		repositoryEntry = repositoryService.loadByKey(repositoryEntry.getKey());
-		repositoryEntry.setStatusCode(RepositoryEntryStatus.REPOSITORY_STATUS_CLOSED);
+		//TODO repo access unpublish
+		repositoryEntry.setEntryStatus(RepositoryEntryStatusEnum.closed);
 		repositoryEntry = DBFactory.getInstance().getCurrentEntityManager().merge(repositoryEntry);
 
 		// clean catalog
diff --git a/src/main/java/org/olat/repository/ui/catalog/CatalogEntryRow.java b/src/main/java/org/olat/repository/ui/catalog/CatalogEntryRow.java
index 0ae374e35fe..ea5e7538871 100644
--- a/src/main/java/org/olat/repository/ui/catalog/CatalogEntryRow.java
+++ b/src/main/java/org/olat/repository/ui/catalog/CatalogEntryRow.java
@@ -29,6 +29,7 @@ import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryLight;
 import org.olat.repository.RepositoryEntryManagedFlag;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 import org.olat.repository.ui.PriceMethod;
 
@@ -45,9 +46,9 @@ public class CatalogEntryRow implements RepositoryEntryRef, RepositoryEntryLight
 	private String authors;
 	private String shortenedDescription;
 	
-	private boolean membersOnly;
-	private int access;
-	private int statusCode;
+	private boolean allUsers;
+	private boolean guests;
+	private RepositoryEntryStatusEnum status;
 
 	private Date creationDate;
 	
@@ -88,9 +89,9 @@ public class CatalogEntryRow implements RepositoryEntryRef, RepositoryEntryLight
 		managed = view.getManagedFlags() != null && view.getManagedFlags().length > 0;
 		managedFlags = view.getManagedFlags();
 		
-		membersOnly = view.isMembersOnly();
-		access = view.getAccess();
-		statusCode = view.getStatusCode();
+		status = view.getEntryStatus();
+		allUsers = view.isAllUsers();
+		guests = view.isGuests();
 		
 		olatResource = OresHelper.clone(view.getOlatResource());
 		
@@ -119,18 +120,18 @@ public class CatalogEntryRow implements RepositoryEntryRef, RepositoryEntryLight
 	}
 	
 	@Override
-	public int getStatusCode() {
-		return statusCode;
+	public RepositoryEntryStatusEnum getEntryStatus() {
+		return status;
 	}
 
 	@Override
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
 	@Override
-	public int getAccess() {
-		return access;
+	public boolean isGuests() {
+		return guests;
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/ui/catalog/CatalogNodeManagerController.java b/src/main/java/org/olat/repository/ui/catalog/CatalogNodeManagerController.java
index a7b8d976cd4..41d3c2654ae 100644
--- a/src/main/java/org/olat/repository/ui/catalog/CatalogNodeManagerController.java
+++ b/src/main/java/org/olat/repository/ui/catalog/CatalogNodeManagerController.java
@@ -80,6 +80,7 @@ import org.olat.repository.CatalogEntry;
 import org.olat.repository.CatalogEntry.Style;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
@@ -294,8 +295,8 @@ public class CatalogNodeManagerController extends FormBasicController implements
 		List<CatalogEntryRow> closedItems = new ArrayList<>();
 		for(RepositoryEntry entry:repoEntries) {
 			CatalogEntryRow row = new CatalogEntryRow(entry);
-			List<PriceMethod> types = new ArrayList<PriceMethod>();
-			if (entry.isMembersOnly()) {
+			List<PriceMethod> types = new ArrayList<>();
+			if (!entry.isAllUsers() && !entry.isGuests()) {
 				// members only always show lock icon
 				types.add(new PriceMethod("", "o_ac_membersonly_icon", translate("cif.access.membersonly.short")));
 			} else {
@@ -318,7 +319,7 @@ public class CatalogNodeManagerController extends FormBasicController implements
 				row.setAccessTypes(types);
 			}
 			
-			if(entry.getRepositoryEntryStatus().isClosed()) {
+			if(entry.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 				closedItems.add(row);
 			} else {
 				items.add(row);
diff --git a/src/main/java/org/olat/repository/ui/list/DefaultRepositoryEntryDataSource.java b/src/main/java/org/olat/repository/ui/list/DefaultRepositoryEntryDataSource.java
index 2385426ba59..38c7a55ec62 100644
--- a/src/main/java/org/olat/repository/ui/list/DefaultRepositoryEntryDataSource.java
+++ b/src/main/java/org/olat/repository/ui/list/DefaultRepositoryEntryDataSource.java
@@ -160,7 +160,7 @@ public class DefaultRepositoryEntryDataSource implements FlexiTableDataSourceDel
 			}
 
 			List<PriceMethod> types = new ArrayList<>();
-			if (entry.isMembersOnly()) {
+			if (!entry.isAllUsers() && !entry.isGuests()) {
 				// members only always show lock icon
 				types.add(new PriceMethod("", "o_ac_membersonly_icon", uifactory.getTranslator().translate("cif.access.membersonly.short")));
 			} else {
diff --git a/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java b/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java
index 28cdb8ddc5b..1b4c2e022d9 100644
--- a/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java
+++ b/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java
@@ -218,7 +218,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 			layoutCont.contextPut("guestOnly", Boolean.valueOf(guestOnly));
 			String cssClass = RepositoyUIFactory.getIconCssClass(entry);
 			layoutCont.contextPut("cssClass", cssClass);
-			boolean closed = entry.getRepositoryEntryStatus().isClosed() || entry.getRepositoryEntryStatus().isUnpublished();
+			boolean closed = entry.getEntryStatus().decommissioned();
 			layoutCont.contextPut("closed", Boolean.valueOf(closed));
 			
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(entry);
@@ -330,7 +330,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 			//access control
 			String accessI18n = null;
 			List<PriceMethod> types = new ArrayList<>();
-			if (entry.isMembersOnly()) {
+			if (!entry.isAllUsers() && !entry.isGuests()) {
 				// members only
 				if(isMember) {
 					String linkText = translate("start.with.type", translate(entry.getOlatResource().getResourceableTypeName()));
@@ -338,7 +338,6 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 					startLink.setElementCssClass("o_start btn-block");
 					startLink.setIconRightCSS("o_icon o_icon_start o_icon-lg");
 					startLink.setPrimary(true);
-
 				}
 				accessI18n = translate("cif.access.membersonly");
 			} else {
@@ -347,7 +346,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 					String linkText = translate("start.with.type", translate(entry.getOlatResource().getResourceableTypeName()));
 					startLink = uifactory.addFormLink("start", "start", linkText, null, layoutCont, Link.BUTTON_LARGE + Link.NONTRANSLATED);
 					startLink.setElementCssClass("o_start btn-block");
-				} else if (acResult.getAvailableMethods().size() > 0) {
+				} else if (!acResult.getAvailableMethods().isEmpty()) {
 					for(OfferAccess access:acResult.getAvailableMethods()) {
 						AccessMethod method = access.getMethod();
 						String type = (method.getMethodCssClass() + "_icon").intern();
@@ -363,11 +362,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 					startLink.setCustomEnabledLinkCSS("btn btn-success"); // custom style
 					startLink.setElementCssClass("o_book btn-block");
 					if(guestOnly) {
-						if(entry.getAccess() == RepositoryEntry.ACC_USERS_GUESTS) {
-							startLink.setVisible(true);
-						} else {
-							startLink.setVisible(false);
-						}
+						startLink.setVisible(entry.isGuests());
 					} else {
 						startLink.setVisible(true);
 					}
@@ -380,19 +375,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 				startLink.setIconRightCSS("o_icon o_icon_start o_icon-lg");
 				startLink.setPrimary(true);
 				startLink.setFocus(true);
-				
-				switch (entry.getAccess()) {
-					case 0: accessI18n = "ERROR";
-						break;
-					case 1: accessI18n = translate("cif.access.owners");			
-						break;
-					case 2: accessI18n = translate("cif.access.owners_authors");
-						break;
-					case 3: accessI18n = translate("cif.access.users");
-						break;
-					case 4: accessI18n = translate("cif.access.users_guests");
-						break;
-				}
+				accessI18n = translate("cif.access.".concat(entry.getEntryStatus().name()));
 			}
 			layoutCont.contextPut("accessI18n", accessI18n);
 			
@@ -476,13 +459,11 @@ public class RepositoryEntryDetailsController extends FormBasicController {
             // Link to bookmark entry
             String url = Settings.getServerContextPathURI() + "/url/RepositoryEntry/" + entry.getKey();
             layoutCont.contextPut("extlink", url);
-            Boolean guestAllowed = (entry.getAccess() >= RepositoryEntry.ACC_USERS_GUESTS && loginModule.isGuestLoginLinksEnabled())
-            		? Boolean.TRUE : Boolean.FALSE;
+            Boolean guestAllowed = Boolean.valueOf(entry.isGuests() && loginModule.isGuestLoginLinksEnabled());
             layoutCont.contextPut("isGuestAllowed", guestAllowed);
 
-
 			//Owners
-			List<String> authorLinkNames = new ArrayList<String>(authorKeys.size());
+			List<String> authorLinkNames = new ArrayList<>(authorKeys.size());
 			Map<Long,String> authorNames = userManager.getUserDisplayNamesByKey(authorKeys);
 			int counter = 0;
 			for(Map.Entry<Long, String> author:authorNames.entrySet()) {
diff --git a/src/main/java/org/olat/repository/ui/list/RepositoryEntryListController.java b/src/main/java/org/olat/repository/ui/list/RepositoryEntryListController.java
index 6365ddce60e..598a2b42e8c 100644
--- a/src/main/java/org/olat/repository/ui/list/RepositoryEntryListController.java
+++ b/src/main/java/org/olat/repository/ui/list/RepositoryEntryListController.java
@@ -590,17 +590,17 @@ public class RepositoryEntryListController extends FormBasicController
 	public void forgeStartLink(RepositoryEntryRow row) {
 		String label;
 		boolean isStart = true;
-		if(!row.isMembersOnly() && row.getAccessTypes() != null && !row.getAccessTypes().isEmpty() && !row.isMember()) {
-			if(guestOnly) {
+		if((row.isAllUsers() || row.isGuests()) && row.getAccessTypes() != null && !row.getAccessTypes().isEmpty() && !row.isMember()) {
+			/*if(guestOnly) {
 				if(row.getAccess() == RepositoryEntry.ACC_USERS_GUESTS) {
 					label = "start";
 				} else {
 					return;
 				}
-			} else {
+			} else {*/ //TODO repo access
 				label = "book";
 				isStart = false;
-			}
+			//}
 		} else {
 			label = "start";
 		}
diff --git a/src/main/java/org/olat/repository/ui/list/RepositoryEntryRow.java b/src/main/java/org/olat/repository/ui/list/RepositoryEntryRow.java
index b3c3ad5d2ef..fc9c51d2a59 100644
--- a/src/main/java/org/olat/repository/ui/list/RepositoryEntryRow.java
+++ b/src/main/java/org/olat/repository/ui/list/RepositoryEntryRow.java
@@ -31,7 +31,7 @@ import org.olat.core.util.resource.OresHelper;
 import org.olat.course.assessment.AssessmentHelper;
 import org.olat.repository.RepositoryEntryMyView;
 import org.olat.repository.RepositoryEntryRef;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 import org.olat.repository.ui.PriceMethod;
 
@@ -55,12 +55,12 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
 	private final String expenditureOfWork;
 	private String thumbnailRelPath;
 	private final String shortenedDescription;
-	private final int access;
-	private final int statusCode;
+	private final RepositoryEntryStatusEnum status;
+	private final boolean allUsers;
+	private final boolean guests;
 	
 	private final String score;
 	private final Boolean passed;
-	private final boolean isMembersOnly;
 	
 	private boolean member;
 	
@@ -107,9 +107,9 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
 		location = entry.getLocation();
 		expenditureOfWork = entry.getExpenditureOfWork();
 		launchCounter = entry.getLaunchCounter();
-		isMembersOnly = entry.isMembersOnly();
-		access = entry.getAccess();
-		statusCode = entry.getStatusCode();
+		status = entry.getEntryStatus();
+		allUsers = entry.isAllUsers();
+		guests = entry.isGuests();
 		
 		//bookmark
 		setMarked(entry.isMarked());
@@ -135,11 +135,8 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
 			}
 		}
 	}
-
-	public boolean isMembersOnly() {
-		return isMembersOnly;
-	}
 	
+	@Override
 	public Long getKey() {
 		return key;
 	}
@@ -149,15 +146,19 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
 	}
 
 	public boolean isClosed() {
-		return new RepositoryEntryStatus(statusCode).isClosed() || new RepositoryEntryStatus(statusCode).isUnpublished() ;
+		return status.decommissioned();
 	}
 
-	public int getAccess() {
-		return access;
+	public RepositoryEntryStatusEnum getStatus() {
+		return status;
 	}
-
-	public int getStatusCode() {
-		return statusCode;
+	
+	public boolean isAllUsers() {
+		return allUsers;
+	}
+	
+	public boolean isGuests() {
+		return guests;
 	}
 
 	public String getExternalId() {
diff --git a/src/main/java/org/olat/repository/ui/list/_content/details.html b/src/main/java/org/olat/repository/ui/list/_content/details.html
index 4b8ecd0f689..e17611abb69 100644
--- a/src/main/java/org/olat/repository/ui/list/_content/details.html
+++ b/src/main/java/org/olat/repository/ui/list/_content/details.html
@@ -234,7 +234,7 @@
 				<div id="collapseInfo" class="panel-collapse collapse">
 					<table class="table table-condensed table-striped"><tbody>
 						<tr><th>$r.translate("cif.id")</th><td>$v.getKey()</td></tr>
-						#if ($roles.isOLATAdmin())		
+						#if ($roles.isAdministrator() || $roles.isLearnResourceManager())		
 						<tr><th>$r.translate("cif.ores_id")</th><td>$v.getOlatResource().getResourceableId()</td></tr>
 						<tr><th>$r.translate("cif.softkey")</th><td>$r.escapeHtml($v.getSoftkey())</td></tr>
 						#end
@@ -247,7 +247,7 @@
 						<tr><th>$r.translate("orderby.creationDate")</th><td>$r.formatDateAndTime($v.getCreationDate())</td></tr>
 						<tr><th>$r.translate("orderby.lastModified")</th><td>$r.formatDateAndTime($v.getLastModified())</td></tr>
 						
-						#if ($isEntryAuthor || $roles.isOLATAdmin() || $roles.isAuthor() || $roles.isInstitutionalResourceManager())		
+						#if ($isEntryAuthor || $roles.isAdministrator() || $roles.isAuthor() || $roles.isLearnResourceManager())		
 						<tr><th>$r.translate("cif.access")</th><td>$accessI18n</td></tr>
 						<tr><th>$r.translate("cif.initialAuthor")</th><td>$r.escapeHtml($v.getInitialAuthor())</td></tr>
 						<tr>
diff --git a/src/main/java/org/olat/restapi/repository/RepositoryEntriesWebService.java b/src/main/java/org/olat/restapi/repository/RepositoryEntriesWebService.java
index 51ebe561816..e228c0c6230 100644
--- a/src/main/java/org/olat/restapi/repository/RepositoryEntriesWebService.java
+++ b/src/main/java/org/olat/restapi/repository/RepositoryEntriesWebService.java
@@ -68,11 +68,13 @@ import org.olat.core.util.StringHelper;
 import org.olat.core.util.i18n.I18nModule;
 import org.olat.fileresource.types.ResourceEvaluation;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
 import org.olat.repository.handlers.RepositoryHandlerFactory;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
+import org.olat.restapi.security.RestSecurityHelper;
 import org.olat.restapi.support.MediaTypeVariants;
 import org.olat.restapi.support.MultipartReader;
 import org.olat.restapi.support.vo.RepositoryEntryVO;
@@ -322,8 +324,25 @@ public class RepositoryEntriesWebService {
 			File tmpFile = partsReader.getFile();
 			long length = tmpFile.length();
 			if(length > 0) {
+				boolean guests = false;
+				boolean allUsers = false;
+				RepositoryEntryStatusEnum status = RepositoryEntryStatusEnum.preparation;
+				
 				Long accessRaw = partsReader.getLongValue("access");
-				int access = accessRaw != null ? accessRaw.intValue() : RepositoryEntry.ACC_OWNERS;
+				String statusRaw = partsReader.getValue("status");
+				String allUsersRaw = partsReader.getValue("allUsers");
+				String guestsRaw = partsReader.getValue("guests");
+				
+				if(RepositoryEntryStatusEnum.isValid(statusRaw)) {
+					status = RepositoryEntryStatusEnum.valueOf(statusRaw);
+					allUsers = "true".equals(allUsersRaw);
+					guests = "true".equals(guestsRaw);
+				} else if(accessRaw != null) {
+					status = RestSecurityHelper.convertToEntryStatus(accessRaw.intValue(), false);
+					allUsers = accessRaw.longValue() >= 3;
+					guests = accessRaw.longValue() >= 4;
+				}
+
 				String softkey = partsReader.getValue("softkey");
 				String resourcename = partsReader.getValue("resourcename");
 				String displayname = partsReader.getValue("displayname");	
@@ -339,7 +358,7 @@ public class RepositoryEntriesWebService {
 						OrganisationRoles.administrator, OrganisationRoles.learnresourcemanager,
 						OrganisationRoles.author);
 				if(hasAdminRights) {
-					RepositoryEntry re = importFileResource(identity, tmpFile, resourcename, displayname, softkey, access, organisation);
+					RepositoryEntry re = importFileResource(identity, tmpFile, resourcename, displayname, softkey, status, allUsers, guests, organisation);
 					RepositoryEntryVO vo = RepositoryEntryVO.valueOf(re);
 					return Response.ok(vo).build();
 				} else {
@@ -356,7 +375,7 @@ public class RepositoryEntriesWebService {
 	}
 	
 	private RepositoryEntry importFileResource(Identity identity, File fResource, String resourcename,
-			String displayname, String softkey, int access, Organisation organisation) {
+			String displayname, String softkey, RepositoryEntryStatusEnum status, boolean allUsers, boolean guests, Organisation organisation) {
 		try {
 			RepositoryHandler handler = null;
 			for(String type:handlerFactory.getSupportedTypes()) {
@@ -381,11 +400,9 @@ public class RepositoryEntriesWebService {
 				if(StringHelper.containsNonWhitespace(softkey)) {
 					addedEntry.setSoftkey(softkey);
 				}
-				if(access < RepositoryEntry.ACC_OWNERS || access > RepositoryEntry.ACC_USERS_GUESTS) {
-					addedEntry.setAccess(RepositoryEntry.ACC_OWNERS);
-				} else {
-					addedEntry.setAccess(access);
-				}
+				addedEntry.setEntryStatus(status);
+				addedEntry.setAllUsers(allUsers);
+				addedEntry.setGuests(guests);
 				addedEntry = repositoryService.update(addedEntry);
 			}
 			return addedEntry;
diff --git a/src/main/java/org/olat/restapi/repository/RepositoryEntryWebService.java b/src/main/java/org/olat/restapi/repository/RepositoryEntryWebService.java
index 1140b9e10d8..eea6906b04c 100644
--- a/src/main/java/org/olat/restapi/repository/RepositoryEntryWebService.java
+++ b/src/main/java/org/olat/restapi/repository/RepositoryEntryWebService.java
@@ -85,6 +85,7 @@ import org.olat.modules.taxonomy.restapi.TaxonomyLevelVO;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
@@ -745,7 +746,7 @@ public class RepositoryEntryWebService {
 	@POST
 	@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
 	@Path("status")
-	public Response deleteCoursePermanently(@FormParam("newStatus") String newStatus, @Context HttpServletRequest request) {
+	public Response postStatus(@FormParam("newStatus") String newStatus, @Context HttpServletRequest request) {
 		if (!isAuthorEditor(request)) {
 			return Response.serverError().status(Status.UNAUTHORIZED).build();
 		}
@@ -802,7 +803,11 @@ public class RepositoryEntryWebService {
 		if(accessVo.getRepoEntryKey() != null && !accessVo.getRepoEntryKey().equals(entry.getKey())) {
 			return Response.serverError().status(Status.BAD_REQUEST).build();
 		}
-		entry = repositoryManager.setAccess(entry, accessVo.getAccess(), accessVo.isMembersOnly());
+		
+		boolean guests = accessVo.isGuests();
+		boolean allUsers = accessVo.isAllUsers();
+		RepositoryEntryStatusEnum status = RepositoryEntryStatusEnum.valueOf(accessVo.getStatus());
+		entry = repositoryManager.setAccess(entry, status, allUsers, guests);
 		return Response.ok(RepositoryEntryAccessVO.valueOf(entry)).build();
 	}
 	
diff --git a/src/main/java/org/olat/restapi/repository/course/CourseWebService.java b/src/main/java/org/olat/restapi/repository/course/CourseWebService.java
index f90271e3455..b6e1fa8e9cf 100644
--- a/src/main/java/org/olat/restapi/repository/course/CourseWebService.java
+++ b/src/main/java/org/olat/restapi/repository/course/CourseWebService.java
@@ -83,6 +83,7 @@ import org.olat.modules.vitero.restapi.ViteroBookingWebService;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
@@ -91,6 +92,7 @@ import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
 import org.olat.resource.accesscontrol.ACService;
 import org.olat.resource.accesscontrol.AccessResult;
+import org.olat.restapi.security.RestSecurityHelper;
 import org.olat.restapi.support.ObjectFactory;
 import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.restapi.support.vo.CourseVO;
@@ -216,15 +218,28 @@ public class CourseWebService {
 	@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
 	public Response publishCourse(@QueryParam("locale") Locale locale,
 			@QueryParam("access") Integer access, @QueryParam("membersOnly") Boolean membersOnly,
+			@QueryParam("status") String status, @QueryParam("allUsers") Boolean allUsers, @QueryParam("guests") Boolean guests,
 			@Context HttpServletRequest request) {
 		UserRequest ureq = getUserRequest(request);
 		if (!isManager(request)) {
 			return Response.serverError().status(Status.UNAUTHORIZED).build();
 		}
 		
-		int newAccess = access == null ? RepositoryEntry.ACC_USERS : access.intValue();
-		boolean members = membersOnly != null && membersOnly.booleanValue();
-		CourseFactory.publishCourse(course, newAccess, members, ureq.getIdentity(), locale);
+		boolean accessGuests = false;
+		boolean accessAllUsers = false;
+		RepositoryEntryStatusEnum accessStatus = RepositoryEntryStatusEnum.preparation;
+		if(RepositoryEntryStatusEnum.isValid(status)) {
+			accessStatus = RepositoryEntryStatusEnum.valueOf(status);
+			accessAllUsers = allUsers != null && allUsers.booleanValue();
+			accessGuests = guests != null && guests.booleanValue();
+		} else if(access != null) {
+			boolean members = membersOnly != null && membersOnly.booleanValue();
+			accessStatus = RestSecurityHelper.convertToEntryStatus(access.intValue(), members);
+			accessAllUsers = access.longValue() >= 3;
+			accessGuests = access.longValue() >= 4;
+		}
+
+		CourseFactory.publishCourse(course, accessStatus, accessAllUsers, accessGuests, ureq.getIdentity(), locale);
 		CourseVO vo = ObjectFactory.get(course);
 		return Response.ok(vo).build();
 	}
diff --git a/src/main/java/org/olat/restapi/repository/course/CoursesWebService.java b/src/main/java/org/olat/restapi/repository/course/CoursesWebService.java
index bf333d3de11..9da142e1872 100644
--- a/src/main/java/org/olat/restapi/repository/course/CoursesWebService.java
+++ b/src/main/java/org/olat/restapi/repository/course/CoursesWebService.java
@@ -73,6 +73,7 @@ import org.olat.course.tree.CourseEditorTreeNode;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryAllowToLeaveOptions;
 import org.olat.repository.RepositoryEntryManagedFlag;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
@@ -249,7 +250,9 @@ public class CoursesWebService {
 	@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
 	public Response createEmptyCourse(@QueryParam("shortTitle") String shortTitle, @QueryParam("title") String title,
 			@QueryParam("displayName") String displayName, @QueryParam("description") String description,
-			@QueryParam("softKey") String softKey, @QueryParam("access") Integer access, @QueryParam("membersOnly") Boolean membersOnly,
+			@QueryParam("softKey") String softKey, @QueryParam("status") String status,
+			@QueryParam("allUsers") Boolean allUsers, @QueryParam("guests") Boolean guests,
+			@QueryParam("access") Integer access, @QueryParam("membersOnly") Boolean membersOnly,
 			@QueryParam("externalId") String externalId, @QueryParam("externalRef") String externalRef,
 			@QueryParam("authors") String authors, @QueryParam("location") String location,
 			@QueryParam("managedFlags") String managedFlags, @QueryParam("sharedFolderSoftKey") String sharedFolderSoftKey,
@@ -261,9 +264,21 @@ public class CoursesWebService {
 		}
 		CourseConfigVO configVO = new CourseConfigVO();
 		configVO.setSharedFolderSoftKey(sharedFolderSoftKey);
-
-		int accessInt = (access == null ? RepositoryEntry.ACC_OWNERS : access.intValue());
-		boolean membersOnlyBool = membersOnly != null && membersOnly.booleanValue();
+		
+		boolean accessGuests = false;
+		boolean accessAllUsers = false;
+		RepositoryEntryStatusEnum accessStatus = RepositoryEntryStatusEnum.preparation;
+		if(StringHelper.containsNonWhitespace(status) && RepositoryEntryStatusEnum.isValid(status)) {
+			accessStatus = RepositoryEntryStatusEnum.valueOf(status);
+			accessAllUsers = allUsers != null && allUsers.booleanValue();
+			accessGuests = guests != null && guests.booleanValue();
+		} else if(access != null) {
+			boolean accessMembersOnly = membersOnly != null && membersOnly.booleanValue();
+			accessStatus = RestSecurityHelper.convertToEntryStatus(access.intValue(), accessMembersOnly);
+			accessAllUsers = access.intValue() >= 3;
+			accessGuests = access.intValue() >= 4;
+		}
+		
 		if(!StringHelper.containsNonWhitespace(displayName)) {
 			displayName = shortTitle;
 		}
@@ -282,11 +297,12 @@ public class CoursesWebService {
 
 		if(copyFrom != null) {
 			course = copyCourse(copyFrom, ureq, id, shortTitle, title, displayName, description, softKey,
-					accessInt, membersOnlyBool, organisationKey,
+					accessStatus, accessAllUsers, accessGuests, organisationKey,
 					authors, location, externalId, externalRef, managedFlags, configVO);
 		} else {
 			course = createEmptyCourse(id, shortTitle, title, displayName, description, softKey,
-					accessInt, membersOnlyBool, organisationKey, authors, location, externalId, externalRef, managedFlags, configVO);
+					accessStatus, accessAllUsers, accessGuests, organisationKey,
+					authors, location, externalId, externalRef, managedFlags, configVO);
 		}
 		if(course == null) {
 			return Response.serverError().status(Status.NOT_FOUND).build();
@@ -319,7 +335,7 @@ public class CoursesWebService {
 		CourseConfigVO configVO = new CourseConfigVO();
 		ICourse course = createEmptyCourse(ureq.getIdentity(),
 				courseVo.getTitle(), courseVo.getTitle(), courseVo.getTitle(), courseVo.getDescription(),
-				courseVo.getSoftKey(), RepositoryEntry.ACC_OWNERS, false, courseVo.getOrganisationKey(),
+				courseVo.getSoftKey(), RepositoryEntryStatusEnum.preparation, false, false, courseVo.getOrganisationKey(),
 				courseVo.getAuthors(), courseVo.getLocation(),
 				courseVo.getExternalId(), courseVo.getExternalRef(), courseVo.getManagedFlags(),
 				configVO);
@@ -366,9 +382,25 @@ public class CoursesWebService {
 			long length = tmpFile.length();
 			if(length > 0) {
 				Long accessRaw = partsReader.getLongValue("access");
-				int access = accessRaw != null ? accessRaw.intValue() : RepositoryEntry.ACC_OWNERS;
-				String membersOnlyRaw = partsReader.getValue("membersOnly");
-				boolean membersonly = "true".equals(membersOnlyRaw);
+				String statusRaw = partsReader.getValue("status");
+				String allUsersRaw = partsReader.getValue("allUsers");
+				String guestsRaw = partsReader.getValue("guests");
+
+				boolean accessGuests = false;
+				boolean accessAllUsers = false;
+				RepositoryEntryStatusEnum accessStatus = RepositoryEntryStatusEnum.preparation;
+				if(StringHelper.containsNonWhitespace(statusRaw) && RepositoryEntryStatusEnum.isValid(statusRaw)) {
+					accessStatus = RepositoryEntryStatusEnum.valueOf(statusRaw);
+					accessAllUsers = "true".equals(allUsersRaw);
+					accessGuests = "true".equals(guestsRaw);
+				} else if(accessRaw != null) {
+					String membersOnlyRaw = partsReader.getValue("membersOnly");
+					boolean membersonly = "true".equals(membersOnlyRaw);
+					accessStatus = RestSecurityHelper.convertToEntryStatus(accessRaw.intValue(), membersonly);
+					accessAllUsers = accessRaw.intValue() >= 3;
+					accessGuests = accessRaw.intValue() >= 4;
+				}
+			
 				String softKey = partsReader.getValue("softkey");
 				String displayName = partsReader.getValue("displayname");
 				String organisation = partsReader.getValue("organisationkey");
@@ -377,7 +409,8 @@ public class CoursesWebService {
 					organisationKey = Long.valueOf(organisation);
 				}
 				
-				ICourse course = importCourse(ureq, identity, tmpFile, displayName, softKey, access, membersonly, organisationKey);
+				ICourse course = importCourse(ureq, identity, tmpFile, displayName, softKey,
+						accessStatus, accessAllUsers, accessGuests, organisationKey);
 				CourseVO vo = ObjectFactory.get(course);
 				return Response.ok(vo).build();
 			}
@@ -399,8 +432,8 @@ public class CoursesWebService {
 		}
 	}
 
-	private ICourse importCourse(UserRequest ureq, Identity identity, File fCourseImportZIP,
-			String displayName, String softKey, int access, boolean membersOnly, Long organisationKey) {
+	private ICourse importCourse(UserRequest ureq, Identity identity, File fCourseImportZIP, String displayName,
+			String softKey, RepositoryEntryStatusEnum status, boolean allUsers, boolean guests, Long organisationKey) {
 
 		log.info("REST Import course " + displayName + " START");
 		if(!StringHelper.containsNonWhitespace(displayName)) {
@@ -426,31 +459,23 @@ public class CoursesWebService {
 
 		RepositoryHandler handler = handlerFactory.getRepositoryHandler(CourseModule.getCourseTypeName());
 		RepositoryEntry re = handler.importResource(identity, null, displayName, null, true, organisation, Locale.ENGLISH, fCourseImportZIP, null);
-
 		if(StringHelper.containsNonWhitespace(softKey)) {
 			re.setSoftkey(softKey);
+			re = repositoryService.update(re);
 		}
-		//make the repository
-		if(membersOnly) {
-			re.setMembersOnly(true);
-			re.setAccess(RepositoryEntry.ACC_OWNERS);
-		} else {
-			re.setAccess(access);
-		}
-		CoreSpringFactory.getImpl(RepositoryService.class).update(re);
 		log.info("REST Import course " + displayName + " END");
 
 		//publish
 		log.info("REST Publish course " + displayName + " START");
 		ICourse course = CourseFactory.loadCourse(re);
-		CourseFactory.publishCourse(course, RepositoryEntry.ACC_USERS, false,  identity, ureq.getLocale());
+		CourseFactory.publishCourse(course, status, allUsers, guests, identity, ureq.getLocale());
 		log.info("REST Publish course " + displayName + " END");
 		return course;
 	}
 
 	private ICourse copyCourse(Long copyFrom, UserRequest ureq, Identity initialAuthor, String shortTitle, String longTitle, String displayName,
-			String description, String softKey, int access, boolean membersOnly, Long organisationKey, String authors, String location, String externalId, String externalRef,
-			String managedFlags, CourseConfigVO courseConfigVO) {
+			String description, String softKey, RepositoryEntryStatusEnum status, boolean allUsers, boolean guests, Long organisationKey,
+			String authors, String location, String externalId, String externalRef, String managedFlags, CourseConfigVO courseConfigVO) {
 
 		OLATResourceable originalOresTrans = OresHelper.createOLATResourceableInstance(CourseModule.class, copyFrom);
 		RepositoryEntry src = repositoryManager.lookupRepositoryEntry(originalOresTrans, false);
@@ -465,11 +490,6 @@ public class CoursesWebService {
 		boolean isAlreadyLocked = handlerFactory.getRepositoryHandler(src).isLocked(originalOres);
 		LockResult lockResult = handlerFactory.getRepositoryHandler(src).acquireLock(originalOres, ureq.getIdentity());
 
-		//check range of access
-		if(access < 1 || access > RepositoryEntry.ACC_USERS_GUESTS) {
-			access = RepositoryEntry.ACC_OWNERS;
-		}
-
 		if(lockResult == null || (lockResult != null && lockResult.isSuccess()) && !isAlreadyLocked) {
 			//create new repo entry
 			String name;
@@ -498,7 +518,7 @@ public class CoursesWebService {
 			OLATResource sourceResource = src.getOlatResource();
 			OLATResource copyResource = olatResourceManager.createOLATResourceInstance(sourceResource.getResourceableTypeName());
 			RepositoryEntry preparedEntry = repositoryService.create(initialAuthor, null, resName, name,
-					description, copyResource, RepositoryEntry.ACC_OWNERS, organisation);
+					description, copyResource, RepositoryEntryStatusEnum.preparation, organisation);
 
 			RepositoryHandler handler = handlerFactory.getRepositoryHandler(src);
 			preparedEntry = handler.copy(initialAuthor, src, preparedEntry);
@@ -522,21 +542,19 @@ public class CoursesWebService {
 			if(StringHelper.containsNonWhitespace(managedFlags)) {
 				preparedEntry.setManagedFlagsString(managedFlags);
 			}
-			if(membersOnly) {
-				preparedEntry.setMembersOnly(true);
-				preparedEntry.setAccess(RepositoryEntry.ACC_OWNERS);
-			} else {
-				preparedEntry.setAccess(access);
-			}
+			preparedEntry.setEntryStatus(status);
+			preparedEntry.setAllUsers(allUsers);
+			preparedEntry.setGuests(guests);
 			preparedEntry.setAllowToLeaveOption(src.getAllowToLeaveOption());
-
-			repositoryService.update(preparedEntry);
+			preparedEntry = repositoryService.update(preparedEntry);
 
 			// copy image if available
 			repositoryManager.copyImage(src, preparedEntry);
-			ICourse course = prepareCourse(preparedEntry,shortTitle, longTitle, courseConfigVO);
+			ICourse course = prepareCourse(preparedEntry, shortTitle, longTitle, courseConfigVO);
 			handlerFactory.getRepositoryHandler(src).releaseLock(lockResult);
 			return course;
+		} else {
+			log.info("Course locked");
 		}
 
 		return null;
@@ -555,8 +573,9 @@ public class CoursesWebService {
 	 * @return
 	 */
 	private ICourse createEmptyCourse(Identity initialAuthor, String shortTitle, String longTitle, String reDisplayName,
-			String description, String softKey, int access, boolean membersOnly, Long organisationKey, String authors, String location,
-			String externalId, String externalRef, String managedFlags, CourseConfigVO courseConfigVO) {
+			String description, String softKey, RepositoryEntryStatusEnum status, boolean allUsers, boolean guests,
+			Long organisationKey, String authors, String location, String externalId, String externalRef,
+			String managedFlags, CourseConfigVO courseConfigVO) {
 
 		if(!StringHelper.containsNonWhitespace(reDisplayName)) {
 			reDisplayName = shortTitle;
@@ -572,7 +591,8 @@ public class CoursesWebService {
 
 			// create a repository entry
 			OLATResource resource = olatResourceManager.createOLATResourceInstance(CourseModule.class);
-			RepositoryEntry addedEntry = repositoryService.create(initialAuthor, null, "-", reDisplayName, null, resource, 0, organisation);
+			RepositoryEntry addedEntry = repositoryService.create(initialAuthor, null, "-", reDisplayName, null,
+					resource, status, organisation);
 			if(StringHelper.containsNonWhitespace(softKey) && softKey.length() <= 30) {
 				addedEntry.setSoftkey(softKey);
 			}
@@ -587,17 +607,12 @@ public class CoursesWebService {
 			} else {
 				addedEntry.setAllowToLeaveOption(RepositoryEntryAllowToLeaveOptions.atAnyTime);//default
 			}
-			if(membersOnly) {
-				addedEntry.setMembersOnly(true);
-				addedEntry.setAccess(RepositoryEntry.ACC_OWNERS);
-			} else {
-				addedEntry.setAccess(access);
-			}
+			addedEntry.setAllUsers(allUsers);
+			addedEntry.setGuests(guests);
 			addedEntry = repositoryService.update(addedEntry);
 
 			// create an empty course
 			CourseFactory.createCourse(addedEntry, shortTitle, longTitle, "");
-
 			return prepareCourse(addedEntry, shortTitle, longTitle, courseConfigVO);
 		} catch (Exception e) {
 			throw new WebApplicationException(e);
diff --git a/src/main/java/org/olat/restapi/security/RestSecurityHelper.java b/src/main/java/org/olat/restapi/security/RestSecurityHelper.java
index c9519756be3..8804b11c4f5 100644
--- a/src/main/java/org/olat/restapi/security/RestSecurityHelper.java
+++ b/src/main/java/org/olat/restapi/security/RestSecurityHelper.java
@@ -37,6 +37,7 @@ import org.olat.course.ICourse;
 import org.olat.course.groupsandrights.CourseGroupManager;
 import org.olat.course.groupsandrights.CourseRights;
 import org.olat.dispatcher.LocaleNegotiator;
+import org.olat.repository.RepositoryEntryStatusEnum;
 
 /**
  * 
@@ -110,6 +111,15 @@ public class RestSecurityHelper {
 		return LocaleNegotiator.getPreferedLocale(ureq);
 	}
 	
+	public static RepositoryEntryStatusEnum convertToEntryStatus(int accessCode, boolean membersOnly) {
+		switch(accessCode) {
+			case 0: return RepositoryEntryStatusEnum.trash;
+			case 1: return membersOnly ? RepositoryEntryStatusEnum.published : RepositoryEntryStatusEnum.preparation;
+			case 2: return RepositoryEntryStatusEnum.review;
+			default: return RepositoryEntryStatusEnum.published;
+		}
+	}
+	
 	public static Date parseDate(String date, Locale locale) {
 		if(StringHelper.containsNonWhitespace(date)) {
 			if(date.indexOf('T') > 0) {
diff --git a/src/main/java/org/olat/restapi/support/vo/RepositoryEntryAccessVO.java b/src/main/java/org/olat/restapi/support/vo/RepositoryEntryAccessVO.java
index e86f425951f..cf49669fbdb 100644
--- a/src/main/java/org/olat/restapi/support/vo/RepositoryEntryAccessVO.java
+++ b/src/main/java/org/olat/restapi/support/vo/RepositoryEntryAccessVO.java
@@ -36,8 +36,9 @@ import org.olat.repository.RepositoryEntry;
 public class RepositoryEntryAccessVO {
 
 	private Long repoEntryKey;
-	private int access;
-	private boolean membersOnly;
+	private String status;
+	private boolean allUsers;
+	private boolean guests;
 	
 	public RepositoryEntryAccessVO() {
 		//
@@ -46,8 +47,9 @@ public class RepositoryEntryAccessVO {
 	public static RepositoryEntryAccessVO valueOf(RepositoryEntry entry) {
 		RepositoryEntryAccessVO accessVo = new RepositoryEntryAccessVO();
 		accessVo.setRepoEntryKey(entry.getKey());
-		accessVo.setAccess(entry.getAccess());
-		accessVo.setMembersOnly(entry.isMembersOnly());
+		accessVo.setStatus(entry.getEntryStatus().name());
+		accessVo.setAllUsers(entry.isAllUsers());
+		accessVo.setGuests(entry.isGuests());
 		return accessVo;
 	}
 
@@ -59,19 +61,27 @@ public class RepositoryEntryAccessVO {
 		this.repoEntryKey = repoEntryKey;
 	}
 
-	public int getAccess() {
-		return access;
+	public String getStatus() {
+		return status;
 	}
 
-	public void setAccess(int access) {
-		this.access = access;
+	public void setStatus(String status) {
+		this.status = status;
 	}
 
-	public boolean isMembersOnly() {
-		return membersOnly;
+	public boolean isAllUsers() {
+		return allUsers;
 	}
 
-	public void setMembersOnly(boolean membersOnly) {
-		this.membersOnly = membersOnly;
+	public void setAllUsers(boolean allUsers) {
+		this.allUsers = allUsers;
+	}
+
+	public boolean isGuests() {
+		return guests;
+	}
+
+	public void setGuests(boolean guests) {
+		this.guests = guests;
 	}
 }
diff --git a/src/main/java/org/olat/restapi/system/OpenOLATStatisticsWebService.java b/src/main/java/org/olat/restapi/system/OpenOLATStatisticsWebService.java
index 3fdf3724845..7cc2d308bef 100644
--- a/src/main/java/org/olat/restapi/system/OpenOLATStatisticsWebService.java
+++ b/src/main/java/org/olat/restapi/system/OpenOLATStatisticsWebService.java
@@ -41,7 +41,6 @@ import org.olat.core.util.session.UserSessionManager;
 import org.olat.course.CourseModule;
 import org.olat.group.BusinessGroupService;
 import org.olat.portfolio.manager.InvitationDAO;
-import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.restapi.system.vo.OpenOLATStatisticsVO;
 import org.olat.restapi.system.vo.RepositoryStatisticsVO;
@@ -221,8 +220,8 @@ public class OpenOLATStatisticsWebService implements Sampler {
 	private RepositoryStatisticsVO getRepositoryStatisticsVO() {
 		RepositoryStatisticsVO stats = new RepositoryStatisticsVO();
 		RepositoryManager repoMgr = CoreSpringFactory.getImpl(RepositoryManager.class);
-		int allCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_OWNERS);
-		int publishedCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_USERS);
+		int allCourses = repoMgr.countByType(CourseModule.ORES_TYPE_COURSE);
+		int publishedCourses = repoMgr.countPublished(CourseModule.ORES_TYPE_COURSE);
 		stats.setCoursesCount(allCourses);
 		stats.setPublishedCoursesCount(publishedCourses);
 		return stats;
diff --git a/src/main/java/org/olat/search/service/indexer/repository/CourseIndexer.java b/src/main/java/org/olat/search/service/indexer/repository/CourseIndexer.java
index 293a2ddfa37..fbda0ce1211 100644
--- a/src/main/java/org/olat/search/service/indexer/repository/CourseIndexer.java
+++ b/src/main/java/org/olat/search/service/indexer/repository/CourseIndexer.java
@@ -49,7 +49,7 @@ import org.olat.course.run.userview.UserCourseEnvironment;
 import org.olat.course.run.userview.UserCourseEnvironmentImpl;
 import org.olat.course.run.userview.VisibleTreeFilter;
 import org.olat.repository.RepositoryEntry;
-import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.search.service.SearchResourceContext;
 import org.olat.search.service.indexer.AbstractHierarchicalIndexer;
@@ -85,9 +85,9 @@ public class CourseIndexer extends AbstractHierarchicalIndexer {
 		RepositoryEntry repositoryEntry = (RepositoryEntry) parentObject;
 		if (isLogDebugEnabled()) logDebug("Analyse Course... repositoryEntry=" + repositoryEntry);
 		try {
-			RepositoryEntryStatus status = RepositoryManager.getInstance().createRepositoryEntryStatus(repositoryEntry.getStatusCode());
-			if(status.isClosed()) {
-				if(isLogDebugEnabled()) logDebug("Course not indexed because it's closed: repositoryEntry=" + repositoryEntry);
+			RepositoryEntryStatusEnum status = repositoryEntry.getEntryStatus();
+			if(status.decommissioned()) {
+				if(isLogDebugEnabled()) logDebug("Course not indexed because it's " + status + ": repositoryEntry=" + repositoryEntry);
 				return;
 			}
 
@@ -165,10 +165,8 @@ public class CourseIndexer extends AbstractHierarchicalIndexer {
 		RepositoryEntry repositoryEntry = repositoryManager.lookupRepositoryEntry(repositoryKey);
 		if (isLogDebugEnabled()) logDebug("repositoryEntry=" + repositoryEntry );
 
-		if(roles.isGuestOnly()) {
-			if(repositoryEntry.getAccess() != RepositoryEntry.ACC_USERS_GUESTS) {
-				return false;
-			}
+		if(roles.isGuestOnly() && repositoryEntry.isGuests()) {
+			return false;
 		}
 		
 		Long nodeId = bcContextEntry.getOLATResourceable().getResourceableId();
diff --git a/src/main/java/org/olat/search/service/indexer/repository/RepositoryIndexer.java b/src/main/java/org/olat/search/service/indexer/repository/RepositoryIndexer.java
index 04e9697477d..3e3a0d81085 100644
--- a/src/main/java/org/olat/search/service/indexer/repository/RepositoryIndexer.java
+++ b/src/main/java/org/olat/search/service/indexer/repository/RepositoryIndexer.java
@@ -40,6 +40,7 @@ import org.olat.core.id.context.ContextEntry;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.manager.RepositoryEntryDocumentFactory;
@@ -146,7 +147,8 @@ public class RepositoryIndexer extends AbstractHierarchicalIndexer {
 						logInfo("doIndex: repositoryEntry was deleted while we were indexing. The deleted repositoryEntry was: "+repositoryEntry);
 						continue;
 					}
-					if(repositoryEntry.getAccess() == RepositoryEntry.DELETED) {
+					if(repositoryEntry.getEntryStatus() == RepositoryEntryStatusEnum.trash
+							|| repositoryEntry.getEntryStatus() == RepositoryEntryStatusEnum.deleted) {
 						continue;
 					}
 					
@@ -212,7 +214,7 @@ public class RepositoryIndexer extends AbstractHierarchicalIndexer {
 		if (repositoryEntry == null) {
 			return false;
 		}
-		if(roles.isGuestOnly() && repositoryEntry.getAccess() != RepositoryEntry.ACC_USERS_GUESTS) {
+		if(roles.isGuestOnly() && !repositoryEntry.isGuests()) {
 			return false;
 		}
 		
diff --git a/src/main/java/org/olat/upgrade/OLATUpgrade_13_0_0.java b/src/main/java/org/olat/upgrade/OLATUpgrade_13_0_0.java
index 7e421fc936f..5ef20e644cf 100644
--- a/src/main/java/org/olat/upgrade/OLATUpgrade_13_0_0.java
+++ b/src/main/java/org/olat/upgrade/OLATUpgrade_13_0_0.java
@@ -47,9 +47,12 @@ import org.olat.modules.lecture.LectureService;
 import org.olat.modules.lecture.model.LectureBlockRollCallRefImpl;
 import org.olat.modules.portfolio.PortfolioService;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.manager.RepositoryEntryRelationDAO;
 import org.olat.repository.manager.RepositoryEntryToOrganisationDAO;
+import org.olat.upgrade.model.RepositoryEntryAccessUpgrade;
+import org.olat.upgrade.model.RepositoryEntryAccessUpgradeStatus;
 import org.springframework.beans.factory.annotation.Autowired;
 
 /**
@@ -66,6 +69,7 @@ public class OLATUpgrade_13_0_0 extends OLATUpgrade {
 	private static final String MIGRATE_PORTFOLIO_EVAL_FORM = "PORTFOLIO EVALUATION FORM";
 	private static final String MIGRATE_SEND_APPEAL_DATES = "LECTURES SEND APPEAL DATES";
 	private static final String MIGRATE_ADMIN_SITE_SEC = "MIGRATE ADMIN SITE SECURITY CALLBACK";
+	private static final String MIGRATE_REPO_ENTRY_ACCESS = "MIGRATE REPO ENTRY ACCESS";
 	
 	@Autowired
 	private DB dbInstance;
@@ -118,6 +122,7 @@ public class OLATUpgrade_13_0_0 extends OLATUpgrade {
 		allOk &= migratePortfolioEvaluationForm(upgradeManager, uhd);
 		allOk &= migrateLecturesSendAppealDates(upgradeManager, uhd);
 		allOk &= migrateAdminSiteSecurityCallback(upgradeManager, uhd);
+		allOk &= migrateRepositoryEntriesAccess(upgradeManager, uhd);
 		
 		uhd.setInstallationComplete(allOk);
 		upgradeManager.setUpgradesHistory(uhd, VERSION);
@@ -219,6 +224,79 @@ public class OLATUpgrade_13_0_0 extends OLATUpgrade {
 				.getResultList();
 	}
 	
+	private boolean migrateRepositoryEntriesAccess(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
+		boolean allOk = true;
+		if (!uhd.getBooleanDataValue(MIGRATE_REPO_ENTRY_ACCESS)) {
+			try {
+				List<Long> repositoryEntryKeys = getRepositoryEntryKeys();
+				for(int i=0; i<repositoryEntryKeys.size(); i++) {
+					migrateRepositoryEntryAccess(repositoryEntryKeys.get(i));
+					if(i % 50 == 0) {
+						log.info("Migration repository entries access flags: " + i + " / " + repositoryEntryKeys.size());
+						dbInstance.commitAndCloseSession();
+					}
+				}
+				log.info("Migration repository entries access flags done: " + repositoryEntryKeys.size());
+				dbInstance.commitAndCloseSession();
+			} catch (Exception e) {
+				log.error("", e);
+				allOk &= false;
+			}
+
+			uhd.setBooleanDataValue(MIGRATE_REPO_ENTRY_ACCESS, allOk);
+			upgradeManager.setUpgradesHistory(uhd, VERSION);
+		}
+		return allOk;
+	}
+	
+	private void migrateRepositoryEntryAccess(Long repositoryEntryKey) {
+		RepositoryEntryAccessUpgrade oldEntry = dbInstance.getCurrentEntityManager()
+				.find(RepositoryEntryAccessUpgrade.class, repositoryEntryKey);
+		RepositoryEntry entry = repositoryService.loadByKey(repositoryEntryKey);
+		if(oldEntry != null && entry != null) {
+			int access = oldEntry.getAccess();
+			boolean isMembersOnly = oldEntry.isMembersOnly();
+			if(access == RepositoryEntryAccessUpgrade.ACC_USERS) {
+				entry.setAllUsers(true);
+				entry.setGuests(false);
+			} else if(access == RepositoryEntryAccessUpgrade.ACC_USERS_GUESTS) {
+				entry.setAllUsers(true);
+				entry.setGuests(true);
+			} else {
+				entry.setAllUsers(false);
+				entry.setGuests(false);
+			}
+			
+			RepositoryEntryStatusEnum status = RepositoryEntryStatusEnum.preparation;
+			RepositoryEntryAccessUpgradeStatus statusCode = new RepositoryEntryAccessUpgradeStatus(oldEntry.getStatusCode());
+			if(access == RepositoryEntryAccessUpgrade.DELETED) {
+				status = RepositoryEntryStatusEnum.trash;
+			} else if(statusCode.isClosed()) {
+				status = RepositoryEntryStatusEnum.closed;		
+			} else if(statusCode.isUnpublished()) {
+				if(access == RepositoryEntryAccessUpgrade.ACC_OWNERS) {
+					status = RepositoryEntryStatusEnum.preparation;
+				} else if(access == RepositoryEntryAccessUpgrade.ACC_OWNERS_AUTHORS) {
+					status = RepositoryEntryStatusEnum.review;
+				}	
+			} else if(access == RepositoryEntryAccessUpgrade.ACC_OWNERS) {
+				if(isMembersOnly) {
+					status = RepositoryEntryStatusEnum.published;
+				} else {
+					status = RepositoryEntryStatusEnum.preparation;
+				}
+			} else if(access == RepositoryEntryAccessUpgrade.ACC_OWNERS_AUTHORS) {
+				status = RepositoryEntryStatusEnum.review;
+			} else if(access == RepositoryEntryAccessUpgrade.ACC_USERS || access == RepositoryEntryAccessUpgrade.ACC_USERS_GUESTS) {
+				status = RepositoryEntryStatusEnum.published;
+			}
+			
+			entry.setEntryStatus(status);
+			dbInstance.getCurrentEntityManager().merge(entry);
+			dbInstance.commit();
+		}
+	}
+	
 	private boolean migrateRepositoryEntriesToDefaultOrganisation(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
 		boolean allOk = true;
 		if (!uhd.getBooleanDataValue(MIGRATE_REPO_ENTRY_DEFAULT_ORG)) {
@@ -228,6 +306,7 @@ public class OLATUpgrade_13_0_0 extends OLATUpgrade {
 					migrateRepositoryEntryToDefaultOrganisation(repositoryEntryKeys.get(i));
 					if(i % 50 == 0) {
 						log.info("Migration repository entries to default organisation: " + i + " / " + repositoryEntryKeys.size());
+						dbInstance.commitAndCloseSession();
 					}
 				}
 				log.info("Migration repository entries to default organisation done: " + repositoryEntryKeys.size());
diff --git a/src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgrade.java b/src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgrade.java
new file mode 100644
index 00000000000..47633400f32
--- /dev/null
+++ b/src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgrade.java
@@ -0,0 +1,135 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.upgrade.model;
+
+import javax.persistence.Transient;
+
+import org.olat.repository.RepositoryEntry;
+
+/**
+ * 
+ * Initial date: 20 juil. 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class RepositoryEntryAccessUpgrade {
+
+	public static final int DELETED = 0;
+	public static final int ACC_OWNERS = 1; // limit access to owners
+	public static final int ACC_OWNERS_AUTHORS = 2; // limit access to owners and authors
+	public static final int ACC_USERS = 3; // limit access to owners, authors and users
+	public static final int ACC_USERS_GUESTS = 4; // no limits
+
+	private Long key;
+	
+	private int access;
+	private boolean canCopy;
+	private boolean canReference;
+	private boolean canLaunch;
+	private boolean canDownload;
+	private boolean membersOnly;
+	private int statusCode;
+
+	public Long getKey() {
+		return key;
+	}
+
+	public void setKey(Long key) {
+		this.key = key;
+	}
+
+	public int getStatusCode() {
+		return statusCode;
+	}
+
+	public void setStatusCode(int statusCode) {
+		this.statusCode = statusCode;
+	}
+
+	public boolean getCanCopy() {
+		return canCopy;
+	}
+
+	public void setCanCopy(boolean b) {
+		canCopy = b;
+	}
+
+	public boolean getCanReference() {
+		return canReference;
+	}
+	
+	public void setCanReference(boolean b) {
+		canReference = b;
+	}
+
+	public boolean getCanDownload() {
+		return canDownload;
+	}
+	
+	public void setCanDownload(boolean b) {
+		canDownload = b;
+	}
+
+	public boolean getCanLaunch() {
+		return canLaunch;
+	}
+
+	public void setCanLaunch(boolean b) {
+		canLaunch = b;
+	}
+	
+	public int getAccess() {
+		return access;
+	}
+	
+	public void setAccess(int i) {
+		access = i;
+	}
+
+	public boolean isMembersOnly() {
+		return membersOnly;
+	}
+
+	public void setMembersOnly(boolean membersOnly) {
+		this.membersOnly = membersOnly;
+	}
+	
+	@Transient
+	public RepositoryEntryAccessUpgradeStatus getStatus() {
+		return new RepositoryEntryAccessUpgradeStatus(getStatusCode());
+	}
+
+	@Override
+	public int hashCode() {
+		return key == null ? 293485 : key.hashCode();
+	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if(obj == this) {
+			return true;
+		}
+		if(obj instanceof RepositoryEntry) {
+			RepositoryEntryAccessUpgrade re = (RepositoryEntryAccessUpgrade)obj;
+			return key != null && key.equals(re.key);
+		}
+		return false;
+	}
+}
diff --git a/src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgradeStatus.java b/src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgradeStatus.java
new file mode 100644
index 00000000000..131ae9d8203
--- /dev/null
+++ b/src/main/java/org/olat/upgrade/model/RepositoryEntryAccessUpgradeStatus.java
@@ -0,0 +1,81 @@
+/**
+* OLAT - Online Learning and Training<br>
+* http://www.olat.org
+* <p>
+* Licensed under the Apache License, Version 2.0 (the "License"); <br>
+* you may not use this file except in compliance with the License.<br>
+* You may obtain a copy of the License at
+* <p>
+* http://www.apache.org/licenses/LICENSE-2.0
+* <p>
+* Unless required by applicable law or agreed to in writing,<br>
+* software distributed under the License is distributed on an "AS IS" BASIS, <br>
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+* See the License for the specific language governing permissions and <br>
+* limitations under the License.
+* <p>
+* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
+* University of Zurich, Switzerland.
+* <hr>
+* <a href="http://www.openolat.org">
+* OpenOLAT - Online Learning and Training</a><br>
+* This file has been modified by the OpenOLAT community. Changes are licensed
+* under the Apache 2.0 license as the original file.
+*/
+package org.olat.upgrade.model;
+/**
+ * 
+ * Description:<br>
+ * This class is used to handle and interpret the status of repository entries.This
+ * is a backup of the original one used to upgrade the repository entries.
+ * 
+ * <P>
+ * Initial Date:  09.07.2009 <br>
+ * @author bja <bja@bps-system.de>
+ */
+public class RepositoryEntryAccessUpgradeStatus {
+
+	public static final int REPOSITORY_STATUS_OPEN = 0;
+	/**
+	 * Correspond to the "freeze" status
+	 */
+	public static final int REPOSITORY_STATUS_CLOSED = 2;
+	public static final int REPOSITORY_STATUS_UNPUBLISHED = 4;
+	
+	private boolean closed;
+	private boolean unpublished;
+	
+	public RepositoryEntryAccessUpgradeStatus(int statusCode) {
+		// initialize closed status
+		if((statusCode & REPOSITORY_STATUS_CLOSED) == REPOSITORY_STATUS_CLOSED ) {
+			setClosed(true);
+		} else {
+			setClosed(false);
+		}
+		
+		if((statusCode & REPOSITORY_STATUS_UNPUBLISHED) == REPOSITORY_STATUS_UNPUBLISHED ) {
+			setUnpublished(true);
+		} else {
+			setUnpublished(false);
+		}
+	}
+
+	/**
+	 * @param closed
+	 */
+	private void setClosed(boolean closed) {
+		this.closed = closed;
+	}
+
+	public boolean isClosed() {
+		return closed;
+	}
+	
+	private void setUnpublished(boolean unpublished) {
+		this.unpublished = unpublished;
+	}
+
+	public boolean isUnpublished() {
+		return unpublished;
+	}
+}
diff --git a/src/main/java/org/olat/upgrade/model/RepositoryEntryUpgrade.hbm.xml b/src/main/java/org/olat/upgrade/model/RepositoryEntryUpgrade.hbm.xml
index c78c8280cf8..db2bb8626ed 100644
--- a/src/main/java/org/olat/upgrade/model/RepositoryEntryUpgrade.hbm.xml
+++ b/src/main/java/org/olat/upgrade/model/RepositoryEntryUpgrade.hbm.xml
@@ -104,4 +104,46 @@
 		
 		<property name="statusCode" column="statuscode" unique="false" type="int"/>
 	</class>
+	
+	
+	
+	<class name="org.olat.upgrade.model.RepositoryEntryAccessUpgrade" table="o_repositoryentry">
+
+		<id name="key" column="repositoryentry_id" type="long" unsaved-value="null">
+		<generator class="enhanced-sequence">
+			<param name="sequence_name">hibernate_unique_key</param>
+			<param name="force_table_use">true</param>
+			<param name="optimizer">legacy-hilo</param>
+			<param name="value_column">next_hi</param>
+			<param name="increment_size">32767</param>
+			<param name="initial_value">32767</param>
+		</generator>
+		</id>
+		
+		<property name="access">
+			<column name="accesscode" unique="false" not-null="true" index="access_idx"/>
+		</property>
+		
+		<property name="membersOnly" type="boolean">
+			<column name="membersonly" unique="false" not-null="true" />
+		</property>
+		
+		<property name="canLaunch">
+			<column name="canlaunch" unique="false" not-null="true"/>
+		</property>
+		
+		<property name="canDownload">
+			<column name="candownload" unique="false" not-null="true"/>
+		</property>
+		
+		<property name="canCopy">
+			<column name="cancopy" unique="false" not-null="true"/>
+		</property>
+		
+		<property name="canReference">
+			<column name="canreference" unique="false" not-null="true"/>
+		</property>
+		
+		<property name="statusCode" column="statuscode" unique="false" type="int"/>
+	</class>
 </hibernate-mapping>
diff --git a/src/main/java/org/olat/user/restapi/UserCoursesWebService.java b/src/main/java/org/olat/user/restapi/UserCoursesWebService.java
index 8dd9ebf0978..e72c3c4c9f0 100644
--- a/src/main/java/org/olat/user/restapi/UserCoursesWebService.java
+++ b/src/main/java/org/olat/user/restapi/UserCoursesWebService.java
@@ -38,11 +38,11 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
+import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryOrder;
 import org.olat.repository.RepositoryManager;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.MediaTypeVariants;
 import org.olat.restapi.support.ObjectFactory;
 import org.olat.restapi.support.vo.CourseVO;
@@ -90,8 +90,8 @@ public class UserCoursesWebService {
 			@Context Request request) {
 		
 		if(MediaTypeVariants.isPaged(httpRequest, request)) {
-			List<RepositoryEntry> repoEntries = repositoryManager.getLearningResourcesAsStudent(identity, null, start, limit, RepositoryEntryOrder.nameAsc);
-			int totalCount= repositoryManager.countLearningResourcesAsStudent(identity);
+			List<RepositoryEntry> repoEntries = repositoryManager.getLearningResourcesAsStudent(identity, "CourseModule", start, limit, RepositoryEntryOrder.nameAsc);
+			int totalCount= repositoryManager.countLearningResourcesAsStudent(identity, "CourseModule");
 
 			CourseVO[] vos = toCourseVo(repoEntries);
 			CourseVOes voes = new CourseVOes();
@@ -99,7 +99,7 @@ public class UserCoursesWebService {
 			voes.setTotalCount(totalCount);
 			return Response.ok(voes).build();
 		} else {
-			List<RepositoryEntry> repoEntries = repositoryManager.getLearningResourcesAsStudent(identity, null, 0, -1, RepositoryEntryOrder.nameAsc);
+			List<RepositoryEntry> repoEntries = repositoryManager.getLearningResourcesAsStudent(identity, "CourseModule", 0, -1, RepositoryEntryOrder.nameAsc);
 			CourseVO[] vos = toCourseVo(repoEntries);
 			return Response.ok(vos).build();
 		}
@@ -189,11 +189,11 @@ public class UserCoursesWebService {
 		int count=0;
 		for (RepositoryEntry repoEntry : repoEntries) {
 			try {
-				ICourse course = CoursesWebService.loadCourse(repoEntry.getOlatResource().getResourceableId());
+				ICourse course = CourseFactory.loadCourse(repoEntry);
 				if(course != null) {
 					voList.add(ObjectFactory.get(repoEntry, course));
 				}
-				if(count % 33 == 0) {
+				if(count++ % 33 == 0) {
 					dbInstance.commitAndCloseSession();
 				}
 			} catch (Exception e) {
diff --git a/src/main/resources/database/mysql/alter_12_4_x_to_13_0_0.sql b/src/main/resources/database/mysql/alter_12_4_x_to_13_0_0.sql
index 0dc4fe0455a..4d3b3e02276 100644
--- a/src/main/resources/database/mysql/alter_12_4_x_to_13_0_0.sql
+++ b/src/main/resources/database/mysql/alter_12_4_x_to_13_0_0.sql
@@ -181,6 +181,15 @@ alter table o_re_to_tax_level add constraint re_to_lev_re_idx foreign key (fk_en
 alter table o_re_to_tax_level add constraint re_to_lev_tax_lev_idx foreign key (fk_taxonomy_level) references o_tax_taxonomy_level (id);
 
 
+alter table o_repositoryentry add column status varchar(16) default 'preparation' not null;
+alter table o_repositoryentry add column allusers bit default 0 not null;
+alter table o_repositoryentry add column guests bit default 0 not null;
+alter table o_repositoryentry modify column canlaunch bit default 0 not null;
+alter table o_repositoryentry modify column accesscode integer default 0 not null;
+alter table o_repositoryentry modify column statuscode integer default 0 not null;
+
+create index re_status_idx on o_repositoryentry (status);
+
 -- drop policy
 alter table o_bs_policy drop foreign key FK9A1C5101E2E76DB;
 
diff --git a/src/main/resources/database/mysql/setupDatabase.sql b/src/main/resources/database/mysql/setupDatabase.sql
index 1f5c4d19be0..be791737f01 100644
--- a/src/main/resources/database/mysql/setupDatabase.sql
+++ b/src/main/resources/database/mysql/setupDatabase.sql
@@ -452,11 +452,10 @@ create table if not exists o_repositoryentry (
    fk_olatresource bigint unique,
    description longtext,
    initialauthor varchar(128) not null,
-   accesscode integer not null default 0,
-   membersonly bit default 0,
-   statuscode integer,
+   status varchar(16) default 'preparation' not null,
+   allusers bit default 0 not null,
+   guests bit default 0 not null,
    allowtoleave varchar(16),
-   canlaunch bit not null,
    candownload bit not null,
    cancopy bit not null,
    canreference bit not null,
@@ -3050,7 +3049,7 @@ create index id_idx on o_olatresource (resid);
 -- repository
 alter table o_repositoryentry add constraint FK2F9C439888C31018 foreign key (fk_olatresource) references o_olatresource (resource_id);
 
-create index access_idx on o_repositoryentry (accesscode);
+create index re_status_idx on o_repositoryentry (status);
 create index initialAuthor_idx on o_repositoryentry (initialauthor);
 create index resource_idx on o_repositoryentry (resourcename);
 create index displayname_idx on o_repositoryentry (displayname);
diff --git a/src/main/resources/database/oracle/alter_12_4_x_to_13_0_0.sql b/src/main/resources/database/oracle/alter_12_4_x_to_13_0_0.sql
index b0d9e2cba65..5514d569267 100644
--- a/src/main/resources/database/oracle/alter_12_4_x_to_13_0_0.sql
+++ b/src/main/resources/database/oracle/alter_12_4_x_to_13_0_0.sql
@@ -189,6 +189,16 @@ alter table o_re_to_tax_level add constraint re_to_lev_tax_lev_idx foreign key (
 create index idx_re_to_lev_tax_lev_idx on o_re_to_tax_level (fk_taxonomy_level);
 
 
+alter table o_repositoryentry add status varchar(16) default 'preparation' not null;
+alter table o_repositoryentry add allusers number default 0 not null;
+alter table o_repositoryentry add guests number default 0 not null;
+alter table o_repositoryentry modify canlaunch number default 0;
+alter table o_repositoryentry modify accesscode number(11) default 0;
+alter table o_repositoryentry modify statuscode number(11) default 0 not null;
+
+create index re_status_idx on o_repositoryentry (status);
+
+
 -- evaluation forms
 create table o_eva_form_survey (
    id number(20) GENERATED ALWAYS AS IDENTITY,
diff --git a/src/main/resources/database/oracle/setupDatabase.sql b/src/main/resources/database/oracle/setupDatabase.sql
index b9825d229a7..00ac8106abd 100644
--- a/src/main/resources/database/oracle/setupDatabase.sql
+++ b/src/main/resources/database/oracle/setupDatabase.sql
@@ -501,9 +501,9 @@ CREATE TABLE o_repositoryentry (
   fk_olatresource number(20),
   description varchar2(4000),
   initialauthor varchar2(128 char) NOT NULL,
-  accesscode number(11) NOT NULL,
-  membersonly number default 0,
-  statuscode number(11),
+  status varchar(16) default 'preparation' not null,
+  allusers number default 0 not null,
+  guests number default 0 not null,
   allowtoleave varchar2(16 char),
   canlaunch number NOT NULL,
   candownload number NOT NULL,
diff --git a/src/main/resources/database/postgresql/alter_12_4_x_to_13_0_0.sql b/src/main/resources/database/postgresql/alter_12_4_x_to_13_0_0.sql
index c73c9548af5..b74939c1447 100644
--- a/src/main/resources/database/postgresql/alter_12_4_x_to_13_0_0.sql
+++ b/src/main/resources/database/postgresql/alter_12_4_x_to_13_0_0.sql
@@ -190,6 +190,15 @@ alter table o_re_to_tax_level add constraint re_to_lev_tax_lev_idx foreign key (
 create index idx_re_to_lev_tax_lev_idx on o_re_to_tax_level (fk_taxonomy_level);
 
 
+alter table o_repositoryentry add column status varchar(16) default 'preparation' not null;
+alter table o_repositoryentry add column allusers boolean default false not null;
+alter table o_repositoryentry add column guests boolean default false not null;
+alter table o_repositoryentry alter column canlaunch set default false;
+alter table o_repositoryentry alter column accesscode set default 0;
+alter table o_repositoryentry alter column statuscode set default 0;
+
+create index re_status_idx on o_repositoryentry (status);
+
 -- drop policy
 alter table o_bs_policy drop constraint FK9A1C5101E2E76DB;
 
diff --git a/src/main/resources/database/postgresql/setupDatabase.sql b/src/main/resources/database/postgresql/setupDatabase.sql
index 6cc9a3fb675..fe96e62552b 100644
--- a/src/main/resources/database/postgresql/setupDatabase.sql
+++ b/src/main/resources/database/postgresql/setupDatabase.sql
@@ -447,14 +447,13 @@ create table o_repositoryentry (
    fk_olatresource int8 unique,
    description text,
    initialauthor varchar(128) not null,
-   accesscode int4 not null,
-   membersonly boolean default false,
-   statuscode int4,
    allowtoleave varchar(16),
-   canlaunch bool not null,
    candownload bool not null,
    cancopy bool not null,
    canreference bool not null,
+   status varchar(16) default 'preparation' not null,
+   allusers boolean default false not null,
+   guests boolean default false not null,
    deletiondate timestamp default null,
    fk_deleted_by int8 default null,
    primary key (repositoryentry_id)
@@ -2944,12 +2943,10 @@ create index id_idx on o_olatresource (resid);
 
 -- repository
 create index descritpion_idx on o_repositoryentry (description);
-create index access_idx on o_repositoryentry (accesscode);
+create index re_status_idx on o_repositoryentry (status);
 create index initialAuthor_idx on o_repositoryentry (initialauthor);
 create index resource_idx on o_repositoryentry (resourcename);
 create index displayname_idx on o_repositoryentry (displayname);
--- index created softkey_idx on unique constraint
-create index repo_members_only_idx on o_repositoryentry (membersonly);
 create index idx_re_lifecycle_soft_idx on o_repositoryentry_cycle (r_softkey);
 create index idx_re_lifecycle_extid_idx on o_repositoryentry (external_id);
 create index idx_re_lifecycle_extref_idx on o_repositoryentry (external_ref);
diff --git a/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java b/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java
index bb3364fad86..92df7138618 100644
--- a/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java
+++ b/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java
@@ -50,6 +50,7 @@ import org.olat.core.util.coordinate.SyncerCallback;
 import org.olat.core.util.coordinate.SyncerExecutor;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -347,7 +348,8 @@ public class CoordinatorTest extends OlatTestCase {
 		int maxLoop = 500;
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		final RepositoryEntry re = repositoryService.create(null, "test", "perfTest", "testPerf", "perfTest description", r, 0, defOrganisation);
+		final RepositoryEntry re = repositoryService.create(null, "test", "perfTest", "testPerf", "perfTest description",
+				r, RepositoryEntryStatusEnum.trash, defOrganisation);
 		// create security group
 		repositoryService.update(re);
 		DBFactory.getInstance().commitAndCloseSession();
diff --git a/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java b/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java
index d055d126169..e219892fc7c 100644
--- a/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java
+++ b/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java
@@ -102,7 +102,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testOptions()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("webdav-1-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("webdav-1-");
 		
 		//list root content of its webdav folder
 		WebDAVConnection conn = new WebDAVConnection();
@@ -139,7 +139,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testHead()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("webdav-2-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("webdav-2-");
 
 		WebDAVConnection conn = new WebDAVConnection();
 		conn.setCredentials(user.getName(), "A6B7C8");
@@ -167,7 +167,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testPropFind()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("webdav-2-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("webdav-2-");
 
 		WebDAVConnection conn = new WebDAVConnection();
 		conn.setCredentials(user.getName(), "A6B7C8");
@@ -192,7 +192,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testMkcol_public()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-2a-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-2a-");
 
 		//create a file
 		String publicPath = FolderConfig.getUserHomes() + "/" + user.getName() + "/public";
@@ -226,7 +226,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testMove_public()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-2b-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-2b-");
 
 		//create a file
 		String publicPath = FolderConfig.getUserHomes() + "/" + user.getName() + "/public";
@@ -260,7 +260,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testCopy_public()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-2b-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-2b-");
 
 		//create a file
 		String publicPath = FolderConfig.getUserHomes() + "/" + user.getName() + "/public";
@@ -296,7 +296,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testPut_course()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-3-" + UUID.randomUUID().toString());
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-3-");
 		deployTestCourse(author, null);
 
 		WebDAVConnection conn = new WebDAVConnection();
@@ -337,7 +337,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testPut_PropPatch_home()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-3-" + UUID.randomUUID().toString());
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-3-");
 		deployTestCourse(author, null);
 
 		WebDAVConnection conn = new WebDAVConnection();
@@ -397,8 +397,8 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testLock()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-4-" + UUID.randomUUID().toString());
-		Identity assistant = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-5-" + UUID.randomUUID().toString());
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-4-");
+		Identity assistant = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-5-");
 		deployTestCourse(author, assistant);
 
 		WebDAVConnection authorConn = new WebDAVConnection();
@@ -458,8 +458,8 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testLock_propfind_lockedInOpenOLAT()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-4-" + UUID.randomUUID().toString());
-		Identity assistant = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-5-" + UUID.randomUUID().toString());
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-4-");
+		Identity assistant = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-5-");
 		RepositoryEntry re = deployTestCourse(author, assistant);
 		ICourse course = CourseFactory.loadCourse(re.getOlatResource());
 		Assert.assertNotNull(course);
@@ -506,7 +506,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	public void testLock_guilike_lockedWithWebdAV()
 	throws IOException, URISyntaxException {
 		//create a user
-		Identity user = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-2c-" + UUID.randomUUID().toString());
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-2c-");
 
 		//create a file
 		String publicPath = FolderConfig.getUserHomes() + "/" + user.getName() + "/public";
@@ -651,7 +651,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		webDAVModule.setEnableLearnersBookmarksCourse(true);
 		webDAVModule.setEnableLearnersParticipatingCourses(true);
 		
-		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("auth-webdav");
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndAuthor("auth-webdav");
 		Identity participant = JunitTestHelper.createAndPersistIdentityAsRndUser("participant-webdav");
 		URL courseWithForumsUrl = WebDAVCommandsTest.class.getResource("webdav_course.zip");
 		RepositoryEntry course = deployTestCourse(author, null, "WebDAV course", courseWithForumsUrl);
@@ -684,7 +684,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		webDAVModule.setEnableLearnersBookmarksCourse(true);
 		webDAVModule.setEnableLearnersParticipatingCourses(true);
 		
-		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("auth-webdav");
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndAuthor("auth-webdav");
 		URL courseWithForumsUrl = WebDAVCommandsTest.class.getResource("webdav_course.zip");
 		deployTestCourse(author, null, "WebDAV course", courseWithForumsUrl);
 		dbInstance.commitAndCloseSession();
@@ -723,7 +723,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		webDAVModule.setEnableLearnersParticipatingCourses(true);
 		
 		//create a user
-		Identity auth = JunitTestHelper.createAndPersistIdentityAsAuthor("webdav-4-" + UUID.randomUUID().toString());
+		Identity auth = JunitTestHelper.createAndPersistIdentityAsRndAuthor("webdav-4-");
 		Identity participant = JunitTestHelper.createAndPersistIdentityAsRndUser("webdav-5");
 		RepositoryEntry courseEntry = deployMkdirsCourse(auth);
 		repositoryEntryRelationDao.addRole(participant, courseEntry, GroupRoles.participant.name());
diff --git a/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java b/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
index a806209e60d..df987cdcb98 100644
--- a/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
+++ b/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
@@ -38,6 +38,7 @@ import org.olat.course.CourseFactory;
 import org.olat.course.CourseModule;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -66,7 +67,8 @@ public class CourseConfigManagerImplTest extends OlatTestCase {
 		OLATResource resource = resourceManager.createOLATResourceInstance(CourseModule.class);
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry addedEntry = repositoryService.create(null, "Ayanami", "-", "JUnit course configuration course", "A JUnit course", resource, 0, defOrganisation);
+		RepositoryEntry addedEntry = repositoryService.create(null, "Ayanami", "-", "JUnit course configuration course", "A JUnit course",
+				resource, RepositoryEntryStatusEnum.trash, defOrganisation);
 		ICourse course = CourseFactory.createCourse(addedEntry, "JUnitCourseConfig", "JUnitCourseConfig Long Title",
 				"objective 1 objective 2 objective 3");
 		dbInstance.commitAndCloseSession();
diff --git a/src/test/java/org/olat/course/editor/PublishProcessTest.java b/src/test/java/org/olat/course/editor/PublishProcessTest.java
index 5d7e67e22fb..9a4c79ae101 100644
--- a/src/test/java/org/olat/course/editor/PublishProcessTest.java
+++ b/src/test/java/org/olat/course/editor/PublishProcessTest.java
@@ -44,6 +44,7 @@ import org.olat.course.tree.CourseEditorTreeModel;
 import org.olat.course.tree.CourseEditorTreeNode;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryImportExport;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -302,7 +303,7 @@ public class PublishProcessTest extends OlatTestCase {
 		
 		//deploy a course
 		String softKey = UUID.randomUUID().toString().replace("-", "").substring(0, 30);
-		RepositoryEntry re = deployRawCourseFromZIP(courseFile, softKey, 1);
+		RepositoryEntry re = deployRawCourseFromZIP(courseFile, softKey);
 		Assert.assertNotNull(re);
 		return re;
 	}
@@ -314,7 +315,7 @@ public class PublishProcessTest extends OlatTestCase {
 	 * @param access
 	 * @return
 	 */
-	private RepositoryEntry deployRawCourseFromZIP(File exportedCourseZIPFile, String softKey, int access) {
+	private RepositoryEntry deployRawCourseFromZIP(File exportedCourseZIPFile, String softKey) {
 		// create the course instance
 		OLATResource newCourseResource = olatResourceManager.createOLATResourceInstance(CourseModule.class);
 		ICourse course = CourseFactory.importCourseFromZip(newCourseResource, exportedCourseZIPFile);
@@ -333,11 +334,13 @@ public class PublishProcessTest extends OlatTestCase {
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		RepositoryEntry re = repositoryService.create(null, importExport.getInitialAuthor(), importExport.getResourceName(),
-				importExport.getDisplayName(), importExport.getDescription(), newCourseResource, 0, defOrganisation);
+				importExport.getDisplayName(), importExport.getDescription(), newCourseResource,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		// ok, continue import
 		re.setSoftkey(softKey);
 		// set access configuration
-		re.setAccess(access);
+		//TODO repo was only 1
+		re.setEntryStatus(RepositoryEntryStatusEnum.preparation);
 		// save the repository entry
 		re = repositoryService.update(re);
 
diff --git a/src/test/java/org/olat/course/nodes/en/EnrollmentManagerConcurrentTest.java b/src/test/java/org/olat/course/nodes/en/EnrollmentManagerConcurrentTest.java
index 74ea25c83fd..f3b92257fee 100644
--- a/src/test/java/org/olat/course/nodes/en/EnrollmentManagerConcurrentTest.java
+++ b/src/test/java/org/olat/course/nodes/en/EnrollmentManagerConcurrentTest.java
@@ -79,6 +79,7 @@ import org.olat.course.run.userview.UserCourseEnvironmentImpl;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -173,7 +174,8 @@ public class EnrollmentManagerConcurrentTest extends OlatTestCase implements Win
 
 		OLATResource resource = resourceManager.createOLATResourceInstance(CourseModule.class);
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry addedEntry = repositoryService.create(null, "Ayanami", "-", "Enrollment test course 1", "A JUnit course", resource, 0, defOrganisation);
+		RepositoryEntry addedEntry = repositoryService.create(null, "Ayanami", "-", "Enrollment test course 1", "A JUnit course",
+				resource, RepositoryEntryStatusEnum.trash, defOrganisation);
 		CourseEnvironment cenv = CourseFactory.createCourse(addedEntry, "Test", "Test", "learningObjectives").getCourseEnvironment();
 		// 1. enroll wg1 user
 		IdentityEnvironment ienv = new IdentityEnvironment();
diff --git a/src/test/java/org/olat/gatling/AccessTransactionGatling.java b/src/test/java/org/olat/gatling/AccessTransactionGatling.java
index 5d4d6e2adaa..f57649df502 100644
--- a/src/test/java/org/olat/gatling/AccessTransactionGatling.java
+++ b/src/test/java/org/olat/gatling/AccessTransactionGatling.java
@@ -24,8 +24,10 @@ import java.util.List;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.commons.persistence.DB;
+import org.olat.core.commons.persistence.QueryBuilder;
 import org.olat.core.id.Identity;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.resource.OLATResource;
 import org.olat.resource.accesscontrol.ACService;
 import org.olat.resource.accesscontrol.Offer;
@@ -63,12 +65,12 @@ public class AccessTransactionGatling extends OlatTestCase {
 		List<AccessMethod> methods = acMethodManager.getAvailableMethodsByType(FreeAccessMethod.class);
 		AccessMethod method = methods.get(0);
 		
-		StringBuilder sb = new StringBuilder();
+		QueryBuilder sb = new QueryBuilder();
 		sb.append("select v from repositoryentry as v ")
 		  .append(" inner join fetch v.olatResource as ores")
 		  .append(" inner join fetch v.statistics as statistics")
-		  .append(" left join fetch v.lifecycle as lifecycle")
-		  .append(" where ores.resName='CourseModule' and v.access>=").append(RepositoryEntry.ACC_OWNERS);
+		  .append(" left join fetch v.lifecycle as lifecycle")//TODO repo access
+		  .append(" where ores.resName='CourseModule' and v.status ").in(RepositoryEntryStatusEnum.preparationToClosed());
 		
 		List<RepositoryEntry> courses= dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
diff --git a/src/test/java/org/olat/ims/qti/statistics/manager/QTIStatisticsManagerLargeTest.java b/src/test/java/org/olat/ims/qti/statistics/manager/QTIStatisticsManagerLargeTest.java
index 5729e3be46b..71bdfc64382 100644
--- a/src/test/java/org/olat/ims/qti/statistics/manager/QTIStatisticsManagerLargeTest.java
+++ b/src/test/java/org/olat/ims/qti/statistics/manager/QTIStatisticsManagerLargeTest.java
@@ -55,6 +55,7 @@ import org.olat.ims.qti.statistics.model.StatisticAssessment;
 import org.olat.ims.qti.statistics.model.StatisticsItem;
 import org.olat.ims.resources.IMSEntityResolver;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -353,7 +354,8 @@ public class QTIStatisticsManagerLargeTest extends OlatTestCase {
 		dbInstance.intermediateCommit();
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry d = repositoryService.create(null, "Kanu Unchou", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r, 0, defOrganisation);
+		RepositoryEntry d = repositoryService.create(null, "Kanu Unchou", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry",
+				r, RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.saveObject(d);
 		dbInstance.intermediateCommit();
 		return d;
diff --git a/src/test/java/org/olat/modules/coach/manager/CoachingDAOTest.java b/src/test/java/org/olat/modules/coach/manager/CoachingDAOTest.java
index f6b712c955d..79cd11284e1 100644
--- a/src/test/java/org/olat/modules/coach/manager/CoachingDAOTest.java
+++ b/src/test/java/org/olat/modules/coach/manager/CoachingDAOTest.java
@@ -54,6 +54,7 @@ import org.olat.modules.coach.model.StudentStatEntry;
 import org.olat.modules.coach.ui.UserListController;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRef;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
@@ -470,9 +471,12 @@ public class CoachingDAOTest extends OlatTestCase {
 	public void getStatistics_permissionOnCourses()
 	throws URISyntaxException {
 		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1", RepositoryEntry.ACC_OWNERS, courseUrl);
-		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2", RepositoryEntry.ACC_OWNERS_AUTHORS, courseUrl);
-		RepositoryEntry re3 = JunitTestHelper.deployCourse(null, "Coaching course 3", RepositoryEntry.ACC_USERS, courseUrl);
+		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1",
+				RepositoryEntryStatusEnum.preparation, false, false, courseUrl);
+		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2",
+				RepositoryEntryStatusEnum.review, false, false, courseUrl);
+		RepositoryEntry re3 = JunitTestHelper.deployCourse(null, "Coaching course 3",
+				RepositoryEntryStatusEnum.published, true, false, courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -956,12 +960,15 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void isCoach_notPermitted() throws URISyntaxException {
 		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", RepositoryEntry.ACC_OWNERS, courseUrl);
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course",
+				RepositoryEntryStatusEnum.published, false, false, courseUrl);
 		dbInstance.commitAndCloseSession();
 	
 		//owner of course
 		Identity courseOwner = JunitTestHelper.createAndPersistIdentityAsRndUser("Coach-1");
+		Identity courseParticipant = JunitTestHelper.createAndPersistIdentityAsRndUser("Participant-1");
 		repositoryService.addRole(courseOwner, re, GroupRoles.owner.name());
+		repositoryService.addRole(courseParticipant, re, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
 
 		//coach in a group of the course
@@ -974,7 +981,9 @@ public class CoachingDAOTest extends OlatTestCase {
 		boolean canCourseCoach = coachingDAO.isCoach(courseOwner);
 		Assert.assertTrue(canCourseCoach);
 		boolean canGroupCoach = coachingDAO.isCoach(groupCoach);
-		Assert.assertFalse(canGroupCoach);
+		Assert.assertTrue(canGroupCoach);
+		boolean canCourseParticipant= coachingDAO.isCoach(courseParticipant);
+		Assert.assertFalse(canCourseParticipant);
 	}
 	
 	private StudentStatEntry getStudentStatEntry(IdentityRef identity, List<StudentStatEntry> entries) {
diff --git a/src/test/java/org/olat/modules/forms/manager/EvaluationFormTestsHelper.java b/src/test/java/org/olat/modules/forms/manager/EvaluationFormTestsHelper.java
index 085c54b8389..2eceeccc276 100644
--- a/src/test/java/org/olat/modules/forms/manager/EvaluationFormTestsHelper.java
+++ b/src/test/java/org/olat/modules/forms/manager/EvaluationFormTestsHelper.java
@@ -31,6 +31,7 @@ import org.olat.modules.forms.EvaluationFormSession;
 import org.olat.modules.forms.EvaluationFormSurvey;
 import org.olat.modules.forms.handler.EvaluationFormResource;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -97,7 +98,7 @@ public class EvaluationFormTestsHelper {
 		EvaluationFormResource ores = new EvaluationFormResource();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
 		Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser(UUID.randomUUID().toString());
-		return repositoryService.create(author, null, "", "Display name", "Description", resource, RepositoryEntry.ACC_OWNERS, null);
+		return repositoryService.create(author, null, "", "Display name", "Description", resource, RepositoryEntryStatusEnum.preparation, null);
 	}
 	
 	EvaluationFormSurvey createSurvey() {
diff --git a/src/test/java/org/olat/modules/iq/IQTestHelper.java b/src/test/java/org/olat/modules/iq/IQTestHelper.java
index 80940c6b2a3..fc6a0b5a74d 100644
--- a/src/test/java/org/olat/modules/iq/IQTestHelper.java
+++ b/src/test/java/org/olat/modules/iq/IQTestHelper.java
@@ -31,6 +31,7 @@ import org.olat.core.id.Organisation;
 import org.olat.ims.qti.QTIResult;
 import org.olat.ims.qti.QTIResultSet;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -106,8 +107,8 @@ public class IQTestHelper extends OlatTestCase {
 		dbInstance.commit();
 		
 		Organisation defOrganisation = CoreSpringFactory.getImpl(OrganisationService.class).getDefaultOrganisation();
-		RepositoryEntry d = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(null, "Rei Ayanami", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r, 0, defOrganisation);
+		RepositoryEntry d = CoreSpringFactory.getImpl(RepositoryService.class).create(null, "Rei Ayanami", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r,
+						RepositoryEntryStatusEnum.trash, defOrganisation);
 		d.setOlatResource(r);
 		dbInstance.getCurrentEntityManager().persist(d);
 		dbInstance.commit();
diff --git a/src/test/java/org/olat/modules/portfolio/manager/PortfolioServiceTest.java b/src/test/java/org/olat/modules/portfolio/manager/PortfolioServiceTest.java
index 91d6a3d3cbf..da9dbcd9aed 100644
--- a/src/test/java/org/olat/modules/portfolio/manager/PortfolioServiceTest.java
+++ b/src/test/java/org/olat/modules/portfolio/manager/PortfolioServiceTest.java
@@ -52,6 +52,7 @@ import org.olat.modules.portfolio.model.PageImpl;
 import org.olat.modules.portfolio.model.SectionImpl;
 import org.olat.modules.portfolio.model.SynchedBinder;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.test.JunitTestHelper;
@@ -903,14 +904,6 @@ public class PortfolioServiceTest extends OlatTestCase {
 		dbInstance.commitAndCloseSession();
 	}
 	
-	private RepositoryEntry createTemplate(Identity initialAuthor, String displayname, String description) {
-		OLATResource resource = portfolioService.createBinderTemplateResource();
-		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
-		portfolioService.createAndPersistBinderTemplate(initialAuthor, re, Locale.ENGLISH);
-		return re;
-	}
-	
 	@Test
 	public void deleteBinder() {
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("del-binder-");
@@ -1206,6 +1199,18 @@ public class PortfolioServiceTest extends OlatTestCase {
 		// the media
 		Media reloadedPermanentMedia = portfolioService.getMediaByKey(permanentMedia.getKey());
 		Assert.assertNotNull(reloadedPermanentMedia);
-		
+	}
+	
+	private RepositoryEntry createTemplate(Identity initialAuthor,  String displayname, String description) {
+		return createTemplate(initialAuthor, RepositoryEntryStatusEnum.preparation, displayname, description);
+	}
+	
+	private RepositoryEntry createTemplate(Identity initialAuthor, RepositoryEntryStatusEnum status, String displayname, String description) {
+		OLATResource resource = portfolioService.createBinderTemplateResource();
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description,
+				resource, status, defOrganisation);
+		portfolioService.createAndPersistBinderTemplate(initialAuthor, re, Locale.ENGLISH);
+		return re;
 	}
 }
diff --git a/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java b/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
index df8eb7d1245..209713517bf 100644
--- a/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
+++ b/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
@@ -55,6 +55,7 @@ import org.olat.portfolio.model.structel.PortfolioStructure;
 import org.olat.portfolio.model.structel.PortfolioStructureMap;
 import org.olat.portfolio.model.structel.StructureStatusEnum;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.test.JunitTestHelper;
@@ -119,7 +120,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		//create a repository entry
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "template-1", "map-template-1", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "template-1", "map-template-1", resource,
+				RepositoryEntryStatusEnum.preparation, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		//create the template owned by ident1
 		PortfolioStructureMap templateEl = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(ident1, addedEntry);
@@ -209,7 +211,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		//create a repository entry
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource,
+				RepositoryEntryStatusEnum.preparation, defOrganisation);
 		//create the template owned by ident1
 		PortfolioStructureMap templateEl = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(ident1, addedEntry);
 		//create five pages
@@ -472,7 +475,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		
 		//create a repository entry
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "test repo", "desc repo", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "test repo", "desc repo", resource,
+				RepositoryEntryStatusEnum.preparation, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		//create the template owned by ident1
@@ -501,7 +505,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		//create a repository entry
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource,
+				RepositoryEntryStatusEnum.preparation, defOrganisation);
 		//create the template owned by ident1
 		PortfolioStructureMap template = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(ident1, addedEntry);
 		dbInstance.commitAndCloseSession();
@@ -810,7 +815,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(id, null, "", "Template to delete", "", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
+		RepositoryEntry re = repositoryService.create(id, null, "", "Template to delete", "", resource,
+				RepositoryEntryStatusEnum.preparation, defOrganisation);
 		PortfolioStructureMap template = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(id, re);
 		PortfolioStructure page = epFrontendManager.createAndPersistPortfolioPage(template, "Page while be deleted", "Page description");
 		dbInstance.commitAndCloseSession();
diff --git a/src/test/java/org/olat/portfolio/manager/EPStructureManagerTest.java b/src/test/java/org/olat/portfolio/manager/EPStructureManagerTest.java
index 3b577b597d7..e060123bd97 100644
--- a/src/test/java/org/olat/portfolio/manager/EPStructureManagerTest.java
+++ b/src/test/java/org/olat/portfolio/manager/EPStructureManagerTest.java
@@ -57,6 +57,7 @@ import org.olat.portfolio.model.structel.PortfolioStructure;
 import org.olat.portfolio.model.structel.PortfolioStructureMap;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
@@ -723,7 +724,8 @@ public class EPStructureManagerTest extends OlatTestCase {
 		epStructureManager.fillStructureElement(el, title, description);
 
 		//create a repository entry with default security settings
-		RepositoryEntry re = repositoryService.create(identity, null, "-", title, null, el.getOlatResource(), RepositoryEntry.ACC_OWNERS, defOrganisation);
+		RepositoryEntry re = repositoryService.create(identity, null, "-", title, null, el.getOlatResource(),
+				RepositoryEntryStatusEnum.preparation, defOrganisation);
 				
 		dbInstance.commit();
 		
diff --git a/src/test/java/org/olat/repository/RepositoryManagerTest.java b/src/test/java/org/olat/repository/RepositoryManagerTest.java
index ac86f9f66ee..b1373d77aa8 100644
--- a/src/test/java/org/olat/repository/RepositoryManagerTest.java
+++ b/src/test/java/org/olat/repository/RepositoryManagerTest.java
@@ -26,7 +26,6 @@
 
 package org.olat.repository;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
@@ -112,7 +111,8 @@ public class RepositoryManagerTest extends OlatTestCase {
 			dbInstance.getCurrentEntityManager().persist(r);
 
 			Organisation defOrganisation = organisationService.getDefaultOrganisation();
-			RepositoryEntry d = repositoryService.create(null, "Florian Gnägi", "Lernen mit OpenOLAT", "JunitTest_RepositoryEntry", "Beschreibung", r, 0, defOrganisation);
+			RepositoryEntry d = repositoryService.create(null, "Florian Gnägi", "Lernen mit OpenOLAT", "JunitTest_RepositoryEntry", "Beschreibung",
+					r, RepositoryEntryStatusEnum.trash, defOrganisation);
 			
 			dbInstance.commit();
 			Assert.assertNotNull(d);
@@ -226,8 +226,8 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@Test
 	public void queryByOwner_replaceQueryByEditor() {
 		//create a repository entry with an owner
-		Identity owner = JunitTestHelper.createAndPersistIdentityAsUser("re-owner-la-" + UUID.randomUUID().toString());
-		Identity participant = JunitTestHelper.createAndPersistIdentityAsUser("re-participant-la-" + UUID.randomUUID().toString());
+		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("re-owner-la-");
+		Identity participant = JunitTestHelper.createAndPersistIdentityAsRndUser("re-participant-la-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		dbInstance.commitAndCloseSession();
 		repositoryEntryRelationDao.addRole(owner, re, GroupRoles.owner.name());
@@ -247,8 +247,8 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@Test
 	public void queryByOwner() {
 		//create a repository entry with an owner
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-owner-la-" + UUID.randomUUID().toString());
-		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-owner-la-");
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(null);
 		dbInstance.commitAndCloseSession();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commitAndCloseSession();
@@ -258,7 +258,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 		Assert.assertEquals(1, entries.size());
 		Assert.assertTrue(entries.contains(re));
 		
-		List<RepositoryEntry> entriesAlt = repositoryManager.queryByMembership(id, true, false, false);
+		List<RepositoryEntry> entriesAlt = repositoryManager.queryByMembership(id, true, false, false, "CourseModule");
 		Assert.assertNotNull(entriesAlt);
 		Assert.assertEquals(1, entriesAlt.size());
 		Assert.assertTrue(entriesAlt.contains(re));
@@ -267,42 +267,42 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@Test
 	public void queryByMembership() {
 		//create a 4 repository entries with different memberships
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-participant-la-" + UUID.randomUUID().toString());
-		RepositoryEntry reOwner = JunitTestHelper.createAndPersistRepositoryEntry();
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-participant-la-");
+		RepositoryEntry reOwner = JunitTestHelper.deployBasicCourse(null);
 		repositoryEntryRelationDao.addRole(id, reOwner, GroupRoles.owner.name());
-		RepositoryEntry reCoach = JunitTestHelper.createAndPersistRepositoryEntry();
+		RepositoryEntry reCoach = JunitTestHelper.deployBasicCourse(null);
 		repositoryEntryRelationDao.addRole(id, reCoach, GroupRoles.coach.name());
-		RepositoryEntry reParticipant = JunitTestHelper.createAndPersistRepositoryEntry();
+		RepositoryEntry reParticipant = JunitTestHelper.deployBasicCourse(null);
 		repositoryEntryRelationDao.addRole(id, reParticipant, GroupRoles.participant.name());
-		RepositoryEntry reOut = JunitTestHelper.createAndPersistRepositoryEntry();
+		RepositoryEntry reOut = JunitTestHelper.deployBasicCourse(null);
 		Assert.assertNotNull(reOut);//add some noise
 		dbInstance.commitAndCloseSession();
 		
 		//check single membership
-		List<RepositoryEntry> ownedEntries = repositoryManager.queryByMembership(id, true, false, false);
+		List<RepositoryEntry> ownedEntries = repositoryManager.queryByMembership(id, true, false, false, "CourseModule");
 		Assert.assertNotNull(ownedEntries);
 		Assert.assertEquals(1, ownedEntries.size());
 		Assert.assertTrue(ownedEntries.contains(reOwner));
 		
-		List<RepositoryEntry> coachedEntries = repositoryManager.queryByMembership(id, false, true, false);
+		List<RepositoryEntry> coachedEntries = repositoryManager.queryByMembership(id, false, true, false, "CourseModule");
 		Assert.assertNotNull(coachedEntries);
 		Assert.assertEquals(1, coachedEntries.size());
 		Assert.assertTrue(coachedEntries.contains(reCoach));
 		
-		List<RepositoryEntry> participatingEntries = repositoryManager.queryByMembership(id, false, false, true);
+		List<RepositoryEntry> participatingEntries = repositoryManager.queryByMembership(id, false, false, true, "CourseModule");
 		Assert.assertNotNull(participatingEntries);
 		Assert.assertEquals(1, participatingEntries.size());
 		Assert.assertTrue(participatingEntries.contains(reParticipant));
 		
 		//check 2x membership
-		List<RepositoryEntry> doubleEntries = repositoryManager.queryByMembership(id, true, true, false);
+		List<RepositoryEntry> doubleEntries = repositoryManager.queryByMembership(id, true, true, false, "CourseModule");
 		Assert.assertNotNull(doubleEntries);
 		Assert.assertEquals(2, doubleEntries.size());
 		Assert.assertTrue(doubleEntries.contains(reOwner));
 		Assert.assertTrue(doubleEntries.contains(reCoach));
 		
 		//check 3x membership
-		List<RepositoryEntry> tripleEntries = repositoryManager.queryByMembership(id, true, true, true);
+		List<RepositoryEntry> tripleEntries = repositoryManager.queryByMembership(id, true, true, true, "CourseModule");
 		Assert.assertNotNull(tripleEntries);
 		Assert.assertEquals(3, tripleEntries.size());
 		Assert.assertTrue(tripleEntries.contains(reOwner));
@@ -310,7 +310,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 		Assert.assertTrue(tripleEntries.contains(reParticipant));
 		
 		//dummy
-		List<RepositoryEntry> noEntries = repositoryManager.queryByMembership(id, false, false, false);
+		List<RepositoryEntry> noEntries = repositoryManager.queryByMembership(id, false, false, false, "CourseModule");
 		Assert.assertNotNull(noEntries);
 		Assert.assertTrue(noEntries.isEmpty());
 	}
@@ -344,7 +344,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getLearningResourcesAsStudent() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-stud-la-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-stud-la-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry(true);
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
@@ -358,14 +358,15 @@ public class RepositoryManagerTest extends OlatTestCase {
 		for(RepositoryEntry entry:entries) {
 			Assert.assertTrue(duplicates.add(entry.getKey()));
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
 	
 	@Test
 	public void getLearningResourcesAsStudentWithGroups() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-stud-lb-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-stud-lb-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		BusinessGroup group = businessGroupService.createBusinessGroup(null, "studg", "tg", null, null, false, false, re);
 	    businessGroupRelationDao.addRole(id, group, GroupRoles.participant.name());
@@ -376,11 +377,36 @@ public class RepositoryManagerTest extends OlatTestCase {
 		Assert.assertFalse(entries.isEmpty());
 		Assert.assertTrue(entries.contains(re));
 		
-		Set<Long> duplicates = new HashSet<Long>();
+		Set<Long> duplicates = new HashSet<>();
+		for(RepositoryEntry entry:entries) {
+			Assert.assertTrue(duplicates.add(entry.getKey()));
+			if(!entry.equals(re)) {
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
+			}
+		}
+	}
+	
+	@Test
+	public void getLearningResourcesAsParticipantAndCoach() {
+		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("re-stud-lb-");
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-stud-lb-");
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(owner);
+		BusinessGroup group = businessGroupService.createBusinessGroup(owner, "studg", "tg", null, null, false, false, re);
+	    businessGroupRelationDao.addRole(id, group, GroupRoles.participant.name());
+		dbInstance.commitAndCloseSession();
+
+		List<RepositoryEntry> entries = repositoryManager.getLearningResourcesAsParticipantAndCoach(id, "CourseModule");
+		Assert.assertNotNull(entries);
+		Assert.assertFalse(entries.isEmpty());
+		Assert.assertTrue(entries.contains(re));
+		
+		Set<Long> duplicates = new HashSet<>();
 		for(RepositoryEntry entry:entries) {
 			Assert.assertTrue(duplicates.add(entry.getKey()));
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
@@ -410,7 +436,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 		RepositoryEntry course = JunitTestHelper.deployBasicCourse(owner);
 		markManager.setMark(course, participant, null, "[RepositoryEntry:" + course.getKey() + "]");
 		dbInstance.commitAndCloseSession();
-		repositoryManager.setAccess(course, RepositoryEntry.ACC_OWNERS, false);
+		repositoryManager.setAccess(course, RepositoryEntryStatusEnum.preparation, false, false);
 		dbInstance.commitAndCloseSession();
 		
 		//participant bookmarks
@@ -422,7 +448,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getParticipantRepositoryEntry() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-stud-lc-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-stud-lc-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry(true);
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
@@ -439,9 +465,10 @@ public class RepositoryManagerTest extends OlatTestCase {
 				found = true;
 			}
 		
-			if(entry.getAccess() >= RepositoryEntry.ACC_USERS) {
+			if(entry.isAllUsers()) {
 				//OK
-			} else if(entry.getAccess() == RepositoryEntry.ACC_OWNERS && entry.isMembersOnly()) {
+			} else if(entry.getEntryStatus() == RepositoryEntryStatusEnum.published
+					|| entry.getEntryStatus() == RepositoryEntryStatusEnum.closed) {
 				RepositoryEntry reloadedRe = repositoryManager.lookupRepositoryEntry(entry.getKey());
 				boolean member = repositoryEntryRelationDao.hasRole(id, reloadedRe, GroupRoles.participant.name());
 				Assert.assertTrue(member);
@@ -455,7 +482,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getParticipantRepositoryEntryWithGroups() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-stud-ld-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-stud-ld-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		BusinessGroup group = businessGroupService.createBusinessGroup(null, "studh", "th", null, null, false, false, re);
 	    businessGroupRelationDao.addRole(id, group, GroupRoles.participant.name());
@@ -480,7 +507,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getLearningResourcesAsTeacher() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-teac-la-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-teac-la-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.coach.name());
 		dbInstance.commitAndCloseSession();
@@ -494,14 +521,15 @@ public class RepositoryManagerTest extends OlatTestCase {
 		for(RepositoryEntry entry:entries) {
 			Assert.assertTrue(duplicates.add(entry.getKey()));
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
 	
 	@Test
 	public void getLearningResourcesAsTeacherWithGroups() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-teac-lb-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-teac-lb-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		BusinessGroup group = businessGroupService.createBusinessGroup(null, "teacherg", "tg", null, null, false, false, re);
 	    businessGroupRelationDao.addRole(id, group, GroupRoles.coach.name());
@@ -516,14 +544,15 @@ public class RepositoryManagerTest extends OlatTestCase {
 		for(RepositoryEntry entry:entries) {
 			Assert.assertTrue(duplicates.add(entry.getKey()));
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
 	
 	@Test
 	public void getFavoritLearningResourcesAsTeacher() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-fav-1-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-fav-1-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		markManager.setMark(re, id, null, "[RepositoryEntry:" + re.getKey() + "]");
 		dbInstance.commitAndCloseSession();
@@ -549,67 +578,9 @@ public class RepositoryManagerTest extends OlatTestCase {
 		Assert.assertEquals(1, countEntries);
 	}
 	
-	@Test
-	public void getTutorRepositoryEntry() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-stud-le-" + UUID.randomUUID().toString());
-		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry(true);
-		repositoryEntryRelationDao.addRole(id, re, GroupRoles.coach.name());
-		dbInstance.commitAndCloseSession();
-
-		List<RepositoryEntryLight> entries = repositoryManager.getTutorRepositoryEntry(id, -1, RepositoryEntryOrder.nameAsc);
-		Assert.assertNotNull(entries);
-		Assert.assertFalse(entries.isEmpty());
-		
-		boolean found = false;
-		Set<Long> duplicates = new HashSet<Long>();
-		for(RepositoryEntryLight entry:entries) {
-			Assert.assertTrue(duplicates.add(entry.getKey()));
-			if(entry.getKey().equals(re.getKey())) {
-				found = true;
-			}
-		
-			if(entry.getAccess() >= RepositoryEntry.ACC_USERS) {
-				//OK
-			} else if(entry.getAccess() == RepositoryEntry.ACC_OWNERS && entry.isMembersOnly()) {
-				RepositoryEntry reloadedRe = repositoryManager.lookupRepositoryEntry(entry.getKey());
-				boolean member = repositoryEntryRelationDao.hasRole(id, reloadedRe, GroupRoles.coach.name());
-				Assert.assertTrue(member);
-			} else {
-				Assert.fail();
-			}
-		}
-		
-		Assert.assertTrue(found);
-	}
-	
-	@Test
-	public void getTutorRepositoryEntryWithGroups() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-stud-lf-" + UUID.randomUUID().toString());
-		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
-		BusinessGroup group = businessGroupService.createBusinessGroup(null, "studi", "ti", null, null, false, false, re);
-	    businessGroupRelationDao.addRole(id, group, GroupRoles.coach.name());
-		dbInstance.commitAndCloseSession();
-
-		List<RepositoryEntryLight> entries = repositoryManager.getTutorRepositoryEntry(id, -1);
-		Assert.assertNotNull(entries);
-		Assert.assertFalse(entries.isEmpty());
-		
-		boolean found = false;
-		Set<Long> duplicates = new HashSet<Long>();
-		for(RepositoryEntryLight entry:entries) {
-			Assert.assertTrue(duplicates.add(entry.getKey()));
-			
-			if(entry.getKey().equals(re.getKey())) {
-				found = true;
-			}
-		}
-		
-		Assert.assertTrue(found);
-	}
-	
 	@Test
 	public void getFavoritLearningResourcesAsTeacher_restrictedTypes() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-fav-1-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-fav-1-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		markManager.setMark(re, id, null, "[RepositoryEntry:" + re.getKey() + "]");
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.coach.name());
@@ -629,7 +600,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getFavoritLearningResourcesAsTeacher_negativeTypes() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-fav-1-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-fav-1-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		markManager.setMark(re, id, null, "[RepositoryEntry:" + re.getKey() + "]");
 		dbInstance.commitAndCloseSession();
@@ -647,7 +618,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	
 	@Test
 	public void queryResourcesLimitType() {
-		Identity id = JunitTestHelper.createAndPersistIdentityAsUser("re-member-lc-" + UUID.randomUUID().toString());
+		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("re-member-lc-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		dbInstance.commitAndCloseSession();
 		
@@ -677,8 +648,8 @@ public class RepositoryManagerTest extends OlatTestCase {
 			
 			// now make a repository entry for this course
 			Organisation defOrganisation = organisationService.getDefaultOrganisation();
-			RepositoryEntry re = repositoryService.create(owner, null,
-					"Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "yo man description bla bla + i", r, RepositoryEntry.ACC_OWNERS_AUTHORS, defOrganisation);			
+			RepositoryEntry re = repositoryService.create(owner, null, "Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "yo man description bla bla + i",
+					r, RepositoryEntryStatusEnum.review, defOrganisation);			
 			if ((i % 2 > 0)) {
 				re.setCanReference(true);
 			}
@@ -716,7 +687,7 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@Test
 	public void countLearningResourcesAsOwner() {
 		//create a repository entry with an owner and a participant
-		Identity owner = JunitTestHelper.createAndPersistIdentityAsUser("re-owner-is-" + UUID.randomUUID().toString());
+		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("re-owner-is-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		dbInstance.commitAndCloseSession();
 		repositoryEntryRelationDao.addRole(owner, re, GroupRoles.owner.name());
@@ -730,14 +701,14 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@Test
 	public void countLearningResourcesAsStudent() {
 		//create a repository entry with an owner and a participant
-		Identity owner = JunitTestHelper.createAndPersistIdentityAsUser("re-participant-is-" + UUID.randomUUID().toString());
-		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
+		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("re-participant-is-");
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(owner);
 		dbInstance.commitAndCloseSession();
 		repositoryEntryRelationDao.addRole(owner, re, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
 		
 		//check
-		int count = repositoryManager.countLearningResourcesAsStudent(owner);
+		int count = repositoryManager.countLearningResourcesAsStudent(owner, "CourseModule");
 		Assert.assertTrue(1 <= count);
 	}
 	
@@ -745,12 +716,12 @@ public class RepositoryManagerTest extends OlatTestCase {
 	public void getRepositoryentryMembership() {
 		//create a repository entry with an owner and a participant
 		Identity admin = securityManager.findIdentityByName("administrator");
-		Identity id1 = JunitTestHelper.createAndPersistIdentityAsUser("re-m-is-" + UUID.randomUUID().toString());
-		Identity id2 = JunitTestHelper.createAndPersistIdentityAsUser("re-m-is-" + UUID.randomUUID().toString());
-		Identity id3 = JunitTestHelper.createAndPersistIdentityAsUser("re-m-is-" + UUID.randomUUID().toString());
-		Identity id4 = JunitTestHelper.createAndPersistIdentityAsUser("re-m-is-" + UUID.randomUUID().toString());
-		Identity id5 = JunitTestHelper.createAndPersistIdentityAsUser("re-m-is-" + UUID.randomUUID().toString());
-		Identity id6 = JunitTestHelper.createAndPersistIdentityAsUser("re-m-is-" + UUID.randomUUID().toString());
+		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("re-m-is1-");
+		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("re-m-is2-");
+		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("re-m-is3-");
+		Identity id4 = JunitTestHelper.createAndPersistIdentityAsRndUser("re-m-is4-");
+		Identity id5 = JunitTestHelper.createAndPersistIdentityAsRndUser("re-m-is5-");
+		Identity id6 = JunitTestHelper.createAndPersistIdentityAsRndUser("re-m-is6-");
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry();
 		dbInstance.commitAndCloseSession();
 		if(repositoryEntryRelationDao.hasRole(admin, re, GroupRoles.owner.name())) {
@@ -830,16 +801,16 @@ public class RepositoryManagerTest extends OlatTestCase {
 		String TYPE = UUID.randomUUID().toString().replace("-", "");
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("re-gen-1");
 		
-		int count = repositoryManager.countByTypeLimitAccess("unkown", RepositoryEntry.ACC_OWNERS_AUTHORS);
-		assertEquals("Unkown type must return 0 elements", 0,count);
-		int countValueBefore = repositoryManager.countByTypeLimitAccess(TYPE, RepositoryEntry.ACC_OWNERS_AUTHORS);
+		int count = repositoryManager.countByType("unkown");
+		Assert.assertEquals("Unkown type must return 0 elements", 0,count);
+		int countValueBefore = repositoryManager.countByType(TYPE);
 		// add 1 entry
 		RepositoryEntry re = createRepositoryEntry(TYPE, owner, 999999l);
 		// create security group
 		repositoryService.update(re);
-		count = repositoryManager.countByTypeLimitAccess(TYPE, RepositoryEntry.ACC_OWNERS_AUTHORS);
+		count = repositoryManager.countByType(TYPE);
 		// check count must be one more element
-		assertEquals("Add one course repository-entry, but countByTypeLimitAccess does NOT return one more element", countValueBefore + 1,count);
+		Assert.assertEquals("Add one course repository-entry, but countByTypeLimitAccess does NOT return one more element", countValueBefore + 1,count);
 	}
 	
 	@Test
@@ -1034,14 +1005,15 @@ public class RepositoryManagerTest extends OlatTestCase {
 	@Test
 	public void lazyLoadingCheck() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "",
+				null, RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		RepositoryEntryLifecycle cycle = lifecycleDao.create("New cycle 1", "New cycle soft 1", false, new Date(), new Date());
 		re = repositoryManager.setDescriptionAndName(re, "Updated repo entry", null, null, "", null, null, null, null, null, null, cycle, null);
 		dbInstance.commitAndCloseSession();
 		
-		RepositoryEntry lazyRe = repositoryManager.setAccess(re, 2, false);
+		RepositoryEntry lazyRe = repositoryManager.setAccess(re, RepositoryEntryStatusEnum.review, false, false);
 		dbInstance.commitAndCloseSession();
 		
 		try {// produce the exception
@@ -1065,9 +1037,8 @@ public class RepositoryManagerTest extends OlatTestCase {
 		
 		// now make a repository entry for this course
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		final RepositoryEntry re = repositoryService.create(owner, null,
+		return repositoryService.create(owner, null,
 				"Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "yo man description bla bla + i",
-				r, RepositoryEntry.ACC_OWNERS_AUTHORS, defOrganisation);
-		return re;
+				r, RepositoryEntryStatusEnum.review, defOrganisation);
 	}
 }
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java
index 156eae2042a..3f78515098f 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java
@@ -31,6 +31,7 @@ import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Organisation;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
@@ -59,7 +60,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void loadByKey() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 1", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 1", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 
@@ -71,7 +73,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void loadByResourceKey() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 2", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 2", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 
@@ -83,8 +86,10 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void loadByResourceKeys() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 3a", "", null, 0, defOrganisation);
-		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 3b", "", null, 0, defOrganisation);
+		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 3a", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 3b", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 
 		List<Long> resourceKeys = new ArrayList<>(2);
@@ -107,7 +112,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void searchByIdAndRefs() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 4", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 4", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		String externalId = UUID.randomUUID().toString();
 		String externalRef = UUID.randomUUID().toString();
@@ -156,7 +162,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void getAllRepositoryEntries() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 4", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 4", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 
@@ -169,7 +176,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void loadRepositoryEntryResource() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getSoftkey());
@@ -183,7 +191,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	@Test
 	public void loadRepositoryEntryResourceBySoftKey() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getSoftkey());
@@ -207,10 +216,12 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 		// insert test data
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 7a", "", null, 0, defOrganisation);
+		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 7a", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		re1.setExternalId(externalId);
 		repositoryService.update(re1);
-		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 7b", "", null, 0, defOrganisation);
+		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 7b", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		re2.setExternalId(externalId);
 		repositoryService.update(re2);
 		dbInstance.commitAndCloseSession();
@@ -238,10 +249,12 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 		// insert test data
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 8a", "", null, 0, defOrganisation);
+		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 8a", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		re1.setExternalRef(externalRef);
 		repositoryService.update(re1);
-		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 8b", "", null, 0, defOrganisation);
+		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 8b", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		re2.setExternalRef(externalRef);
 		repositoryService.update(re2);
 		dbInstance.commitAndCloseSession();
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryQueriesTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryQueriesTest.java
index 03bd0c880ec..7a8c33f772d 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryQueriesTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryQueriesTest.java
@@ -43,6 +43,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
@@ -141,38 +142,39 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		// generate some repo entries
 		int numbRes = 500;
 		for (int i = 0; i < numbRes; i++) {
-			
+
+			// create course and persist as OLATResourceImpl
 			
 			int rest = i%4;
-			int access = 0;
+			boolean guests = false;
+			boolean allUsers = false;
 			Identity owner = null;
 			switch(rest) {
 				case 0: {
-					access = RepositoryEntry.ACC_USERS_GUESTS;
+					guests = true;
+					allUsers = true;
 					owner = user1;
 					break;
 				}
 				case 1: {
-					access = RepositoryEntry.ACC_USERS;
+					allUsers = true;
 					owner = id2;
 					break;
 				}
 				case 2: {
-					access = RepositoryEntry.ACC_OWNERS;
 					owner = learnResourceManager1;
 					break;
 				}
 				case 3: {
-					access = RepositoryEntry.ACC_OWNERS;
 					owner = learnResourceManager2;
 					break;
 				}
 			}
-			
-			// create course and persist as OLATResourceImpl
-			RepositoryEntry re = createCourseRepositoryEntry(owner, i, organisation);
-			re.setAccess(access);
 
+			RepositoryEntry re = createCourseRepositoryEntry(owner, i, organisation);
+			re.setEntryStatus(RepositoryEntryStatusEnum.published);
+			re.setAllUsers(allUsers);
+			re.setGuests(guests);
 			repositoryService.update(re);
 			if (i % 20 == 0) {
 				dbInstance.commitAndCloseSession();
@@ -258,6 +260,7 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		
 		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters();
 		params.setRoles(Roles.administratorRoles());
+		params.setIdentity(owner);
 		params.setAuthor(owner.getName());
 		List<RepositoryEntry> myEntries = repositoryEntryQueries.searchEntries(params, 0, -1, true);
 		Assert.assertNotNull(myEntries);
@@ -270,6 +273,7 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		RepositoryEntry managedRe = JunitTestHelper.createAndPersistRepositoryEntry();
 		managedRe.setManagedFlagsString("all");
 		managedRe = dbInstance.getCurrentEntityManager().merge(managedRe);
+		Identity learnResourceManager = JunitTestHelper.createAndPersistIdentityAsRndLearnResourceManager("repo-admin");
 		RepositoryEntry freeRe = JunitTestHelper.createAndPersistRepositoryEntry();
 		dbInstance.commitAndCloseSession();
 		
@@ -277,6 +281,7 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		SearchRepositoryEntryParameters paramsManaged = new SearchRepositoryEntryParameters();
 		paramsManaged.setRoles(Roles.administratorRoles());
 		paramsManaged.setManaged(Boolean.TRUE);
+		paramsManaged.setIdentity(learnResourceManager);
 		List<RepositoryEntry> managedEntries = repositoryEntryQueries.searchEntries(paramsManaged, 0, -1, true);
 		Assert.assertNotNull(managedEntries);
 		Assert.assertTrue(managedEntries.size() > 0);
@@ -287,6 +292,7 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		SearchRepositoryEntryParameters paramsFree = new SearchRepositoryEntryParameters();
 		paramsFree.setRoles(Roles.administratorRoles());
 		paramsFree.setManaged(Boolean.FALSE);
+		paramsFree.setIdentity(learnResourceManager);
 		List<RepositoryEntry> freeEntries = repositoryEntryQueries.searchEntries(paramsFree, 0, -1, true);
 		Assert.assertNotNull(freeEntries);
 		Assert.assertTrue(freeEntries.size() > 0);
@@ -316,7 +322,7 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertFalse(entries1.contains(re1));
 		Assert.assertFalse(entries1.contains(re2));
 		for(RepositoryEntry entry:entries1) {
-			Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS_GUESTS);
+			Assert.assertTrue(entry.isAllUsers());
 		}
 		
 		//check for identity 1 (participant re2 + re1 accessible to all users)
@@ -330,7 +336,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries2.contains(re2));
 		for(RepositoryEntry entry:entries2) {
 			if(!entry.equals(re2)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 		
@@ -344,7 +351,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries3.contains(re1));
 		Assert.assertFalse(entries3.contains(re2));
 		for(RepositoryEntry entry:entries3) {
-			Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+			Assert.assertTrue(entry.isAllUsers());
+			Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 		}
 	}
 	
@@ -372,7 +380,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries1.contains(re));
 		for(RepositoryEntry entry:entries1) {
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 		
@@ -387,7 +396,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries2.contains(re));
 		for(RepositoryEntry entry:entries2) {
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 		
@@ -400,7 +410,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertNotNull(entries3);
 		Assert.assertFalse(entries3.contains(re));
 		for(RepositoryEntry entry:entries3) {
-			Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+			Assert.assertTrue(entry.isAllUsers());
+			Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 		}
 	}
 	
@@ -421,7 +432,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries.contains(re));
 		for(RepositoryEntry entry:entries) {
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
@@ -443,7 +455,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries.contains(re));
 		for(RepositoryEntry entry:entries) {
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
@@ -472,7 +485,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		Assert.assertTrue(entries.contains(re));
 		for(RepositoryEntry entry:entries) {
 			if(!entry.equals(re)) {
-				Assert.assertTrue(entry.getAccess() >= RepositoryEntry.ACC_USERS);
+				Assert.assertTrue(entry.isAllUsers());
+				Assert.assertTrue(entry.getEntryStatus().ordinal() >= RepositoryEntryStatusEnum.published.ordinal());
 			}
 		}
 	}
@@ -481,8 +495,8 @@ public class RepositoryEntryQueriesTest extends OlatTestCase {
 		OLATResource r =  resourceManager.createOLATResourceInstance(TEST_RES_NAME);
 		resourceManager.saveOLATResource(r);
 		// now make a repository entry for this course
-		RepositoryEntry re = repositoryService.create(owner, null,
-				"Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "Description of learning by OLAT " + i, r, RepositoryEntry.ACC_OWNERS, organisation);
+		RepositoryEntry re = repositoryService.create(owner, null, "Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i,
+				"Description of learning by OLAT " + i, r, RepositoryEntryStatusEnum.preparation, organisation);
 		return re;
 	}
 }
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java
index be42c9fb1b2..2eab8cef71e 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java
@@ -39,6 +39,7 @@ import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntryToGroupRelation;
 import org.olat.test.JunitTestHelper;
@@ -69,7 +70,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Test
 	public void getDefaultGroup() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		Group group = repositoryEntryRelationDao.getDefaultGroup(re);
@@ -80,7 +82,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void addRole() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("add-role-2-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
@@ -91,7 +94,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void hasRole() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("add-role-3-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commit();
@@ -106,7 +110,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void hasRole_admin() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndAdmin("admin-role-3-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		
 		boolean admin = repositoryEntryRelationDao.hasRole(id, re, true, OrganisationRoles.administrator.name());
@@ -117,7 +122,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getRoles() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("get-roles-1-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commit();
@@ -132,7 +138,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void removeRole() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("add-role-4-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commit();
@@ -157,7 +164,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-1-");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-2-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
@@ -188,7 +196,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getMembers_defaultGroup() {
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("owner-1-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(owner, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(owner, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		
 		List<Identity> owners = repositoryEntryRelationDao.getMembers(re, RepositoryEntryRelationType.defaultGroup, GroupRoles.owner.name());
@@ -204,8 +213,10 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-3-");
 		Identity id4 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-4-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
-		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami (alt)", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami (alt)", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re1, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re1, GroupRoles.participant.name());
@@ -241,7 +252,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-3-");
 		Identity id4 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-4-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
@@ -266,7 +278,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("enroll-date-1-");
 		Identity wid = JunitTestHelper.createAndPersistIdentityAsRndUser("not-enroll-date-1-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.participant.name());
@@ -297,7 +310,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("enroll-date-3-");
 		Identity wid = JunitTestHelper.createAndPersistIdentityAsRndUser("not-enroll-date-2-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
@@ -316,7 +330,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getEnrollmentDates_emptyCourse() {
 		//enrollment of an empty course
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry notEnrolledRe = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry notEnrolledRe = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		Map<Long,Date> notEnrollmentDates = repositoryEntryRelationDao.getEnrollmentDates(notEnrolledRe);
 		Assert.assertNotNull(notEnrollmentDates);
@@ -328,7 +343,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("auth-1-");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("part-2-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
@@ -600,7 +616,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getOrganisations() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationService.createOrganisation("Repo-org-1", null, null, defOrganisation, null);
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, organisation);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, organisation);
 		dbInstance.commitAndCloseSession();
 		
 		List<Organisation> organisations = repositoryEntryRelationDao.getOrganisations(re);
@@ -613,7 +630,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getRepositoryEntries() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationService.createOrganisation("Repo-org-1", null, null, defOrganisation, null);
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, organisation);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, organisation);
 		dbInstance.commitAndCloseSession();
 		
 		List<RepositoryEntry> entries = repositoryEntryRelationDao.getRepositoryEntries(organisation);
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java
index fb826dcf361..77997b54dcf 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java
@@ -42,6 +42,7 @@ import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntryStatistics;
@@ -77,7 +78,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	@Test
 	public void createRepositoryEntry() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Statistics", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Statistics", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getStatistics());
@@ -96,7 +98,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	public void updateRatingStatistics() {
 		//create an entry
 		Identity id = JunitTestHelper.createAndPersistIdentityAsAuthor("update-mark-");
-		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null, 0, null);
+		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null,
+				RepositoryEntryStatusEnum.trash, null);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getStatistics());
@@ -115,7 +118,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 		//create an entry
 		Identity id = JunitTestHelper.createAndPersistIdentityAsAuthor("update-comment-");
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getStatistics());
@@ -132,7 +136,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	@Test
 	public void incrementLaunchCounter() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf1", "T1_perf1", null, 0, defOrganisation);
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf1", "T1_perf1", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		
 		final Long keyRepo = repositoryEntry.getKey();
 		final OLATResourceable resourceable = repositoryEntry.getOlatResource();
@@ -164,7 +169,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	@Test
 	public void incrementLaunchCounter_setDescription() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf1b", "T1_perf1b", null, 0, defOrganisation);
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf1b", "T1_perf1b", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.closeSession();
 		
 		final Long keyRepo = repositoryEntry.getKey();
@@ -193,7 +199,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	@Test
 	public void incrementDownloadCounter() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf2", "T1_perf2", null, 0, defOrganisation);	
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf2", "T1_perf2", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);	
 		final Long keyRepo = repositoryEntry.getKey();
 		final OLATResourceable resourceable = repositoryEntry.getOlatResource();
 		assertNotNull(resourceable);
@@ -229,7 +236,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 		final int numberOfThreads = 3;
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		final RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_concurrent1", "T1_concurrent1", null, 0, defOrganisation);	
+		final RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_concurrent1", "T1_concurrent1", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);	
 		final Long keyRepo = repositoryEntry.getKey();
 		assertNotNull(repositoryEntry.getOlatResource());
 		dbInstance.commitAndCloseSession();
@@ -248,11 +256,15 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 						RepositoryEntry re = repositoryManager.lookupRepositoryEntry(keyRepo);
 						repositoryService.incrementLaunchCounter(re);
 						if (i % 20 == 0 ) {
-							re = repositoryManager.setAccess(re, 4, false);
-							assertEquals("Wrong access value", 4, re.getAccess());
+							re = repositoryManager.setAccess(re, RepositoryEntryStatusEnum.published, true, true);
+							Assert.assertEquals("Wrong access value", RepositoryEntryStatusEnum.published, re.getEntryStatus());
+							Assert.assertEquals("Wrong access value", true, re.isAllUsers());
+							Assert.assertEquals("Wrong access value", true, re.isGuests());
 						} else if (i % 10 == 0 ) {
-							re = repositoryManager.setAccess(re, 1, false);
-							assertEquals("Wrong access value", 1,re.getAccess());
+							re = repositoryManager.setAccess(re, RepositoryEntryStatusEnum.preparation, false, false);
+							Assert.assertEquals("Wrong access value", RepositoryEntryStatusEnum.preparation, re.getEntryStatus());
+							Assert.assertEquals("Wrong access value", false, re.isAllUsers());
+							Assert.assertEquals("Wrong access value", false, re.isGuests());
 						}
 						dbInstance.commitAndCloseSession();
 					}
@@ -312,17 +324,21 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 						RepositoryEntry re = repositoryManager.lookupRepositoryEntry(keyRepo);
 						repositoryService.incrementLaunchCounter(re);
 						if (i % 30 == 0 ) {
-							re = repositoryManager.setAccessAndProperties(re, 3, false, true, false, false);	
-							assertEquals("Wrong access value", 3, re.getAccess());
-							assertEquals("Wrong canCopy value", true, re.getCanCopy());
-							assertEquals("Wrong getCanReference value",false, re.getCanReference());
-							assertEquals("Wrong getCanDownload value", false, re.getCanDownload());
+							re = repositoryManager.setAccessAndProperties(re, RepositoryEntryStatusEnum.published, true, false, true, false, false);	
+							Assert.assertEquals("Wrong access value", RepositoryEntryStatusEnum.published, re.getEntryStatus());
+							Assert.assertEquals("Wrong access value", true, re.isAllUsers());
+							Assert.assertEquals("Wrong access value", false, re.isGuests());
+							Assert.assertEquals("Wrong canCopy value", true, re.getCanCopy());
+							Assert.assertEquals("Wrong getCanReference value",false, re.getCanReference());
+							Assert.assertEquals("Wrong getCanDownload value", false, re.getCanDownload());
 						} else 	if (i % 15 == 0 ) {
-							re = repositoryManager.setAccessAndProperties(re, 2,false, false, true, true);	
-							assertEquals("Wrong access value", 2, re.getAccess());
-							assertEquals("Wrong canCopy value", false, re.getCanCopy());
-							assertEquals("Wrong getCanReference value", true, re.getCanReference());
-							assertEquals("Wrong getCanDownload value", true, re.getCanDownload());
+							re = repositoryManager.setAccessAndProperties(re, RepositoryEntryStatusEnum.review, false, false, false, true, true);	
+							Assert.assertEquals("Wrong access value", RepositoryEntryStatusEnum.review, re.getEntryStatus());
+							Assert.assertEquals("Wrong access value", false, re.isAllUsers());
+							Assert.assertEquals("Wrong access value", false, re.isGuests());
+							Assert.assertEquals("Wrong canCopy value", false, re.getCanCopy());
+							Assert.assertEquals("Wrong getCanReference value", true, re.getCanReference());
+							Assert.assertEquals("Wrong getCanDownload value", true, re.getCanDownload());
 						}
 						dbInstance.commitAndCloseSession();
 					}
@@ -376,11 +392,11 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 		final List<Exception> exceptionHolder = Collections.synchronizedList(new ArrayList<Exception>(1));
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_concurrent3", "T1_concurrent3", null, 0, defOrganisation);	
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_concurrent3", "T1_concurrent3", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);	
 		final Long keyRepo = repositoryEntry.getKey();
 		final OLATResourceable resourceable = repositoryEntry.getOlatResource();
 		assertNotNull(resourceable);
-		final int access = 4;
 		dbInstance.closeSession();
 		assertEquals("Launch counter was not 0", 0, repositoryEntry.getStatistics().getLaunchCounter() );
 
@@ -404,6 +420,7 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 		
 		// thread 2
 		Thread thread2 = new Thread() {
+			@Override
 			public void run() {
 				try {
 					Thread.sleep(300);
@@ -420,11 +437,12 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 
 		// thread 3
 		Thread thread3 = new Thread() {
+			@Override
 			public void run() {
 				try {
 					Thread.sleep(200);
 					RepositoryEntry repositoryEntryT3 = repositoryManager.lookupRepositoryEntry(keyRepo);
-					repositoryEntryT3 = repositoryManager.setAccess(repositoryEntryT3, access, false);
+					repositoryEntryT3 = repositoryManager.setAccess(repositoryEntryT3, RepositoryEntryStatusEnum.published, true, true);
 					dbInstance.closeSession();
 					log.info("testConcurrentIncrementLaunchCounterWithCodePoints: Thread3 setAccess DONE");
 				} catch (Exception ex) {
@@ -448,7 +466,9 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 
 		RepositoryEntry repositoryEntry2 = repositoryManager.lookupRepositoryEntry(keyRepo);
 		assertEquals("Wrong value of incrementLaunch counter",2,repositoryEntry2.getStatistics().getDownloadCounter());
-		assertEquals("Wrong access value",access,repositoryEntry2.getAccess());
+		assertEquals("Wrong access value", RepositoryEntryStatusEnum.published, repositoryEntry2.getEntryStatus());
+		assertEquals("Wrong access value", true, repositoryEntry2.isAllUsers());
+		assertEquals("Wrong access value", true, repositoryEntry2.isGuests());
 		log.info("testConcurrentIncrementLaunchCounterWithCodePoints finish successful");		
 	}
 	
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java
index 8373bbe1a5a..ba4f06061aa 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java
@@ -29,6 +29,7 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Organisation;
 import org.olat.core.id.OrganisationRef;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryEntryToOrganisation;
 import org.olat.repository.RepositoryService;
 import org.olat.test.OlatTestCase;
@@ -57,7 +58,8 @@ public class RepositoryEntryToOrganisationDAOTest extends OlatTestCase {
 	public void createRelation() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationDao.createAndPersistOrganisation("Repo-org-1", null, null, null, null);
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		RepositoryEntryToOrganisation relation = repositoryEntryToOrganisationDao
@@ -70,7 +72,8 @@ public class RepositoryEntryToOrganisationDAOTest extends OlatTestCase {
 	public void getRelations() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationDao.createAndPersistOrganisation("Repo-org-2", null, null, null, null);
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel2", "rel2", null, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel2", "rel2", null, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		RepositoryEntryToOrganisation relation = repositoryEntryToOrganisationDao
 				.createRelation(organisation, re, true);
 		dbInstance.commitAndCloseSession();
@@ -86,7 +89,8 @@ public class RepositoryEntryToOrganisationDAOTest extends OlatTestCase {
 	public void getOrganisationReferences() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationDao.createAndPersistOrganisation("Repo-org-3", null, null, defOrganisation, null);
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel3", "rel3", null, null, 0, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel3", "rel3", null, null,
+				RepositoryEntryStatusEnum.trash, null);
 		repositoryEntryToOrganisationDao.createRelation(organisation, re, true);
 		dbInstance.commitAndCloseSession();
 		
@@ -101,7 +105,8 @@ public class RepositoryEntryToOrganisationDAOTest extends OlatTestCase {
 	public void deleteRelation() {
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationDao.createAndPersistOrganisation("Repo-org-4", null, null, defOrganisation, null);
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel4", "rel4", null, null, 0, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel4", "rel4", null, null,
+				RepositoryEntryStatusEnum.trash, null);
 		repositoryEntryToOrganisationDao.createRelation(organisation, re, true);
 		dbInstance.commitAndCloseSession();
 		
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryToTaxonomyLevelDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryToTaxonomyLevelDAOTest.java
index e83894c6e3b..9685fd929ad 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryToTaxonomyLevelDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryToTaxonomyLevelDAOTest.java
@@ -30,6 +30,7 @@ import org.olat.modules.taxonomy.TaxonomyLevel;
 import org.olat.modules.taxonomy.manager.TaxonomyDAO;
 import org.olat.modules.taxonomy.manager.TaxonomyLevelDAO;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryEntryToTaxonomyLevel;
 import org.olat.repository.RepositoryService;
 import org.olat.test.OlatTestCase;
@@ -56,7 +57,8 @@ public class RepositoryEntryToTaxonomyLevelDAOTest extends OlatTestCase {
 	
 	@Test
 	public void createRelation() {
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, null);
 		Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-400", "Leveled taxonomy", null, null);
 		TaxonomyLevel level = taxonomyLevelDao.createTaxonomyLevel("ID-Level-0", "My first taxonomy level", "A basic level", null, null, null, null, taxonomy);
 	
@@ -69,7 +71,8 @@ public class RepositoryEntryToTaxonomyLevelDAOTest extends OlatTestCase {
 	
 	@Test
 	public void createAndGetRelation() {
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, null);
 		
 		Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-401", "Leveled taxonomy", null, null);
 		TaxonomyLevel level = taxonomyLevelDao.createTaxonomyLevel("ID-Level-0", "My first taxonomy level", "A basic level", null, null, null, null, taxonomy);
@@ -87,7 +90,8 @@ public class RepositoryEntryToTaxonomyLevelDAOTest extends OlatTestCase {
 	
 	@Test
 	public void getTaxonomyLevels() {
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, null);
 		
 		Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-402", "Leveled taxonomy", null, null);
 		TaxonomyLevel level = taxonomyLevelDao.createTaxonomyLevel("ID-Level-0", "My first taxonomy level", "A basic level", null, null, null, null, taxonomy);
@@ -102,7 +106,8 @@ public class RepositoryEntryToTaxonomyLevelDAOTest extends OlatTestCase {
 	
 	@Test
 	public void getRepositoryEntries() {
-		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null,
+				RepositoryEntryStatusEnum.trash, null);
 		
 		Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-402", "Leveled taxonomy", null, null);
 		TaxonomyLevel level = taxonomyLevelDao.createTaxonomyLevel("ID-Level-0", "My first taxonomy level", "A basic level", null, null, null, null, taxonomy);
diff --git a/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java b/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java
index 9649aab3e99..b70eb1886bd 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java
@@ -39,6 +39,7 @@ import org.olat.repository.CatalogEntry;
 import org.olat.repository.ErrorList;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.olat.user.UserManager;
@@ -75,7 +76,8 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 		String resourceName = "ServiceTest";
 		String description = "Test the brand new service";
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		
 		Assert.assertNotNull(re);
@@ -92,7 +94,8 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 		String resourceName = "ServiceTest";
 		String description = "Test the brand new service";
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		
@@ -111,7 +114,7 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 		Assert.assertFalse(re.getCanCopy());
 		Assert.assertFalse(re.getCanDownload());
 		Assert.assertFalse(re.getCanReference());
-		Assert.assertEquals(0, re.getAccess());
+		Assert.assertEquals(RepositoryEntryStatusEnum.trash, re.getEntryStatus());
 	}
 	
 	@Test
@@ -170,7 +173,7 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 		
 		RepositoryEntry reloadEntry = repositoryService.loadByKey(re.getKey());
 		Assert.assertNotNull(reloadEntry);
-		Assert.assertEquals(0, reloadEntry.getAccess());
+		Assert.assertEquals(RepositoryEntryStatusEnum.trash, reloadEntry.getEntryStatus());
 		Assert.assertNotNull(reloadEntry.getDeletionDate());
 		Assert.assertEquals(initialAuthor, reloadEntry.getDeletedBy());
 	}
diff --git a/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java b/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java
index 21ce319d9cd..04e01a94bd8 100644
--- a/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java
+++ b/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java
@@ -44,6 +44,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
@@ -406,8 +407,9 @@ public class ACFrontendManagerTest extends OlatTestCase {
 		// now make a repository entry for this resource
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		RepositoryEntry re = repositoryService.create(null, "Florian Gnägi", "Access controlled by OLAT ",
-				"JunitRE" + UUID.randomUUID().toString().replace("-", ""), "Description", r, 0, defOrganisation);
-		re.setAccess(RepositoryEntry.ACC_OWNERS_AUTHORS);
+				"JunitRE" + UUID.randomUUID().toString().replace("-", ""), "Description",
+				r, RepositoryEntryStatusEnum.review, defOrganisation);
+		//TODO repo re.setAccess(RepositoryEntry.ACC_OWNERS_AUTHORS);
 		re = repositoryService.update(re);
 		dbInstance.commitAndCloseSession();
 		return re;
diff --git a/src/test/java/org/olat/resource/references/ReferenceManagerTest.java b/src/test/java/org/olat/resource/references/ReferenceManagerTest.java
index 9229a637e7d..276d73a6566 100644
--- a/src/test/java/org/olat/resource/references/ReferenceManagerTest.java
+++ b/src/test/java/org/olat/resource/references/ReferenceManagerTest.java
@@ -42,6 +42,7 @@ import org.olat.core.id.OLATResourceable;
 import org.olat.core.id.Organisation;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.manager.RepositoryEntryRelationDAO;
 import org.olat.resource.OLATResource;
@@ -216,9 +217,12 @@ public class ReferenceManagerTest extends OlatTestCase {
 		Identity admin = JunitTestHelper.createAndPersistIdentityAsRndAdmin("Asuka");
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry course1 = repositoryService.create(null,"Asuka Langley", "-", "Reference Manager course 1", "", null, 0, defOrganisation);
-		RepositoryEntry course2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 2", "", null, 0, defOrganisation);
-		RepositoryEntry test = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test ", "", null, 0, defOrganisation);
+		RepositoryEntry course1 = repositoryService.create(null,"Asuka Langley", "-", "Reference Manager course 1", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 2", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry test = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test ", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		// add the references
 		referenceManager.addReference(course1.getOlatResource(), test.getOlatResource(), "86234");
 		referenceManager.addReference(course2.getOlatResource(), test.getOlatResource(), "78437590");
@@ -257,13 +261,20 @@ public class ReferenceManagerTest extends OlatTestCase {
 		Identity admin = JunitTestHelper.createAndPersistIdentityAsRndAdmin("Asuka");
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry course1 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 1", "", null, 0, defOrganisation);
-		RepositoryEntry course2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 2", "", null, 0, defOrganisation);
-		RepositoryEntry course3 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 3", "", null, 0, defOrganisation);
-		RepositoryEntry course4 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 4", "", null, 0, defOrganisation);
-		RepositoryEntry test12 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 12", "", null, 0, defOrganisation);
-		RepositoryEntry test2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 2", "", null, 0, defOrganisation);
-		RepositoryEntry test234 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 234", "", null, 0, defOrganisation);
+		RepositoryEntry course1 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 1", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 2", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course3 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 3", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course4 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 4", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry test12 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 12", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry test2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 2", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry test234 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 234", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		// add the references
 		referenceManager.addReference(course1.getOlatResource(), test12.getOlatResource(), "45345");
 		referenceManager.addReference(course2.getOlatResource(), test12.getOlatResource(), "453421");
@@ -337,15 +348,22 @@ public class ReferenceManagerTest extends OlatTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("Rei");
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry course1 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 1 permission", "", null, 0, defOrganisation);
-		RepositoryEntry course2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 2 permission", "", null, 0, defOrganisation);
-		RepositoryEntry course3 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 3 permission", "", null, 0, defOrganisation);
-		RepositoryEntry course4 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 4 permission", "", null, 0, defOrganisation);
-		RepositoryEntry test12 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 12 permission", "", null, 0, defOrganisation);
+		RepositoryEntry course1 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 1 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 2 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course3 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 3 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry course4 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager course 4 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
+		RepositoryEntry test12 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 12 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		repositoryEntryRelationDao.addRole(id1, test12, GroupRoles.owner.name());
-		RepositoryEntry test2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 2 permission", "", null, 0, defOrganisation);
+		RepositoryEntry test2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 2 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		repositoryEntryRelationDao.addRole(id2, test2, GroupRoles.owner.name());
-		RepositoryEntry test234 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 234 permission", "", null, 0, defOrganisation);
+		RepositoryEntry test234 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 234 permission", "", null,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		repositoryEntryRelationDao.addRole(id2, test234, GroupRoles.owner.name());
 		
 		// add the references
diff --git a/src/test/java/org/olat/restapi/CalendarTest.java b/src/test/java/org/olat/restapi/CalendarTest.java
index 888ffbb29c8..78aa01a0e4f 100644
--- a/src/test/java/org/olat/restapi/CalendarTest.java
+++ b/src/test/java/org/olat/restapi/CalendarTest.java
@@ -60,6 +60,7 @@ import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.course.config.CourseConfig;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.restapi.support.vo.CourseConfigVO;
@@ -103,7 +104,8 @@ public class CalendarTest extends OlatJerseyTestCase {
 			//create a course with a calendar
 			CourseConfigVO config = new CourseConfigVO();
 			config.setCalendar(Boolean.TRUE);
-			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id1, RepositoryEntry.ACC_OWNERS);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id1,
+					RepositoryEntryStatusEnum.preparation, false, false);
 			course1 = CourseFactory.loadCourse(courseEntry);
 			dbInstance.commit();
 			
@@ -131,7 +133,7 @@ public class CalendarTest extends OlatJerseyTestCase {
 			calendarManager.addEventTo(calendarWrapper.getKalendar(), event2);
 			
 			RepositoryEntry entry = repositoryManager.lookupRepositoryEntry(course1, false);
-			entry = repositoryManager.setAccess(entry, RepositoryEntry.ACC_USERS, false);
+			entry = repositoryManager.setAccess(entry, RepositoryEntryStatusEnum.published, true, false);
 			repositoryService.addRole(id1, entry, GroupRoles.participant.name());
 			
 			dbInstance.commit();
@@ -141,7 +143,8 @@ public class CalendarTest extends OlatJerseyTestCase {
 			//create a course with a calendar
 			CourseConfigVO config = new CourseConfigVO();
 			config.setCalendar(Boolean.TRUE);
-			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id2, RepositoryEntry.ACC_OWNERS);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id2,
+					RepositoryEntryStatusEnum.preparation, false, false);
 			course2 = CourseFactory.loadCourse(courseEntry);
 			dbInstance.commit();
 
@@ -149,7 +152,7 @@ public class CalendarTest extends OlatJerseyTestCase {
 			Assert.assertNotNull(calendarWrapper);
 
 			RepositoryEntry entry = repositoryManager.lookupRepositoryEntry(course2, false);
-			entry = repositoryManager.setAccess(entry, RepositoryEntry.ACC_USERS, false);
+			entry = repositoryManager.setAccess(entry, RepositoryEntryStatusEnum.published, true, false);
 			dbInstance.commit();
 		}
 	}
diff --git a/src/test/java/org/olat/restapi/CatalogTest.java b/src/test/java/org/olat/restapi/CatalogTest.java
index 83b65cffe30..53e38af0c0e 100644
--- a/src/test/java/org/olat/restapi/CatalogTest.java
+++ b/src/test/java/org/olat/restapi/CatalogTest.java
@@ -61,6 +61,7 @@ import org.olat.core.logging.Tracing;
 import org.olat.course.CourseModule;
 import org.olat.repository.CatalogEntry;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.manager.CatalogManager;
@@ -702,7 +703,8 @@ public class CatalogTest extends OlatJerseyTestCase {
 		RepositoryEntry d = repositoryManager.lookupRepositoryEntry(resourceable, false);
 		if(d == null) {
 			Organisation defOrganisation = organisationService.getDefaultOrganisation();
-			d = repositoryService.create(null, "Rei Ayanami", "-", displayName, "Repo entry", r, 0, defOrganisation);
+			d = repositoryService.create(null, "Rei Ayanami", "-", displayName, "Repo entry",
+					r, RepositoryEntryStatusEnum.trash, defOrganisation);
 			dbInstance.saveObject(d);
 		}
 		dbInstance.intermediateCommit();
diff --git a/src/test/java/org/olat/restapi/ContactsTest.java b/src/test/java/org/olat/restapi/ContactsTest.java
index 7b0e471f475..15e7b4f88be 100644
--- a/src/test/java/org/olat/restapi/ContactsTest.java
+++ b/src/test/java/org/olat/restapi/ContactsTest.java
@@ -47,6 +47,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -90,7 +91,8 @@ public class ContactsTest extends OlatJerseyTestCase {
 		RepositoryService rs = CoreSpringFactory.getImpl(RepositoryService.class);
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = rs.create(null, "administrator", "-", "rest-re", null, course, 0, defOrganisation);
+		RepositoryEntry re = rs.create(null, "administrator", "-", "rest-re", null, course,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		rs.update(re);
 		DBFactory.getInstance().commit();
 			
diff --git a/src/test/java/org/olat/restapi/CourseCalendarTest.java b/src/test/java/org/olat/restapi/CourseCalendarTest.java
index e9ccd813c8b..6236ee83f1e 100644
--- a/src/test/java/org/olat/restapi/CourseCalendarTest.java
+++ b/src/test/java/org/olat/restapi/CourseCalendarTest.java
@@ -65,6 +65,7 @@ import org.olat.core.logging.Tracing;
 import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -103,7 +104,8 @@ public class CourseCalendarTest extends OlatJerseyTestCase {
 			auth1 = JunitTestHelper.createAndPersistIdentityAsUser("rest-course-cal-one");
 			CourseConfigVO config = new CourseConfigVO();
 			config.setCalendar(Boolean.TRUE);
-			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(auth1, RepositoryEntry.ACC_OWNERS);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(auth1,
+					RepositoryEntryStatusEnum.preparation, false, false);
 			course1 = CourseFactory.loadCourse(courseEntry);
 			dbInstance.commit();
 			
@@ -193,7 +195,8 @@ public class CourseCalendarTest extends OlatJerseyTestCase {
 		CourseConfigVO config = new CourseConfigVO();
 		config.setCalendar(Boolean.TRUE);
 		
-		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin,
+				RepositoryEntryStatusEnum.preparation, false, false);
 		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
diff --git a/src/test/java/org/olat/restapi/CourseTest.java b/src/test/java/org/olat/restapi/CourseTest.java
index 3b718f0635f..4b8adef23ee 100644
--- a/src/test/java/org/olat/restapi/CourseTest.java
+++ b/src/test/java/org/olat/restapi/CourseTest.java
@@ -69,6 +69,7 @@ import org.olat.course.CourseFactory;
 import org.olat.course.CourseModule;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
@@ -116,7 +117,8 @@ public class CourseTest extends OlatJerseyTestCase {
 			auth1 = JunitTestHelper.createAndPersistIdentityAsUser("rest-one");
 			auth2 = JunitTestHelper.createAndPersistIdentityAsUser("rest-two");
 			
-			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin,
+					RepositoryEntryStatusEnum.preparation, false, false);
 			course1 = CourseFactory.loadCourse(courseEntry);
 			
 			dbInstance.closeSession();
@@ -225,7 +227,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	
 	@Test
 	public void testDeleteCourses() throws IOException, URISyntaxException {
-		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin,
+				RepositoryEntryStatusEnum.preparation, false, false);
 		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		
@@ -241,6 +244,7 @@ public class CourseTest extends OlatJerseyTestCase {
 		Roles roles = Roles.administratorRoles();
 
 		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters("*", "*", "*", courseType, null, roles);
+		params.setIdentity(admin);
 		List<RepositoryEntry> repoEntries = repositoryManager.genericANDQueryWithRolesRestriction(params, 0, -1, true);
 		assertNotNull(repoEntries);
 		
@@ -579,7 +583,7 @@ public class CourseTest extends OlatJerseyTestCase {
 		EntityUtils.consume(response.getEntity());
 		
 		RepositoryEntry repositoryEntry = repositoryManager.lookupRepositoryEntry(courseToClose, true);
-		Assert.assertTrue(repositoryEntry.getRepositoryEntryStatus().isClosed());
+		Assert.assertEquals(RepositoryEntryStatusEnum.closed, repositoryEntry.getEntryStatus());
 	}
 	
 	@Test
@@ -599,7 +603,7 @@ public class CourseTest extends OlatJerseyTestCase {
 		EntityUtils.consume(response.getEntity());
 		
 		RepositoryEntry repositoryEntry = repositoryManager.lookupRepositoryEntry(courseToClose, true);
-		Assert.assertEquals(0, repositoryEntry.getAccess());
+		Assert.assertEquals(RepositoryEntryStatusEnum.trash, repositoryEntry.getEntryStatus());
 	}
 	
 	@Test
diff --git a/src/test/java/org/olat/restapi/CoursesFoldersTest.java b/src/test/java/org/olat/restapi/CoursesFoldersTest.java
index 99a5d63ace9..d0b2bf8151c 100644
--- a/src/test/java/org/olat/restapi/CoursesFoldersTest.java
+++ b/src/test/java/org/olat/restapi/CoursesFoldersTest.java
@@ -62,6 +62,7 @@ import org.olat.course.nodes.CourseNode;
 import org.olat.course.nodes.CourseNodeConfiguration;
 import org.olat.course.nodes.CourseNodeFactory;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.restapi.support.vo.FolderVO;
 import org.olat.restapi.support.vo.FolderVOes;
 import org.olat.test.JunitTestHelper;
@@ -99,7 +100,7 @@ public class CoursesFoldersTest extends OlatJerseyTestCase {
 		bcNode.setNoAccessExplanation("You don't have access");
 		course1.getEditorTreeModel().addCourseNode(bcNode, course1.getRunStructure().getRootNode());
 
-		CourseFactory.publishCourse(course1, RepositoryEntry.ACC_USERS, false, admin, Locale.ENGLISH);
+		CourseFactory.publishCourse(course1, RepositoryEntryStatusEnum.published, true, false, admin, Locale.ENGLISH);
 		
 		dbInstance.intermediateCommit();
 	}
diff --git a/src/test/java/org/olat/restapi/CoursesForumsTest.java b/src/test/java/org/olat/restapi/CoursesForumsTest.java
index 582e4b80b98..25108d94c63 100644
--- a/src/test/java/org/olat/restapi/CoursesForumsTest.java
+++ b/src/test/java/org/olat/restapi/CoursesForumsTest.java
@@ -48,6 +48,7 @@ import org.olat.modules.fo.restapi.ForumVO;
 import org.olat.modules.fo.restapi.ForumVOes;
 import org.olat.modules.fo.restapi.MessageVOes;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -91,7 +92,7 @@ public class CoursesForumsTest  extends OlatJerseyTestCase {
 		forumNode.setNoAccessExplanation("You don't have access");
 		course1.getEditorTreeModel().addCourseNode(forumNode, course1.getRunStructure().getRootNode());
 		
-		CourseFactory.publishCourse(course1, RepositoryEntry.ACC_USERS, false, admin, Locale.ENGLISH);
+		CourseFactory.publishCourse(course1, RepositoryEntryStatusEnum.published, true, false, admin, Locale.ENGLISH);
 		
 		dbInstance.intermediateCommit();
 	}
diff --git a/src/test/java/org/olat/restapi/CoursesInfosTest.java b/src/test/java/org/olat/restapi/CoursesInfosTest.java
index 583ddb70cc7..f0dd639b9c9 100644
--- a/src/test/java/org/olat/restapi/CoursesInfosTest.java
+++ b/src/test/java/org/olat/restapi/CoursesInfosTest.java
@@ -43,6 +43,7 @@ import org.olat.core.id.Identity;
 import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.restapi.support.vo.CourseInfoVO;
 import org.olat.restapi.support.vo.CourseInfoVOes;
 import org.olat.test.JunitTestHelper;
@@ -79,7 +80,8 @@ public class CoursesInfosTest extends OlatJerseyTestCase {
 	@Test
 	public void testGetCourseInfos_byId() throws IOException, URISyntaxException {
 		Identity admin = securityManager.findIdentityByName("administrator");
-		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, "course-info 1", RepositoryEntry.ACC_OWNERS);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, "course-info 1",
+				RepositoryEntryStatusEnum.preparation, false, false);
 		ICourse course = CourseFactory.loadCourse(courseEntry);
 
 		RestConnection conn = new RestConnection();
diff --git a/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java b/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java
index 6ac26ce9469..a028b0d4a42 100644
--- a/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java
+++ b/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java
@@ -59,6 +59,7 @@ import org.olat.core.util.vfs.VFSLeaf;
 import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.restapi.support.vo.LinkVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -81,7 +82,8 @@ public class CoursesResourcesFoldersTest extends OlatJerseyTestCase {
 		conn = new RestConnection();
 		
 		admin = securityManager.findIdentityByName("administrator");
-		RepositoryEntry courseEntry = JunitTestHelper.deployEmptyCourse(admin, "Empty course", RepositoryEntry.ACC_OWNERS);
+		RepositoryEntry courseEntry = JunitTestHelper.deployEmptyCourse(admin, "Empty course",
+				RepositoryEntryStatusEnum.preparation, false, false);
 		course1 = CourseFactory.loadCourse(courseEntry);
 		
 		//copy a couple of files in the resource folder
diff --git a/src/test/java/org/olat/restapi/CoursesTest.java b/src/test/java/org/olat/restapi/CoursesTest.java
index 444ba616992..9ae87de9839 100644
--- a/src/test/java/org/olat/restapi/CoursesTest.java
+++ b/src/test/java/org/olat/restapi/CoursesTest.java
@@ -68,6 +68,7 @@ import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.manager.RepositoryEntryLifecycleDAO;
 import org.olat.repository.manager.RepositoryEntryRelationDAO;
@@ -113,9 +114,9 @@ public class CoursesTest extends OlatJerseyTestCase {
 			// create course and persist as OLATResourceImpl
 			admin = securityManager.findIdentityByName("administrator");
 			
-			re1 = JunitTestHelper.deployBasicCourse(admin, "courses1", RepositoryEntry.ACC_OWNERS);
-			re2 = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
-			re3 = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+			re1 = JunitTestHelper.deployBasicCourse(admin, "courses1", RepositoryEntryStatusEnum.preparation, false, false);
+			re2 = JunitTestHelper.deployBasicCourse(admin, RepositoryEntryStatusEnum.preparation, false, false);
+			re3 = JunitTestHelper.deployBasicCourse(admin, RepositoryEntryStatusEnum.preparation, false, false);
 			dbInstance.commit();
 
 			externalId = UUID.randomUUID().toString();
diff --git a/src/test/java/org/olat/restapi/GroupFoldersTest.java b/src/test/java/org/olat/restapi/GroupFoldersTest.java
index 6890acecbe2..7cfbdd297d2 100644
--- a/src/test/java/org/olat/restapi/GroupFoldersTest.java
+++ b/src/test/java/org/olat/restapi/GroupFoldersTest.java
@@ -71,6 +71,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -126,7 +127,8 @@ public class GroupFoldersTest extends OlatJerseyTestCase {
 		OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse",System.currentTimeMillis());
 		course = OLATResourceManager.getInstance().findOrPersistResourceable(resourceable);
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "administrator", "-", "rest-re", null, course, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "administrator", "-", "rest-re", null, course,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		repositoryService.update(re);
 		DBFactory.getInstance().commit();
 		
diff --git a/src/test/java/org/olat/restapi/GroupMgmtTest.java b/src/test/java/org/olat/restapi/GroupMgmtTest.java
index 71c4d8047c5..c86b7756fbb 100644
--- a/src/test/java/org/olat/restapi/GroupMgmtTest.java
+++ b/src/test/java/org/olat/restapi/GroupMgmtTest.java
@@ -76,6 +76,7 @@ import org.olat.modules.fo.restapi.MessageVO;
 import org.olat.properties.NarrowedPropertyManager;
 import org.olat.properties.Property;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -143,7 +144,8 @@ public class GroupMgmtTest extends OlatJerseyTestCase {
 		OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse",System.currentTimeMillis());
 		course = rm.findOrPersistResourceable(resourceable);
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, "administrator", "-", "rest-re", null, course, 0, defOrganisation);
+		RepositoryEntry re = repositoryService.create(null, "administrator", "-", "rest-re", null, course,
+				RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		assertNotNull(re);
 		
diff --git a/src/test/java/org/olat/restapi/NotificationsTest.java b/src/test/java/org/olat/restapi/NotificationsTest.java
index 74ee8dd5018..3747c8d50aa 100644
--- a/src/test/java/org/olat/restapi/NotificationsTest.java
+++ b/src/test/java/org/olat/restapi/NotificationsTest.java
@@ -83,6 +83,7 @@ import org.olat.modules.fo.Forum;
 import org.olat.modules.fo.Message;
 import org.olat.modules.fo.manager.ForumManager;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -377,7 +378,7 @@ public class NotificationsTest extends OlatJerseyTestCase {
 		forumNode.setNoAccessExplanation("You don't have access");
 		Forum courseForum = forumNode.loadOrCreateForum(course.getCourseEnvironment());
 		course.getEditorTreeModel().addCourseNode(forumNode, course.getRunStructure().getRootNode());
-		CourseFactory.publishCourse(course, RepositoryEntry.ACC_USERS, false, id, Locale.ENGLISH);
+		CourseFactory.publishCourse(course, RepositoryEntryStatusEnum.published, true, false, id, Locale.ENGLISH);
 		dbInstance.intermediateCommit();
 		
 		//add message and publisher
@@ -428,7 +429,7 @@ public class NotificationsTest extends OlatJerseyTestCase {
 		String relPath = BCCourseNode.getFoldernodePathRelToFolderBase(course.getCourseEnvironment(), folderNode);
 		VFSContainer folder = BCCourseNode.getNodeFolderContainer(folderNode, course.getCourseEnvironment());
 		course.getEditorTreeModel().addCourseNode(folderNode, course.getRunStructure().getRootNode());
-		CourseFactory.publishCourse(course, RepositoryEntry.ACC_USERS, false, id, Locale.ENGLISH);
+		CourseFactory.publishCourse(course, RepositoryEntryStatusEnum.published, true, false, id, Locale.ENGLISH);
 		dbInstance.intermediateCommit();
 		
 		//add message and publisher
diff --git a/src/test/java/org/olat/restapi/RepositoryEntriesTest.java b/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
index f8df1550bd7..3aa53ff6b21 100644
--- a/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
+++ b/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
@@ -58,6 +58,7 @@ import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.resource.OLATResource;
@@ -296,7 +297,8 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 		assertNotNull(re);
 		assertNotNull(re.getOlatResource());
 		assertEquals("CP demo", re.getDisplayname());
-		assertEquals(RepositoryEntry.ACC_USERS, re.getAccess());
+		Assert.assertTrue(re.isAllUsers());
+		Assert.assertFalse(re.isGuests());//TODO repo access
 		
 		conn.shutdown();
 	}
@@ -462,7 +464,8 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 		dbInstance.intermediateCommit();
 
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry d = repositoryService.create(null, displayName, "-", displayName, "Repo entry", r, 0, defOrganisation);
+		RepositoryEntry d = repositoryService.create(null, displayName, "-", displayName, "Repo entry",
+				r, RepositoryEntryStatusEnum.trash, defOrganisation);
 		dbInstance.commit();
 		return d;
 	}
diff --git a/src/test/java/org/olat/restapi/RepositoryEntryWebServiceTest.java b/src/test/java/org/olat/restapi/RepositoryEntryWebServiceTest.java
index 988b0acaeb6..6eb98e88c8c 100644
--- a/src/test/java/org/olat/restapi/RepositoryEntryWebServiceTest.java
+++ b/src/test/java/org/olat/restapi/RepositoryEntryWebServiceTest.java
@@ -64,6 +64,7 @@ import org.olat.modules.taxonomy.manager.TaxonomyLevelDAO;
 import org.olat.modules.taxonomy.restapi.TaxonomyLevelVO;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryEntryRelationType;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryEntryToTaxonomyLevel;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
@@ -539,23 +540,26 @@ public class RepositoryEntryWebServiceTest extends OlatJerseyTestCase {
 		//check
 		Assert.assertNotNull(accessVo);
 		Assert.assertEquals(re.getKey(), accessVo.getRepoEntryKey());
-		Assert.assertEquals(re.getAccess(), accessVo.getAccess());
-		Assert.assertEquals(re.isMembersOnly(), accessVo.isMembersOnly());
+		Assert.assertEquals(re.getStatus(), accessVo.getStatus());
+		Assert.assertEquals(re.isAllUsers(), accessVo.isAllUsers());
+		Assert.assertEquals(re.isGuests(), accessVo.isGuests());
 	}
 	
 	@Test
 	public void updateAccess() throws IOException, URISyntaxException {
 		RepositoryEntry re = JunitTestHelper.createAndPersistRepositoryEntry(false);
 		dbInstance.commitAndCloseSession();
-		Assert.assertFalse(re.isMembersOnly());
+		Assert.assertTrue(re.isAllUsers());
+		Assert.assertFalse(re.isGuests());
 
 		//remove the owner
 		RestConnection conn = new RestConnection();
 		assertTrue(conn.login("administrator", "openolat"));
 		
 		RepositoryEntryAccessVO accessVo = new RepositoryEntryAccessVO();
-		accessVo.setAccess(RepositoryEntry.ACC_OWNERS);
-		accessVo.setMembersOnly(true);
+		accessVo.setStatus(RepositoryEntryStatusEnum.published.name());
+		accessVo.setAllUsers(false);
+		accessVo.setGuests(false);
 		
 		URI request = UriBuilder.fromUri(getContextURI())
 				.path("repo/entries").path(re.getKey().toString()).path("access").build();
@@ -569,13 +573,15 @@ public class RepositoryEntryWebServiceTest extends OlatJerseyTestCase {
 		// check return value
 		Assert.assertNotNull(updatedAccessVo);
 		Assert.assertEquals(re.getKey(), updatedAccessVo.getRepoEntryKey());
-		Assert.assertEquals(RepositoryEntry.ACC_OWNERS, updatedAccessVo.getAccess());
-		Assert.assertEquals(true, updatedAccessVo.isMembersOnly());
+		Assert.assertEquals(RepositoryEntryStatusEnum.published.name(), updatedAccessVo.getStatus());
+		Assert.assertFalse(updatedAccessVo.isAllUsers());
+		Assert.assertFalse(updatedAccessVo.isGuests());
 		
 		// check database value
 		RepositoryEntry updatedRe = repositoryService.loadByKey(re.getKey());
-		Assert.assertEquals(RepositoryEntry.ACC_OWNERS, updatedRe.getAccess());
-		Assert.assertEquals(true, updatedRe.isMembersOnly());
+		Assert.assertEquals(RepositoryEntryStatusEnum.published, updatedRe.getEntryStatus());
+		Assert.assertFalse(updatedRe.isAllUsers());
+		Assert.assertFalse(updatedRe.isGuests());
 	}
 	
 	@Test
diff --git a/src/test/java/org/olat/restapi/UserCoursesTest.java b/src/test/java/org/olat/restapi/UserCoursesTest.java
index d4bb9188f63..6102eff4045 100644
--- a/src/test/java/org/olat/restapi/UserCoursesTest.java
+++ b/src/test/java/org/olat/restapi/UserCoursesTest.java
@@ -41,6 +41,7 @@ import org.olat.core.id.Identity;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.restapi.support.vo.CourseVO;
@@ -76,7 +77,7 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("My-course-");
 		
 		RepositoryEntry courseRe = JunitTestHelper.deployBasicCourse(user);
-		repositoryManager.setAccess(courseRe, RepositoryEntry.ACC_OWNERS, true);
+		repositoryManager.setAccess(courseRe, RepositoryEntryStatusEnum.published, false, false);
 		repositoryService.addRole(user, courseRe, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
 		
@@ -84,7 +85,7 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 		Assert.assertTrue(conn.login(user.getName(), JunitTestHelper.PWD));
 		
 		//without paging
-		URI request = UriBuilder.fromUri(getContextURI()).path("/users").path(user.getKey().toString()).path("/courses/my").build();
+		URI request = UriBuilder.fromUri(getContextURI()).path("users").path(user.getKey().toString()).path("courses").path("my").build();
 		HttpGet method = conn.createGet(request, MediaType.APPLICATION_JSON, true);
 		HttpResponse response = conn.execute(method);
 		Assert.assertEquals(200, response.getStatusLine().getStatusCode());
@@ -93,7 +94,7 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 		Assert.assertEquals(1, courses.size());
 
 		//with paging
-		URI pagedRequest = UriBuilder.fromUri(getContextURI()).path("/users").path(user.getKey().toString()).path("/courses/my")
+		URI pagedRequest = UriBuilder.fromUri(getContextURI()).path("users").path(user.getKey().toString()).path("courses").path("my")
 				.queryParam("start", "0").queryParam("limit", "10").build();
 		HttpGet pagedMethod = conn.createGet(pagedRequest, MediaType.APPLICATION_JSON + ";pagingspec=1.0", true);
 		HttpResponse pagedResponse = conn.execute(pagedMethod);
@@ -112,7 +113,7 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 		//prepare a course with a tutor
 		Identity teacher = JunitTestHelper.createAndPersistIdentityAsRndUser("Course-teacher-");
 		RepositoryEntry courseRe = JunitTestHelper.deployBasicCourse(teacher);
-		repositoryManager.setAccess(courseRe, RepositoryEntry.ACC_OWNERS, true);
+		repositoryManager.setAccess(courseRe, RepositoryEntryStatusEnum.published, false, false);
 		repositoryService.addRole(teacher, courseRe, GroupRoles.coach.name());
 		dbInstance.commitAndCloseSession();
 		
@@ -148,7 +149,7 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 		//prepare a course with a tutor
 		Identity me = JunitTestHelper.createAndPersistIdentityAsUser("Course-teacher-" + UUID.randomUUID().toString());
 		RepositoryEntry courseRe = JunitTestHelper.deployBasicCourse(me);
-		repositoryManager.setAccess(courseRe, RepositoryEntry.ACC_USERS, false);
+		repositoryManager.setAccess(courseRe, RepositoryEntryStatusEnum.published, true, false);
 		markManager.setMark(courseRe, me, null, "[RepositoryEntry:" + courseRe.getKey() + "]");	
 		dbInstance.commitAndCloseSession();
 
diff --git a/src/test/java/org/olat/selenium/AssessmentTest.java b/src/test/java/org/olat/selenium/AssessmentTest.java
index e7b693215a9..2f1a76930e0 100644
--- a/src/test/java/org/olat/selenium/AssessmentTest.java
+++ b/src/test/java/org/olat/selenium/AssessmentTest.java
@@ -54,8 +54,8 @@ import org.olat.selenium.page.course.MembersPage;
 import org.olat.selenium.page.graphene.OOGraphene;
 import org.olat.selenium.page.group.GroupPage;
 import org.olat.selenium.page.qti.QTI12Page;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
 import org.olat.selenium.page.repository.ScormPage;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.test.ArquillianDeployments;
 import org.olat.test.JunitTestHelper;
diff --git a/src/test/java/org/olat/selenium/BusinessGroupTest.java b/src/test/java/org/olat/selenium/BusinessGroupTest.java
index 0ac3b8593da..98d2ceacfd4 100644
--- a/src/test/java/org/olat/selenium/BusinessGroupTest.java
+++ b/src/test/java/org/olat/selenium/BusinessGroupTest.java
@@ -52,7 +52,7 @@ import org.olat.selenium.page.course.MembersPage;
 import org.olat.selenium.page.graphene.OOGraphene;
 import org.olat.selenium.page.group.GroupPage;
 import org.olat.selenium.page.group.MembersWizardPage;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.test.rest.UserRestClient;
 import org.olat.user.restapi.UserVO;
 import org.openqa.selenium.By;
diff --git a/src/test/java/org/olat/selenium/CourseElementTest.java b/src/test/java/org/olat/selenium/CourseElementTest.java
index 56c194d1f29..fd3da67999d 100644
--- a/src/test/java/org/olat/selenium/CourseElementTest.java
+++ b/src/test/java/org/olat/selenium/CourseElementTest.java
@@ -57,9 +57,9 @@ import org.olat.selenium.page.graphene.OOGraphene;
 import org.olat.selenium.page.repository.AuthoringEnvPage;
 import org.olat.selenium.page.repository.AuthoringEnvPage.ResourceType;
 import org.olat.selenium.page.repository.FeedPage;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
 import org.olat.selenium.page.repository.RepositoryEditDescriptionPage;
 import org.olat.selenium.page.repository.ScormPage;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.rest.UserRestClient;
diff --git a/src/test/java/org/olat/selenium/CourseTest.java b/src/test/java/org/olat/selenium/CourseTest.java
index ae9b91914b0..257ff140763 100644
--- a/src/test/java/org/olat/selenium/CourseTest.java
+++ b/src/test/java/org/olat/selenium/CourseTest.java
@@ -63,9 +63,9 @@ import org.olat.selenium.page.repository.AuthoringEnvPage;
 import org.olat.selenium.page.repository.AuthoringEnvPage.ResourceType;
 import org.olat.selenium.page.repository.CPPage;
 import org.olat.selenium.page.repository.RepositoryAccessPage;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
-import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.selenium.page.repository.RepositoryEditDescriptionPage;
+import org.olat.selenium.page.repository.UserAccess;
+import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.rest.UserRestClient;
 import org.olat.user.restapi.UserVO;
@@ -573,7 +573,7 @@ public class CourseTest extends Deployments {
 		courseEditor
 			.publish()
 			.nextSelectNodes()
-			.selectAccess(UserAccess.guest)
+			.selectAccess(UserAccess.registred)
 			.nextAccess()
 			.selectCatalog(true)
 			.selectCategory(node1, node2_2)
diff --git a/src/test/java/org/olat/selenium/ImsQTI21EditorTest.java b/src/test/java/org/olat/selenium/ImsQTI21EditorTest.java
index da02f100528..342e45c0f1c 100644
--- a/src/test/java/org/olat/selenium/ImsQTI21EditorTest.java
+++ b/src/test/java/org/olat/selenium/ImsQTI21EditorTest.java
@@ -49,9 +49,9 @@ import org.olat.selenium.page.qti.QTI21LobEditorPage;
 import org.olat.selenium.page.qti.QTI21MatchEditorPage;
 import org.olat.selenium.page.qti.QTI21MultipleChoiceEditorPage;
 import org.olat.selenium.page.qti.QTI21Page;
-import org.olat.selenium.page.qti.QTI21SingleChoiceEditorPage;
 import org.olat.selenium.page.qti.QTI21Page.TrueFalse;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
+import org.olat.selenium.page.qti.QTI21SingleChoiceEditorPage;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.rest.UserRestClient;
 import org.olat.user.restapi.UserVO;
diff --git a/src/test/java/org/olat/selenium/ImsQTI21Test.java b/src/test/java/org/olat/selenium/ImsQTI21Test.java
index c6ca989a2d5..04547989544 100644
--- a/src/test/java/org/olat/selenium/ImsQTI21Test.java
+++ b/src/test/java/org/olat/selenium/ImsQTI21Test.java
@@ -45,7 +45,7 @@ import org.olat.selenium.page.graphene.OOGraphene;
 import org.olat.selenium.page.qti.QTI21ConfigurationCEPage;
 import org.olat.selenium.page.qti.QTI21CorrectionPage;
 import org.olat.selenium.page.qti.QTI21Page;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.rest.UserRestClient;
diff --git a/src/test/java/org/olat/selenium/LecturesTest.java b/src/test/java/org/olat/selenium/LecturesTest.java
index f5e15acad8d..99d45f8ce08 100644
--- a/src/test/java/org/olat/selenium/LecturesTest.java
+++ b/src/test/java/org/olat/selenium/LecturesTest.java
@@ -46,7 +46,7 @@ import org.olat.selenium.page.lecture.RollCallInterceptorPage;
 import org.olat.selenium.page.lecture.TeacherRollCallPage;
 import org.olat.selenium.page.repository.AuthoringEnvPage;
 import org.olat.selenium.page.repository.AuthoringEnvPage.ResourceType;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.test.rest.UserRestClient;
 import org.olat.user.restapi.UserVO;
diff --git a/src/test/java/org/olat/selenium/PortfolioV2Test.java b/src/test/java/org/olat/selenium/PortfolioV2Test.java
index 13e9e17a4bc..497c7726945 100644
--- a/src/test/java/org/olat/selenium/PortfolioV2Test.java
+++ b/src/test/java/org/olat/selenium/PortfolioV2Test.java
@@ -54,7 +54,7 @@ import org.olat.selenium.page.portfolio.PortfolioV2HomePage;
 import org.olat.selenium.page.repository.AuthoringEnvPage;
 import org.olat.selenium.page.repository.AuthoringEnvPage.ResourceType;
 import org.olat.selenium.page.repository.FeedPage;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
+import org.olat.selenium.page.repository.UserAccess;
 import org.olat.selenium.page.user.UserToolsPage;
 import org.olat.selenium.page.wiki.WikiPage;
 import org.olat.test.JunitTestHelper;
diff --git a/src/test/java/org/olat/selenium/page/course/PublisherPageFragment.java b/src/test/java/org/olat/selenium/page/course/PublisherPageFragment.java
index 11ab1cbc56f..2f3230ce521 100644
--- a/src/test/java/org/olat/selenium/page/course/PublisherPageFragment.java
+++ b/src/test/java/org/olat/selenium/page/course/PublisherPageFragment.java
@@ -23,7 +23,7 @@ import java.util.List;
 
 import org.junit.Assert;
 import org.olat.selenium.page.graphene.OOGraphene;
-import org.olat.selenium.page.repository.RepositoryAccessPage.UserAccess;
+import org.olat.selenium.page.repository.UserAccess;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
@@ -101,29 +101,28 @@ public class PublisherPageFragment {
 	}
 	
 	public PublisherPageFragment selectAccess(UserAccess access) {
-		if(access == UserAccess.none) {
-			By labelSwitchBy = By.xpath("//div[@id='o_cousersSwitch']//label[input[@name='usersSwitch'][@type='radio'][@value='n']]");
-			browser.findElement(labelSwitchBy).click();
-			OOGraphene.waitBusy(browser);
-		} else {
-			By labelSwitchBy = By.xpath("//div[@id='o_cousersSwitch']//label[input[@name='usersSwitch'][@type='radio'][@value='y']]");
-			browser.findElement(labelSwitchBy).click();
+		By publishStatusBy = By.id("o_fiopublishedStatus_SELBOX");
+		OOGraphene.scrollTo(publishStatusBy, browser);
+		WebElement publishStatusEl = browser.findElement(publishStatusBy);
+		Select publishStatusSelect = new Select(publishStatusEl);
+		publishStatusSelect.selectByValue("published");
+
+		if(access == UserAccess.registred || access == UserAccess.guest) {
+			By allUsersBy = By.xpath("//label/input[@name='cif.allusers' and @value='y']");
+			browser.findElement(allUsersBy).click();
 			OOGraphene.waitBusy(browser);
 			
 			By accessConfigurationBy = By.cssSelector("fieldset.o_ac_configuration");
-			OOGraphene.waitElement(accessConfigurationBy, 5, browser);
+			OOGraphene.waitElement(accessConfigurationBy, browser);
+		}
+		if(access == UserAccess.guest) {
+			By guestsBy = By.xpath("//label[input[@name='cif.guests' and @value='y']]");
+			By labelGuestsBy = By.xpath("//label/input[@name='cif.guests' and @value='y']");
+			OOGraphene.scrollTo(guestsBy, browser);
 			
-			By publishForUserBy = By.id("o_fiopublishedForUsers_SELBOX");
-			OOGraphene.scrollTo(publishForUserBy, browser);
-			WebElement publishForUserEl = browser.findElement(publishForUserBy);
-			Select publishForUserSelect = new Select(publishForUserEl);
-			switch(access) {
-				case registred: publishForUserSelect.selectByValue("u"); break;
-				case guest: publishForUserSelect.selectByValue("g"); break;
-				case membersOnly: publishForUserSelect.selectByValue("m"); break;
-				default: {}
-			}
-			OOGraphene.waitBusy(browser);
+			WebElement guestsEl = browser.findElement(guestsBy);
+			WebElement labelGuestsEl = browser.findElement(labelGuestsBy);
+			OOGraphene.check(labelGuestsEl, guestsEl, Boolean.TRUE);
 		}
 		return this;
 	}
diff --git a/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java b/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java
index 7faa6c45585..053a6c2a6c9 100644
--- a/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java
+++ b/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java
@@ -44,30 +44,36 @@ public class RepositoryAccessPage {
 	}
 	
 	public RepositoryAccessPage setUserAccess(UserAccess access) {
-		if(access == UserAccess.none) {
-			By userSwitch = By.cssSelector("#o_cousersSwitch input[type='radio'][value='n']");
-			browser.findElement(userSwitch).click();
-			OOGraphene.waitBusy(browser);
-		} else {
-			By userSwitch = By.cssSelector("#o_cousersSwitch input[type='radio'][value='y']");
-			browser.findElement(userSwitch).click();
+		By publishStatusBy = By.id("o_fiopublishedStatus_SELBOX");
+		OOGraphene.waitElement(publishStatusBy, browser);
+		WebElement publishStatusEl = browser.findElement(publishStatusBy);
+		Select publishStatusSelect = new Select(publishStatusEl);
+		publishStatusSelect.selectByValue("published");
+
+		if(access == UserAccess.registred || access == UserAccess.guest) {
+			By allUsersBy = By.xpath("//label/input[@name='cif.allusers' and @value='y']");
+			browser.findElement(allUsersBy).click();
 			OOGraphene.waitBusy(browser);
+		}
+		if(access == UserAccess.guest) {
+			By guestsBy = By.xpath("//label[input[@name='cif.guests' and @value='y']]");
+			By labelGuestsBy = By.xpath("//label/input[@name='cif.guests' and @value='y']");
+			OOGraphene.scrollTo(guestsBy, browser);
 			
-			By publishForUserBy = By.cssSelector("#o_fiopublishedForUsers_SELBOX");
-			WebElement publishForUserEl = browser.findElement(publishForUserBy);
-			Select publishForUserSelect = new Select(publishForUserEl);
-			switch(access) {
-				case registred: publishForUserSelect.selectByValue("u"); break;
-				case guest: publishForUserSelect.selectByValue("g"); break;
-				case membersOnly: publishForUserSelect.selectByValue("m"); break;
-				default: {}
-			}
-			OOGraphene.waitBusy(browser);
+			WebElement guestsEl = browser.findElement(guestsBy);
+			WebElement labelGuestsEl = browser.findElement(labelGuestsBy);
+			OOGraphene.check(labelGuestsEl, guestsEl, Boolean.TRUE);
 		}
-		
+
 		By saveSwitch = By.cssSelector("fieldset.o_sel_repositoryentry_access button.btn.btn-primary");
 		browser.findElement(saveSwitch).click();
 		OOGraphene.waitBusy(browser);
+
+		if(access == UserAccess.registred || access == UserAccess.guest) {
+			By accessConfigurationBy = By.cssSelector("fieldset.o_ac_configuration");
+			OOGraphene.waitElement(accessConfigurationBy, browser);
+		}
+		
 		return this;
 	}
 	
@@ -87,11 +93,4 @@ public class RepositoryAccessPage {
 		browser.findElement(toolbarBackBy).click();
 		OOGraphene.waitBusy(browser);
 	}
-	
-	public enum UserAccess {
-		none,
-		registred,
-		guest,
-		membersOnly
-	}
 }
diff --git a/src/test/java/org/olat/selenium/page/repository/UserAccess.java b/src/test/java/org/olat/selenium/page/repository/UserAccess.java
new file mode 100644
index 00000000000..03d79210145
--- /dev/null
+++ b/src/test/java/org/olat/selenium/page/repository/UserAccess.java
@@ -0,0 +1,32 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.selenium.page.repository;
+
+/**
+ * 
+ * Initial date: 23 juil. 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public enum UserAccess {
+	registred,		// published -> all users
+	guest,			// published -> all users, guests
+	membersOnly		// published
+}
diff --git a/src/test/java/org/olat/test/JunitTestHelper.java b/src/test/java/org/olat/test/JunitTestHelper.java
index b173d28282a..dadcbbfefaf 100644
--- a/src/test/java/org/olat/test/JunitTestHelper.java
+++ b/src/test/java/org/olat/test/JunitTestHelper.java
@@ -55,6 +55,7 @@ import org.olat.course.CourseModule;
 import org.olat.course.ICourse;
 import org.olat.fileresource.types.ImageFileResource;
 import org.olat.repository.RepositoryEntry;
+import org.olat.repository.RepositoryEntryStatusEnum;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
@@ -102,8 +103,8 @@ public class JunitTestHelper {
 				.createOLATResourceInstance(new ImageFileResource());
 		Organisation defOrganisation = CoreSpringFactory.getImpl(OrganisationService.class)
 				.getDefaultOrganisation();
-		return CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(author, "", "-", "Image - " + resource.getResourceableId(), "", resource, 1, defOrganisation);
+		return CoreSpringFactory.getImpl(RepositoryService.class).create(author, "", "-", "Image - " + resource.getResourceableId(), "",
+				resource, RepositoryEntryStatusEnum.preparation, defOrganisation);
 	}
 	
 	public static final Identity createAndPersistIdentityAsRndUser(String prefixLogin) {
@@ -199,6 +200,32 @@ public class JunitTestHelper {
 		return identity;
 	}
 	
+	public static final Identity createAndPersistIdentityAsRndLearnResourceManager(String prefixLogin) {
+		String login = getRandomizedLoginName(prefixLogin);
+		return createAndPersistIdentityAsLearnResourceManager(login);
+	}
+	
+	/**
+	 * Create an identity with admin permissions
+	 * @param login
+	 * @return
+	 */
+	private static final Identity createAndPersistIdentityAsLearnResourceManager(String login) {
+		BaseSecurity securityManager = CoreSpringFactory.getImpl(BaseSecurity.class);
+		Identity identity = securityManager.findIdentityByName(login);
+		if (identity != null) {
+			return identity;
+		}
+
+		User user = CoreSpringFactory.getImpl(UserManager.class)
+				.createUser("first" + login, "last" + login, login + "@" + maildomain);
+		identity = securityManager.createAndPersistIdentityAndUser(login, null, user, BaseSecurityModule.getDefaultAuthProviderIdentifier(), login, PWD);
+		addToDefaultOrganisation(identity, OrganisationRoles.learnresourcemanager);
+		addToDefaultOrganisation(identity, OrganisationRoles.user);
+		CoreSpringFactory.getImpl(DB.class).commitAndCloseSession();
+		return identity;
+	}
+	
 	private static void addToDefaultOrganisation(Identity identity, OrganisationRoles role) {
 		CoreSpringFactory.getImpl(OrganisationService.class).addMember(identity, role);
 	}
@@ -224,12 +251,10 @@ public class JunitTestHelper {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		OrganisationService organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		RepositoryEntry re = repositoryService.create(null, initialAuthor, "Lernen mit OLAT", r.getResourceableTypeName(), null, r, 0, defOrganisation);
-		if(membersOnly) {
-			re.setAccess(RepositoryEntry.ACC_OWNERS);
-			re.setMembersOnly(true);
-		} else {
-			re.setAccess(RepositoryEntry.ACC_USERS);
+		RepositoryEntry re = repositoryService.create(null, initialAuthor, "Lernen mit OLAT", r.getResourceableTypeName(), null,
+				r, RepositoryEntryStatusEnum.published, defOrganisation);
+		if(!membersOnly) {
+			re.setAllUsers(true);
 		}
 		repositoryService.update(re);
 		return re;
@@ -243,7 +268,7 @@ public class JunitTestHelper {
 		RepositoryEntry re = null;
 		try {
 			URL courseUrl = JunitTestHelper.class.getResource("file_resources/Demo-Kurs-7.1.zip");
-			re = deployCourse(initialAuthor, "Demo-Kurs-7.1", RepositoryEntry.ACC_USERS, courseUrl);
+			re = deployCourse(initialAuthor, "Demo-Kurs-7.1", RepositoryEntryStatusEnum.published, true, false, courseUrl);
 		} catch (Exception e) {
 			log.error("", e);
 		}
@@ -258,7 +283,7 @@ public class JunitTestHelper {
 	 */
 	public static RepositoryEntry deployBasicCourse(Identity initialAuthor) {
 		String displayname = "Basic course (" + CodeHelper.getForeverUniqueID() + ")";
-		return deployBasicCourse(initialAuthor, displayname, RepositoryEntry.ACC_USERS);
+		return deployBasicCourse(initialAuthor, displayname, RepositoryEntryStatusEnum.published, true, false);
 	}
 	
 	/**
@@ -268,9 +293,10 @@ public class JunitTestHelper {
 	 * @param access The access
 	 * @return The repository entry of the course
 	 */
-	public static RepositoryEntry deployBasicCourse(Identity initialAuthor, int access) {
+	public static RepositoryEntry deployBasicCourse(Identity initialAuthor,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests) {
 		String displayname = "Basic course (" + CodeHelper.getForeverUniqueID() + ")";
-		return deployBasicCourse(initialAuthor, displayname, access);
+		return deployBasicCourse(initialAuthor, displayname, status, allUsers, guests);
 	}
 
 	/**
@@ -281,20 +307,22 @@ public class JunitTestHelper {
 	 * @param access The access
 	 * @return The repository entry of the course
 	 */
-	public static RepositoryEntry deployBasicCourse(Identity initialAuthor, String displayname, int access) {
+	public static RepositoryEntry deployBasicCourse(Identity initialAuthor, String displayname,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests) {
 		try {
 			URL courseUrl = JunitTestHelper.class.getResource("file_resources/Basic_course.zip");
-			return deployCourse(initialAuthor, displayname, access, courseUrl);
+			return deployCourse(initialAuthor, displayname, status, allUsers, guests, courseUrl);
 		} catch (Exception e) {
 			log.error("", e);
 			return null;
 		}
 	}
 	
-	public static RepositoryEntry deployEmptyCourse(Identity initialAuthor, String displayname, int access) {
+	public static RepositoryEntry deployEmptyCourse(Identity initialAuthor, String displayname,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests) {
 		try {
 			URL courseUrl = JunitTestHelper.class.getResource("file_resources/Empty_course.zip");
-			return deployCourse(initialAuthor, displayname, access, courseUrl);
+			return deployCourse(initialAuthor, displayname, status, allUsers, guests, courseUrl);
 		} catch (Exception e) {
 			log.error("", e);
 			return null;
@@ -310,7 +338,7 @@ public class JunitTestHelper {
 	 * @return The repository entry of the course
 	 */
 	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, URL courseUrl) {
-		return deployCourse(initialAuthor, displayname, RepositoryEntry.ACC_USERS, courseUrl);
+		return deployCourse(initialAuthor, displayname, RepositoryEntryStatusEnum.published, true, false, courseUrl);
 	}
 	
 	/**
@@ -321,10 +349,11 @@ public class JunitTestHelper {
 	 * @param courseUrl The file to import
 	 * @return The repository entry of the course
 	 */
-	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, int access, URL courseUrl) {
+	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests, URL courseUrl) {
 		try {
 			File courseFile = new File(courseUrl.toURI());
-			return deployCourse(initialAuthor, displayname, courseFile, access);
+			return deployCourse(initialAuthor, displayname, courseFile, status, allUsers, guests);
 		} catch (URISyntaxException e) {
 			log.error("", e);
 			return null;
@@ -340,7 +369,7 @@ public class JunitTestHelper {
 	 * @return The repository entry of the course
 	 */
 	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, File courseFile) {	
-		return deployCourse(initialAuthor, displayname, courseFile, RepositoryEntry.ACC_USERS) ;
+		return deployCourse(initialAuthor, displayname, courseFile, RepositoryEntryStatusEnum.published, true, false) ;
 	}
 	
 	/**
@@ -351,7 +380,8 @@ public class JunitTestHelper {
 	 * @param access The access
 	 * @return The repository entry of the course
 	 */
-	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, File courseFile, int access) {		
+	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, File courseFile,
+			RepositoryEntryStatusEnum status, boolean allUsers, boolean guests) {		
 		try {
 			RepositoryHandler courseHandler = RepositoryHandlerFactory.getInstance()
 					.getRepositoryHandler(CourseModule.getCourseTypeName());
@@ -360,7 +390,7 @@ public class JunitTestHelper {
 			RepositoryEntry re = courseHandler.importResource(initialAuthor, null, displayname, "A course", true, defOrganisation, Locale.ENGLISH, courseFile, null);
 			
 			ICourse course = CourseFactory.loadCourse(re);
-			CourseFactory.publishCourse(course, access, false,  initialAuthor, Locale.ENGLISH);
+			CourseFactory.publishCourse(course, status, allUsers, guests, initialAuthor, Locale.ENGLISH);
 			return  CoreSpringFactory.getImpl(RepositoryManager.class).lookupRepositoryEntry(re.getKey());
 		} catch (Exception e) {
 			log.error("", e);
-- 
GitLab