diff --git a/DEVELOPERS.README b/DEVELOPERS.README
deleted file mode 100644
index b53b735b1acc5aa4997639d6e0d430a4e4927e2e..0000000000000000000000000000000000000000
--- a/DEVELOPERS.README
+++ /dev/null
@@ -1,17 +0,0 @@
-######################################################
-# OpenOLAT REST API Documentation
-######################################################
-
-To read the OpenOLAT REST API documentation:
-1) start OpenOLAT
-2) go to Administration -> Core configuration -> REST API
-3) Make sure the REST API ist enabled
-4) Click the documentation link in the admin panel or open YOURSERVERURL/restapi/api/doc in your browser
-
-
-For devs: if you modified the documentation in the source files, you need to compile 
-the REST API documentation. Do the follwing:
-
-mvn clean package
-mvn compile -Pdocumentation,tomcat
-
diff --git a/INSTALL.APPSERVER.README b/INSTALL.APPSERVER.README
deleted file mode 100644
index 19567087df7c4da04a9d3a1ca0929ceae46efd6f..0000000000000000000000000000000000000000
--- a/INSTALL.APPSERVER.README
+++ /dev/null
@@ -1,55 +0,0 @@
-
-EXPERIMENTAL: Setting up latest OpenOLAT version on Eclipse With an Application Server
---------------------------------------------------------------------------------------
-
-OpenOLAT supports only Tomcat officially, but it can also run on other application
-servers like JBoss AS / Wildfly. This README is intended for people who have
-some minimal experience with these servers and can install a JDBC driver, set some
-JMS resources...
-
-As of OpenOLAT 10, we need WildFly because we use JPA 2.1 (Hibernate 4.3.x)
-
-The beginning of the installation is the same as Tomcat, it's described in INSTALL.README.
-To create your eclipse project, use these commands instead of the default one:
-
-for JBoss AS:
-  mvn eclipse:clean eclipse:eclipse -P-tomcat,wildfly
-     
-Configuration WildFly (JBoss AS 10.1)
-------------------------------------
-
-1. We need Hibernate 5.2, you need to use the utorial to update the version of hibernate
-   in Widlfly: http://docs.jboss.org/hibernate/orm/5.2/topical/html_single/wildfly/Wildfly.html
-
-2. Define a JDBC connection pool in your standalone.xml configuration with a jndi-name like:
-     java:jboss/datasources/OpenOLATDS and set this JNDI name
-   in olat.local.properties set the following properties:
-     db.source=jndi
-     db.jndi=java:jboss/datasources/OpenOLATDS
-     cluster.mode=Cluster
-   The cluster mode will disable the hibernate cache
-3. Create a queue with a jndi-name like:
-     java:jboss/exported/jms/queue/searchQueue
-   and a topic:
-     java:jboss/exported/jms/topic/sysbus
-   in olat.local.properties set the following properties:
-     jms.provider=jndi
-     jms.broker.jndi=java:/ConnectionFactory
-     sysbus.broker.jndi=java:jboss/exported/jms/topic/sysbus
-     search.broker.jndi=java:jboss/exported/jms/queue/searchQueue
-     index.broker.jndi=java:jboss/exported/jms/queue/indexQueue
-     certificate.broker.jndi=java:jboss/exported/jms/queue/certificateQueue
-
-
-Features located on the application server
-------------------------------------------
-State              Feature
-------------------------------------------
-OK                 JDBC Connections
-OK                 JMS
-OK                 JAX-RS (restapi)
-OK                 JAX-WS (vitero, openmeetings)
-x                  Mail
-x                  LDAP Connection
-OK                 Hibernate/JPA (only JBoss AS, we depend on Hibernate)
-OK                 Caching (for JPA second level cache for example)
diff --git a/INSTALL.README b/INSTALL.README
deleted file mode 100644
index e8250f3bcbe03dac090d4c257b7c92086576a6ca..0000000000000000000000000000000000000000
--- a/INSTALL.README
+++ /dev/null
@@ -1,35 +0,0 @@
-1. Installing OpenOLAT 
-----------------------
-Please refer to the HTML documentation available at http://www.openolat.org
-
-
-2. Licensing
-----------------------
-With regard to licensing and copyright please refer to the file LICENSE and NOTICE.TXT
-
-
-3. Contact information
-----------------------
-You are welcome to participate in our development. If you make any patches to
-the code, please let us know on your mailing list.
-
-For further information about OpenOLAT please visit the product's website at
-
-http://www.openolat.org
-
-
-4. Mailing list
-----------------------
-A free and public mailinglist is hosted on Google groups: 
-https://groups.google.com/forum/#!forum/openolat
-If you do not have a google account you can register with just an email address
-through our openolat.org homepage. 
-
-
-5. Being a community member
-----------------------
-We strongly suggest to participate in the OpenOLAT community membership program. 
-Even though this software is free and open source, the development and management
-has to be funded by someone. If you like what we do and want the product to be
-maintained and developed in the long run you should consider purchasing a member
-ship.    
\ No newline at end of file
diff --git a/INSTALL.README.HEAD b/INSTALL.README.HEAD
deleted file mode 100644
index 0bf63aef3f4232b5e3b69efe715d818410970e00..0000000000000000000000000000000000000000
--- a/INSTALL.README.HEAD
+++ /dev/null
@@ -1,109 +0,0 @@
-Setting up latest OpenOLAT version on Eclipse
--------------------------------------------------------------------------
-
-o As the latest development is often ahead of the current documentation you will always find an up to date 
-  install guide here.
-
-
-*******************************************************************************************
-Setting up OpenOLAT in Eclipse
-*******************************************************************************************
-Preconditions:
-	o Check that you are using maven 2.2 or higher (mvn -V)
-	o Check that you have the mercurial plugin installed in eclipse (http://www.javaforge.com/project/HGE)
-	o Check that you have Mercurial (hg) installed
-	o MySQL 5.1 or greater or PostreSQL 8.4
-
-1. In Eclipse: create a Mercurial repository location (http://hg.openolat.org/openolat) and clone the repo.
-  1.1 Do not add a password and make sure you uncheck the init Mercurial repo checkbox at the end. Right 
-	  click to clone repo into your workspace.
-
-2. Setup Eclipse Environment
-  2.1 If M2_REPO Eclipse variable is missing then execute in terminal:
-   mvn -Declipse.workspace=<location of your workspace> eclipse:configure-workspace
-  2.2 In terminal: create eclipse project settings and create .classpath file by running
-   mvn eclipse:clean eclipse:eclipse
-
-3. In Eclipse: refresh the project. 
-
-4. Create an olat.local.properties file somewhere 
-  4.1 Copy the olat.local.properties.sample to olat.local.properties in the project root folder
-  4.2 Adjust the file to match your setup. See the comments in the file header for more configuration options.
-  4.3 Right click on the file src/main/java/olat.local.properties in our eclipse project to open the file 
-      properties and link it to your own olat.local.properties you created in step 4.1. 
-  
-5. In Eclipse: refresh the project again. 
-  5.1 Make sure the project compiled without errors. Warnings are ok. 
-  5.2 If the project did not compile you have to fix the problems before you proceed. See Troubleshooting below.
-      
-6. Prepare database permissions and initialize the database
-  6.1.a. In MySQL create a user 'openolat' and a database 'openolat'
-	CREATE DATABASE IF NOT EXISTS openolat;
-	GRANT ALL PRIVILEGES ON openolat.* TO 'openolat' IDENTIFIED BY 'openolat';
-	UPDATE mysql.user SET HOST='localhost' WHERE USER='openolat' AND HOST='%';
-	FLUSH PRIVILEGES;
-  6.1.b. Alternatively you can use a helper script to create the MySQL database user and the empty database:
-	scripts/dbAndUserSetup.sh
-  6.1.c. PostgreSQL users please check their PostgreSQL manual how to create a user and database 
-  6.2 Write the OpenOLAT database schema to the OpenOLAT database. Example for MySQL:
-	mysql -u openolat -p openolat < src/main/resources/database/mysql/setupDatabase.sql
-  6.3 Optional: if you want to run the jUnit tests, make sure you also create and initialize the test database
-      that you configured in src/test/profile/mysql/olat.local.properties
-
-7. In Eclipse: setup tomcat server by clicking on olat->Run As->"Run on Server". 
-  7.1 The Run on Server wizard will pop up and check: manually define a new server
-  7.2 look for Apache->Tomcat v6.0 or v7.0 Server
-  7.3 Add openolat as web application in the step "Add and remove" and click finish
-  7.4 Double click the newly created server and increase the timeout to something like 180s
-  7.5 Open the launch configuration of the server, select the tab Arguments and add these arguments to the VM arguments:
-      -XX:MaxPermSize=128m -Xms128m -Xmx384m -Djava.awt.headless=true
-  7.6 Open the generated server.xml file and manually set the following parameters: 
-      In the "Context" element set parameter reloadable="false" 
-      In all "Connector" elements set paramter URIEncoding="UTF-8"
-  7.7 Option: to use the application server database connection pool configure a jdbc data resource in the the 
-      "Context" element, set db.source=jndi in the olat.local.properties and  db.jndi to the name of the data source:
-        db.source=jndi
-	    db.jndi=java:comp/env/jdbc/OpenOLATDS
-	  Next add the resource descriptor to your tomcat context descriptor:
-	  	<Resource name="jdbc/OpenOLATDS" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="60000" username="openolat" password="openolat" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/openolat?useUnicode=true&amp;characterEncoding=UTF-8&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;autoReconnectForPools=true"/>	  
-      If unsure, set db.source=local to use the bundled data connection pool (not recommended for production)
-8. In Eclipse: start the server
-
-9. In your browser open URL http://localhost:8080/olat
-   You can log in with user "administrator" and password "openolat"
-   
-10. Have fun, give feedback and contribute!
-
-
-
-*******************************
-Troubleshooting
-*******************************
-
-A. OutOfMemoryException: in Eclipse: setup VM arguments by clicking on 
-   Run > Run Configurations > Arguments > VM Arguments and pasting:
-   -Xmx384m -Xms128m -XX:MaxPermSize=128m -Djava.awt.headless=true
-
-B. (optional) Create an empty olat.local.properties and save it to /yourTomcatDir/lib (OLAT searches for 
-   this file on the classpath and /tomcat/lib is part of it). But OLAT should start with just the default config!
-
-D. Usually you will get a timeout exception when you start a new OLAT. After double clicking on the server entry 
-   you can increase the timeout for the startup.
-
-E. If your tomcat starts very quickly but you cannot access OLAT it might be that tomcat did not find the OLAT 
-   context. Right click the server entry and click publish to inform eclipse about a new or updated context.
-
-F. If you run into problems with classes or resources not found e.g. "ClassNotFoundException" right click your 
-   server config and run the "Clean..." Task to republish all resources. Problems comes mostly when switching 
-   from eclipse to console and back with command like mvn clean, or eclipse clean and such. You will always get 
-   a clean and working environment when you do the following: Eclipse clean, create eclipse settings with launch, 
-   Server publish resources and restart OLAT.
-
-
-Background (optional for further interest)
-------------------------------------------------------------------
-
-o There is only one spring context for the whole OpenOLAT which you can access via CoreSpringFactory. The context 
-  is configured with the files serviceconfig/olat.properies and can be overwritten with olat.local.properties. 
-  changes in olat.local.properties are reflected upon each restart of Tomcat.
-  
\ No newline at end of file
diff --git a/README.md b/README.md
index ff8804e225f45ec78f124087355516b44d62c7bd..3bfe017f406593f8ae473bf6364122f3c97a49f6 100644
--- a/README.md
+++ b/README.md
@@ -7,3 +7,441 @@
 A sophisticated modular toolkit provides course authors with a wide range of didactic possibilities. Each OpenOLAT installation can be individually extended, adapted to organizational needs, and integrated into existing IT infrastructures. The architecture is designed for minimal resource consumption, scalability and security in order to guarantee high system reliability.
 
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
+
+## Table of Contents
+
+1. [Licensing](#licensing)
+2. [Ressources](#ressources)
+3. [Community](#being-a-community-member)
+4. [Developers](#developers)
+    * [Setting up OpenOLAT in Eclipse](#setting-up-openolat-in-eclipse)
+    * [Compress javascript and CSS](#compress-javascript-and-css)
+    * [REST API](#rest-api)
+    * [Automated tests](#automated-tests)
+    * [Experimental: setting up OpenOLAT on Eclipse with an Application Server](#experimental-setting-up-openolat-on-eclipse-with-an-application-server)
+
+## Licensing
+
+With regard to licensing and copyright please refer to the file [LICENSE](LICENSE) and [NOTICE.TXT](NOTICE.TXT)
+
+## Ressources 
+
+* [Installation](https://www.openolat.com/fileadmin/adminwiki/_START_.html)
+* [About OpenOLAT](https://www.openolat.com)
+* [Mailing list](https://groups.google.com/forum/#!forum/openolat)
+ 
+
+## Being a community member
+
+We strongly suggest to participate in the OpenOLAT community membership program. 
+Even though this software is free and open source, the development and management
+has to be funded by someone. If you like what we do and want the product to be
+maintained and developed in the long run you should consider purchasing a member
+ship.    
+
+## Developers
+
+### Setting up OpenOLAT in Eclipse
+
+This is an installation guide for developers.
+
+#### Preconditions
+* Check that you are using maven 3.1 or higher (mvn -V)
+* Check that you have the mercurial plugin installed in eclipse
+  [MercurialEclipse update site](https://bitbucket.org/mercurialeclipse/update-site/raw/default/)
+* Check that you have Mercurial (hg) installed
+* MySQL 5.6 or greater or PostreSQL 9.4
+
+#### 1. In Eclipse
+
+Create a Mercurial repository location (https://hg.openolat.org/openolat) and
+clone the repo. Do not add a password and make sure you uncheck the init Mercurial repo
+checkbox at the end. Right click to clone the repository into your workspace.
+
+If M2_REPO Eclipse variable is missing in Eclipse then execute in terminal:
+
+```bash
+mvn -Declipse.workspace=<location of your workspace> eclipse:configure-workspace
+```
+
+In a terminal, create the eclipse project and classpath settings by running:
+
+```bash
+mvn eclipse:clean eclipse:eclipse
+```
+
+Refresh the project. 
+
+You need now to create an olat.local.properties file somewhere. Copy the
+`olat.local.properties.sample` to `olat.local.properties` in the project root folder, adjust
+the file to match your setup. See the comments in the file header for more configuration
+options. Right click on the file `src/main/java/olat.local.properties` in our eclipse
+project to open the file properties and link it to your own olat.local.properties
+you created before. 
+  
+Make sure the project compiled without errors. Warnings are ok. If the project did not
+compile, you have to fix the problems before you proceed. See [Troubleshooting](#troubleshooting)
+section below.
+      
+#### 2. Setting up the database
+
+Prepare database permissions and initialize the database.
+ 
+*For MySQL*: create a user 'openolat' and a database 'openolat'
+
+```sql
+CREATE DATABASE IF NOT EXISTS openolat;
+GRANT ALL PRIVILEGES ON openolat.* TO 'openolat' IDENTIFIED BY 'openolat';
+UPDATE mysql.user SET HOST='localhost' WHERE USER='openolat' AND HOST='%';
+FLUSH PRIVILEGES;
+```
+
+*For PostgreSQL*: please check their PostgreSQL manual how to create a user and database.
+ 
+Write the OpenOLAT database schema to the OpenOLAT database. Example for MySQL:
+
+```bash
+mysql -u openolat -p openolat < src/main/resources/database/mysql/setupDatabase.sql
+```
+
+Optional: if you want to run the jUnit tests, make sure you also create and initialize the
+test database that you configured in `src/test/profile/mysql/olat.local.properties` for
+MySQL or `src/test/profile/postgresql/olat.local.properties` for PostgreSQL.
+
+
+#### 3. Setting up the Tomcat server in Eclipse
+
+Setup a tomcat server by clicking on OpenOLAT -> Run As -> "Run on Server". The
+"Run on Server" wizard will pop up and you define define a new server. Look for
+Apache -> Tomcat v8.0.
+
+Add openolat as web application in the step "Add and remove" and click finish.
+
+Double click the newly created server and increase the timeout to something like 180s.
+
+Open the launch configuration of the server, select the tab Arguments and add these
+arguments to the VM arguments:
+
+```
+-XX:+UseG1GC -XX:+UseStringDeduplication -Xms256m -Xmx1024m -Djava.awt.headless=true
+```
+
+Open the generated server.xml file and manually set the following parameters: 
+* In the "Context" element set parameter reloadable="false" 
+* In all "Connector" elements set paramter URIEncoding="UTF-8"
+
+Option: to use the application server database connection pool configure a jdbc data
+resource in the "Context" element, set db.source=jndi in the olat.local.properties with
+db.jndi to the name of the data source like this:
+
+```
+db.source=jndi
+db.jndi=java:comp/env/jdbc/OpenOLATDS
+```
+
+Next add the resource descriptor to your tomcat context descriptor.
+
+*For MySQL:*
+
+```xml
+<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" type="javax.sql.DataSource"
+          maxIdle="4" maxTotal="16" maxWaitMillis="10000"
+          name="jdbc/OpenOLATDS"
+          password="olat" username="olat"
+          url="jdbc:mysql://localhost:3306/openolat?useUnicode=true&amp;characterEncoding=UTF-8&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;autoReconnectForPools=true"
+          testOnBorrow="true" testOnReturn="false"
+          validationQuery="SELECT 1" validationQueryTimeout="-1"/>
+```
+
+*For PostreSQL:*
+
+```xml
+<Resource auth="Container" driverClassName="org.postgresql.Driver" type="javax.sql.DataSource"
+          maxIdle="4" maxTotal="16" maxWaitMillis="-1"
+          name="jdbc/OpenOLATPostgresDS"
+          username="postgres" password="postgres"
+          url="jdbc:postgresql://localhost:5432/olat"
+          testOnBorrow="true" testOnReturn="false"
+          validationQuery="SELECT 1" validationQueryTimeout="-1"/>
+```
+
+If unsure, set db.source=local to use the bundled data connection pool (not recommended for production)
+
+You can now start the server and open the following URL
+[http://localhost:8080/olat](http://localhost:8080/olat) in your favorite browser. You can
+log in with user "administrator" and password "openolat".
+   
+Have fun, give feedback and contribute!
+
+#### Troubleshooting
+
+* OutOfMemoryException: in Eclipse: setup VM arguments by clicking on Run > Run Configurations > Arguments > VM Arguments
+  and pasting: `-XX:+UseG1GC -XX:+UseStringDeduplication -Xms256m -Xmx1024m -Djava.awt.headless=true`
+
+* Optional: create an empty olat.local.properties and save it to /yourTomcatDir/lib
+  (OpenOLAT searches for this file on the classpath and /tomcat/lib is part of it). But it
+  should start with just the default config!
+
+* Usually you will get a timeout exception when you start a new OpenOLAT. After double clicking
+  on the server entry you can increase the timeout for the startup.
+
+* If your tomcat starts very quickly but you cannot access OpenOLAT it might be that tomcat did
+  not find the OpenOLAT context. Right click the server entry and click publish to inform eclipse
+  about a new or updated context.
+
+* If you run into problems with classes or resources not found e.g. "ClassNotFoundException" right click your 
+  server config and run the "Clean..." Task to republish all resources. Problems comes mostly when switching 
+  from eclipse to console and back with command like mvn clean, or eclipse clean and such. You will always get 
+  a clean and working environment when you do the following: Eclipse clean, create eclipse settings with launch, 
+  Server publish resources and restart OpenOLAT.
+
+### Background (optional for further interest)
+
+There is only one spring context for the whole OpenOLAT which you can access via
+CoreSpringFactory. The context is configured with the files`serviceconfig/olat.properies`
+and can be overwritten with `olat.local.properties`. Changes in olat.local.properties are
+reflected upon each restart of Tomcat. You can further override OpenOLAT settings with
+JVM arguments `-Dmy.option=enabled`.
+
+### Compress javascript and CSS
+
+The javascript and CSS files are minified and aggregated. If you make some changes, run the following
+command to compress them (execution time ca. 1-2 minutes) and refresh your Eclipse project:
+
+```bash
+mvn clean package
+mvn compile -compressjs,tomcat
+```
+
+### Themes
+
+[Readme](src/main/webapp/static/themes/themes.README)
+
+### REST API 
+
+To read the OpenOLAT REST API documentation:
+1. start OpenOLAT
+2. go to Administration -> Core configuration -> REST API
+3. Make sure the REST API ist enabled
+4. Click the documentation link in the admin panel or open YOURSERVERURL/restapi/api/doc in your browser
+
+For developer: if you modified the documentation in the source files, you need to compile 
+the REST API documentation. Do the following:
+
+```bash
+mvn clean package
+mvn compile -Pdocumentation,tomcat
+```
+
+The process need a lot of memory, give it 4 Gig.
+
+### Automated tests
+
+#### Preconditions
+
+* Make sure the following ports are not in use (Selenium, Tomcat )
+  `14444 / 8080 / 8009 / 8089`
+
+* Make sure you have a MySQL database version 5.6 with the InnoDB as default engine
+  or PostgreSQL 9.4 or newer. The server must be at localhost.
+
+* Make sure maven has enough memory. E.g execute the following:
+
+```bash
+export MAVEN_OPTS= -Xms512m -Xmx1024m
+mvn compile -Pdocumentation,tomcat
+```
+
+* Make sure the tmp directory is writable. E.g. execute the following.
+
+```bash
+ls -la `printenv TMPDIR`
+```
+
+#### Setup (necessary only once)
+
+Setup database users and tables in the pom.xml. The default settings are:
+
+```xml
+<test.env.db.name>olattest</test.env.db.name>
+<test.env.db.user>olat</test.env.db.user>
+<test.env.db.pass>olat</test.env.db.pass>
+```
+
+You can override them with -D in the command line.
+
+You need an empty database named olat. The maven command will create and drop
+databases automatically but need an existing database to do that. Here we will
+explain it with MySQL.
+
+Setup first an user for the database
+
+```sql
+CREATE USER 'olat'@'localhost' IDENTIFIED BY 'olat';
+```
+
+Create the database:
+
+```sql
+CREATE DATABASE IF NOT EXISTS olat;
+GRANT ALL PRIVILEGES ON olat.* TO 'olat' IDENTIFIED BY 'olat';
+UPDATE mysql.user SET HOST='localhost' WHERE USER='olat' AND HOST='%';
+FLUSH PRIVILEGES;
+```
+
+Create the real test database, it will set once the permissions:
+
+```sql
+CREATE DATABASE IF NOT EXISTS olattest;
+GRANT ALL PRIVILEGES ON olattest.* TO 'olat' IDENTIFIED BY 'olat';
+FLUSH PRIVILEGES;
+```
+
+Initialize the database
+```bash
+mysql -u olat -p olattest < src/main/resources/database/mysql/setupDatabase.sql
+```
+
+#### Execute JUnit tests
+
+The JUnit tests load the framework to execute (execution time ca. 10m)
+
+**For MySQL**
+
+```bash
+mvn clean test -Dwith-mysql -Ptomcat
+```
+
+The following options are available to configure the database connection:
+
+```bash  
+-Dtest.env.db.user=root
+-Dtest.env.db.pass=serial
+```
+
+**For PostgreSQL**
+
+```bash
+mvn clean test -Dwith-postgresql -Ptomcat
+```
+
+with the options:
+
+```bash
+-Dtest.env.db.postgresql.user=postgres
+-Dtest.env.db.postgresql.pass=serial
+```
+
+To only run the OpenOLAT test suite and exclude the unit tests of QtiWorks, add the following
+option:
+
+```bash
+-Dtest=org.olat.test.AllTestsJunit4
+```
+
+Example:
+
+```bash
+mvn clean test -Dwith-postgresql -Dtest.env.db.postgresql.pass=serial -Dtest=org.olat.test.AllTestsJunit4 -Ptomcat
+```
+
+#### Execute selenium functional tests
+
+The selenium integration tests start the whole web application in Tomcat 8.0. They run with
+Google Chrome and its WebDriver will be automatically downloaded (internet connection
+needed). It need to be installed the standard way on Mac or Linux.
+
+Execution time ca. 65m
+
+**For MySQL:**
+
+```bash
+mvn clean verify -DskipTests=true -Dwith-mysql -Ptomcat
+```
+
+**For PostgreSQL:**
+
+```bash
+mvn clean verify -DskipTests=true -Dwith-postgresql -Dtest.env.db.postgresql.pass=serial -Ptomcat
+```
+
+
+#### Execute a single selenium functional integration test in Eclipse
+
+First build the application without tests as before
+
+```bash
+mvn clean verify -DskipTests=true -DskipSeleniumTests=true -Ptomcat
+```
+
+Run single test as JUnit Test in Eclipse
+
+### Experimental: setting up OpenOLAT on Eclipse with an Application Server
+
+OpenOLAT supports only Apache Tomcat officially, but it can also run on other application
+servers like JBoss AS / Wildfly. This section is intended for people who have
+some minimal experience with these servers and can install a JDBC driver, set some
+JMS resources...
+
+As of OpenOLAT 10, we need WildFly because of JPA 2.1 (Hibernate 5.2.x)
+
+The beginning of the installation is the same as Tomcat as described above. To create
+ your eclipse project, use these commands instead of the default one:
+
+```bash
+ mvn eclipse:clean eclipse:eclipse -P-tomcat,wildfly
+```
+     
+#### Configuration WildFly (JBoss AS 10.1)
+
+We need Hibernate 5.2, you need to use the utorial 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:
+`java:jboss/datasources/OpenOLATDS` and set this JNDI name in olat.local.properties set
+the following properties:
+
+```
+db.source=jndi
+db.jndi=java:jboss/datasources/OpenOLATDS
+cluster.mode=Cluster
+```
+
+The cluster mode will disable the hibernate cache
+
+Create a queue with a jndi-name like this:
+
+```
+java:jboss/exported/jms/queue/searchQueue
+```
+
+and a topic:
+
+```
+java:jboss/exported/jms/topic/sysbus
+```
+
+in olat.local.properties set the following properties:
+
+```
+jms.provider=jndi
+jms.broker.jndi=java:/ConnectionFactory
+sysbus.broker.jndi=java:jboss/exported/jms/topic/sysbus
+search.broker.jndi=java:jboss/exported/jms/queue/searchQueue
+index.broker.jndi=java:jboss/exported/jms/queue/indexQueue
+certificate.broker.jndi=java:jboss/exported/jms/queue/certificateQueue
+```
+
+The following features are delegated to the application server
+
+| State | Feature |
+| --- | --- |
+| OK | JDBC Connections |
+| OK | JMS |
+| OK | JAX-RS (restapi) |
+| OK | JAX-WS (vitero, openmeetings) |
+| x | Mail |
+| x | LDAP Connection |
+| OK | Hibernate/JPA (only JBoss AS, we depend on Hibernate) |
+| OK | Caching (for JPA second level cache for example) |
+
diff --git a/TESTING.README.LATEST b/TESTING.README.LATEST
deleted file mode 100644
index 70e1e7ddb37310688afdfe908d404c44d4b0d664..0000000000000000000000000000000000000000
--- a/TESTING.README.LATEST
+++ /dev/null
@@ -1,93 +0,0 @@
-junit and integration tests in OpenOLAT 8
-=========================================
-
-* Preconditions
------------------------------------------
-- Make sure the following ports are not in use (Selenium, Tomcat )
-	14444 / 8080 / 8009 / 8089 
-
-- Make sure you have a MySQL database version 5.1 or 5.5 with the InnoDB as default engine 
-  The server must be at localhost. To change the config see databaseCorecontext.xml
-
-- Clone a clean project or remove any olat.local.properties you might have on the classpath. This is important!
-	
-- Make sure maven has enough memory. E.g execute the following:
-	export MAVEN_OPTS= -Xms512m -Xmx1024m
-	
-- Make sure the tmp directory is writable. E.g. execute the following.
-	ls -la `printenv TMPDIR`
-	
-
-* Setup (necessary only once)
------------------------------------------
-- Setup database users and tables in the pom.xml. The default settings are:
-    <test.env.db.name>olattest</test.env.db.name>
-    <test.env.db.user>olat</test.env.db.user>
-    <test.env.db.pass>olat</test.env.db.pass>
-    
-- Setup first an user for the database
-	CREATE USER 'olat'@'localhost' IDENTIFIED BY 'olat';
-    
-- Create a first database named olat (the maven create and drop databases automatically and need an existing database to do that)
-	CREATE DATABASE IF NOT EXISTS olat;
-	GRANT ALL PRIVILEGES ON olat.* TO 'olat' IDENTIFIED BY 'olat';
-	UPDATE mysql.user SET HOST='localhost' WHERE USER='olat' AND HOST='%';
-	FLUSH PRIVILEGES;
-	
-- Create the real test database in mysql:
-	CREATE DATABASE IF NOT EXISTS olattest;
-	GRANT ALL PRIVILEGES ON olattest.* TO 'olat' IDENTIFIED BY 'olat';
-	FLUSH PRIVILEGES;
-	
-- Initialize the database
-	mysql -u olat -p olattest < src/main/resources/database/mysql/setupDatabase.sql
-
-
-* Execute jUnit integration tests
----------------------------------
-- junit integration tests that load the framework to execute (execution time ca. 10m)
-  - MySQL
-	  mvn clean test -Dwith-mysql -Ptomcat
-	  or with more options
-	  mvn clean test -Dwith-mysql -Dtest.env.db.user=root -Dtest.env.db.pass=serial -Ptomcat
-	  
-  - PostgreSQL
-	  mvn clean test -Dwith-postgresql -Ptomcat
-	  or if you want to specify the password:
-	  mvn clean test -Dwith-postgresql -Dtest.env.db.postgresql.pass=serial -Ptomcat
-	  
-  - Oracle
-    The support of Oracle is still EXPERIMENTAL
-    - you need a clean database as the maven process doesn't create a new one (every time)
-    - You need more cursors (if you don't know what it is, don't run this tests :-): 
-      ALTER SYSTEM SET open_cursors = 400 SCOPE=BOTH;
-    - configure the olat.local.properties in src/test/profile/oracle
-    - you need to install the JDBC driver locally (one time) as there isn't any maven repo for them (licensing issue)
-      mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.0 -Dpackaging=jar -DcreateChecksum=true
-	then you can run the test suite
-	  mvn clean test -Dwith-oracle -Ptomcat
-
-- To only run the OpenOLAT test suite and exclude the unit tests of QtiWorks, add the following option: -Dtest=org.olat.test.AllTestsJunit4
-
-- The junit testresults can be found at target/surefire-reports/*
-  Double click the xml files in Eclipse to display the results in the standards jUnit console
-
-
-* Execute selenium functional integration tests
------------------------------------------------
-- selenium integration tests which started the whole web application in Tomcat (execution time ca. 30 - 45m)
-  - MySQL
-	mvn clean verify -DskipTests=true -Dwith-mysql -Ptomcat
-  - PostgreSQL
-	mvn clean verify -DskipTests=true -Dwith-postgresql -Dtest.env.db.postgresql.pass=serial -Ptomcat
-
-The Selenium tests can be run with Chrome browser. It need to be installed the standard way on
-Mac or Linux and the test process will download the WebDriver and found the browser.
-
-* Execute a single selenium functional integration test in Eclipse
-------------------------------------------------------------------
-- First build the application without tests as before
-	mvn clean verify -DskipTests=true -DskipSeleniumTests=true -Ptomcat
-
-- Run single test as JUnit Test in Eclipse
-
diff --git a/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java b/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java
index 85e95faccdb3c4738d94046387d87712303874a6..79bf6c8445e3d8888201e3d1c4c38eb13c20727f 100644
--- a/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java
+++ b/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java
@@ -34,6 +34,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.ExportUtil;
@@ -213,7 +214,6 @@ public class ChecklistCourseNode extends AbstractAccessableCourseNode {
 		Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, checkController, this, "o_cl_icon");
 		return new NodeRunConstructionResult(controller);
 	}
-
 	
 	@Override
 	public StatusDescription[] isConfigValid(CourseEditorEnv cev) {
@@ -224,10 +224,12 @@ public class ChecklistCourseNode extends AbstractAccessableCourseNode {
 		return oneClickStatusCache;
 	}
 
+	@Override
 	public RepositoryEntry getReferencedRepositoryEntry() {
 		return null;
 	}
 
+	@Override
 	public StatusDescription isConfigValid() {
 		if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }
 
@@ -298,7 +300,7 @@ public class ChecklistCourseNode extends AbstractAccessableCourseNode {
 	}
 	
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
 		if(getChecklistKey(cpm) != null) deleteChecklistKeyConf(cpm);
 		
@@ -326,7 +328,7 @@ public class ChecklistCourseNode extends AbstractAccessableCourseNode {
 		String exportContent = XStreamHelper.createXStreamInstance().toXML(checklist);
 		try {
 			exportStream.putNextEntry(new ZipEntry(filename));
-			IOUtils.write(exportContent, exportStream);
+			IOUtils.write(exportContent, exportStream, "UTF-8");
 			exportStream.closeEntry();
 		} catch (IOException e) {
 			log.error("", e);
diff --git a/src/main/java/de/bps/course/nodes/VCCourseNode.java b/src/main/java/de/bps/course/nodes/VCCourseNode.java
index 809cefc22542fdc2f39c72da3ed6869caae84f52..6f6d4c269d3e028cad5938c0ca7ce28e9c56583d 100644
--- a/src/main/java/de/bps/course/nodes/VCCourseNode.java
+++ b/src/main/java/de/bps/course/nodes/VCCourseNode.java
@@ -31,7 +31,6 @@ import org.olat.core.gui.control.generic.tabbable.TabbableDefaultController;
 import org.olat.core.id.Roles;
 import org.olat.core.util.Util;
 import org.olat.core.util.ValidationStatus;
-import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.course.condition.ConditionEditController;
 import org.olat.course.editor.CourseEditorEnv;
@@ -140,10 +139,9 @@ public class VCCourseNode extends AbstractAccessableCourseNode {
 		boolean moderator = roles.isOLATAdmin();
 		Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
 		if (!moderator) {
-			if(roles.isInstitutionalResourceManager() | roles.isAuthor()) {
+			if(roles.isLearnResourceManager() || roles.isAuthor()) {
 				RepositoryManager rm = RepositoryManager.getInstance();
-				ICourse course = CourseFactory.loadCourse(key);
-				RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+				RepositoryEntry re = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 				if (re != null) {
 					moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
 					if(!moderator) {
diff --git a/src/main/java/org/olat/admin/landingpages/model/Rule.java b/src/main/java/org/olat/admin/landingpages/model/Rule.java
index 7a048936c932811d8e2e48262860e5a78b397f5c..1306923c2b6407ca2694cbae8429d2a479b22253 100644
--- a/src/main/java/org/olat/admin/landingpages/model/Rule.java
+++ b/src/main/java/org/olat/admin/landingpages/model/Rule.java
@@ -90,7 +90,7 @@ public class Rule {
 				case AUTHOR: match &= roles.isAuthor(); break;
 				case USER_MGR: match &= roles.isUserManager(); break;
 				case GROUP_MGR: match &= roles.isGroupManager(); break;
-				case RSRC_MGR: match &= roles.isInstitutionalResourceManager(); break;
+				case RSRC_MGR: match &= roles.isLearnResourceManager(); break;
 				case POOL_MGR: match &= roles.isPoolAdmin(); break;
 				case ADMIN: match &= roles.isOLATAdmin(); break;
 				default: {
diff --git a/src/main/java/org/olat/admin/quota/GenericQuotaEditController.java b/src/main/java/org/olat/admin/quota/GenericQuotaEditController.java
index b033b999d626ffbe7a71aacaa21140dc06fa59dd..2c44ccc8e5ff014f472734a726dd6a631dbf8869 100644
--- a/src/main/java/org/olat/admin/quota/GenericQuotaEditController.java
+++ b/src/main/java/org/olat/admin/quota/GenericQuotaEditController.java
@@ -25,6 +25,9 @@
 
 package org.olat.admin.quota;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.link.Link;
@@ -34,6 +37,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLATSecurityException;
 import org.olat.core.util.vfs.Quota;
@@ -53,7 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired;
  *
  * @author gnaegi
  */
-public class GenericQuotaEditController extends BasicController {
+class GenericQuotaEditController extends BasicController {
 
 	private VelocityContainer myContent;
 	private QuotaForm quotaForm;
@@ -61,6 +65,8 @@ public class GenericQuotaEditController extends BasicController {
 	private Quota currentQuota;
 	private Link delQuotaButton;
 	
+	private List<OrganisationRef> organisations;
+	
 	@Autowired
 	private QuotaManager quotaManager;
 
@@ -75,8 +81,10 @@ public class GenericQuotaEditController extends BasicController {
 	 * @param wControl
 	 * @param quotaPath The path for which the quota should be edited
 	 */
-	GenericQuotaEditController(UserRequest ureq, WindowControl wControl, String relPath) {
+	GenericQuotaEditController(UserRequest ureq, WindowControl wControl, String relPath, List<? extends OrganisationRef> organisations) {
 		super(ureq, wControl);
+
+		this.organisations = organisations == null ? null : new ArrayList<>(organisations);
 		
 		// check if quota foqf.cannot.del.defaultr this path already exists
 		currentQuota = quotaManager.getCustomQuota(relPath);
@@ -136,7 +144,7 @@ public class GenericQuotaEditController extends BasicController {
 	}
 
 	private void initMyContent(UserRequest ureq) {
-		if (!quotaManager.hasQuotaEditRights(ureq.getIdentity(), ureq.getUserSession().getRoles())) {
+		if (!quotaManager.hasQuotaEditRights(ureq.getIdentity(), ureq.getUserSession().getRoles(), organisations)) {
 			throw new OLATSecurityException("Insufficient permissions to access QuotaController");
 		}
 
@@ -192,7 +200,9 @@ public class GenericQuotaEditController extends BasicController {
 	}
 
 	public Quota getQuota() {
-		if (currentQuota == null) throw new AssertException("getQuota called but currentQuota is null");
+		if (currentQuota == null) {
+			throw new AssertException("getQuota called but currentQuota is null");
+		}
 		return currentQuota;
 	}
 		
diff --git a/src/main/java/org/olat/admin/quota/QuotaController.java b/src/main/java/org/olat/admin/quota/QuotaController.java
index 66859d8a508337fc43d937c97fe63e3a958e4ba4..8932fc83f63ef7798dac32a30cede4c39f24b674 100644
--- a/src/main/java/org/olat/admin/quota/QuotaController.java
+++ b/src/main/java/org/olat/admin/quota/QuotaController.java
@@ -44,6 +44,7 @@ import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
 import org.olat.core.logging.OLATSecurityException;
+import org.olat.core.util.UserSession;
 import org.olat.core.util.vfs.Quota;
 import org.olat.core.util.vfs.QuotaManager;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -75,7 +76,8 @@ public class QuotaController extends BasicController {
 	public QuotaController(UserRequest ureq, WindowControl wControl) {
 		super(ureq, wControl);
 
-		if (!quotaManager.hasQuotaEditRights(ureq.getIdentity(), ureq.getUserSession().getRoles())) {
+		UserSession usess = ureq.getUserSession();
+		if (usess.getRoles().isOLATAdmin() || usess.getRoles().isSystemAdmin()) {
 			throw new OLATSecurityException("Insufficient permissions to access QuotaController");
 		}
 
diff --git a/src/main/java/org/olat/admin/quota/QuotaImpl.java b/src/main/java/org/olat/admin/quota/QuotaImpl.java
index 849fc45191dcb1c2815dc310e4f78ef2bbc60248..7058e764ae8a9114313eb88a51b51de22903e4e8 100644
--- a/src/main/java/org/olat/admin/quota/QuotaImpl.java
+++ b/src/main/java/org/olat/admin/quota/QuotaImpl.java
@@ -50,6 +50,7 @@ public class QuotaImpl implements Quota {
 	/**
 	 * @return The path
 	 */
+	@Override
 	public String getPath() {
 		return path;
 	}
@@ -57,6 +58,7 @@ public class QuotaImpl implements Quota {
 	/**
 	 * @return Quota in KB
 	 */
+	@Override
 	public Long getQuotaKB() {
 		return quotaKB;
 	}
@@ -64,22 +66,24 @@ public class QuotaImpl implements Quota {
 	/**
 	 * @return Upload Limit in KB.
 	 */
+	@Override
 	public Long getUlLimitKB() {
 		return ulLimitKB;
 	}
-	
+
+	@Override
 	public Long getRemainingSpace() {
-		long quotaKB = getQuotaKB().longValue();
+		long quotaInKB = getQuotaKB().longValue();
 		long remainingQuotaKB;
-		if (quotaKB == Quota.UNLIMITED) {
-			remainingQuotaKB = quotaKB;
+		if (quotaInKB == Quota.UNLIMITED) {
+			remainingQuotaKB = quotaInKB;
 		} else {
 			OlatRootFolderImpl container = new OlatRootFolderImpl(path, null);
 			long actualUsage = VFSManager.getUsageKB(container);
-			if (quotaKB - actualUsage < 0) {
+			if (quotaInKB - actualUsage < 0) {
 				remainingQuotaKB = 0l;
 			} else {
-				remainingQuotaKB = quotaKB - actualUsage;
+				remainingQuotaKB = quotaInKB - actualUsage;
 			}
 		}
 		return new Long(remainingQuotaKB);
diff --git a/src/main/java/org/olat/admin/quota/QuotaManagerImpl.java b/src/main/java/org/olat/admin/quota/QuotaManagerImpl.java
index 66633d4a184db805bad9fb89fd20e923de2ca30c..b6c7d79734ccefe8d1bbb9f95c46deabb44afb70 100644
--- a/src/main/java/org/olat/admin/quota/QuotaManagerImpl.java
+++ b/src/main/java/org/olat/admin/quota/QuotaManagerImpl.java
@@ -32,12 +32,14 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.olat.basesecurity.OrganisationRoles;
 import org.olat.core.commons.modules.bc.FolderConfig;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.id.Identity;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLATRuntimeException;
 import org.olat.core.logging.OLATSecurityException;
@@ -406,9 +408,9 @@ public class QuotaManagerImpl implements QuotaManager, InitializingBean {
 	}
 
 	@Override
-	public Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath) {
+	public Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath, List<? extends OrganisationRef> resourceOwnerships) {
 		try {
-			return new GenericQuotaEditController(ureq, wControl, relPath);
+			return new GenericQuotaEditController(ureq, wControl, relPath, resourceOwnerships);
 		} catch (OLATSecurityException e) {
 			log.warn("Try to access the quota editor without enough privilege", e);
 			GenericQuotaViewController viewCtrl = new GenericQuotaViewController(ureq, wControl, relPath);
@@ -424,7 +426,9 @@ public class QuotaManagerImpl implements QuotaManager, InitializingBean {
 	}
 
 	@Override
-	public boolean hasQuotaEditRights(Identity identity, Roles roles) {
-		return roles.isOLATAdmin() || roles.isUserManager() || roles.isInstitutionalResourceManager();
+	public boolean hasQuotaEditRights(Identity identity, Roles roles, List<OrganisationRef> organisationOwnerships) {
+		return roles.isOLATAdmin()
+				|| roles.hasRole(organisationOwnerships, OrganisationRoles.usermanager)
+				|| roles.hasRole(organisationOwnerships, OrganisationRoles.learnresourcemanager);
 	}
 }
diff --git a/src/main/java/org/olat/admin/site/UserAdminSiteDef.java b/src/main/java/org/olat/admin/site/UserAdminSiteDef.java
index fe169a43e6e15e28b64807ba5de17dfeb9411266..6cd26fe91290c795d1b13cf5b5e9deccb6fc52f0 100644
--- a/src/main/java/org/olat/admin/site/UserAdminSiteDef.java
+++ b/src/main/java/org/olat/admin/site/UserAdminSiteDef.java
@@ -32,13 +32,11 @@ import org.olat.core.gui.control.navigation.SiteConfiguration;
 import org.olat.core.gui.control.navigation.SiteDefinition;
 import org.olat.core.gui.control.navigation.SiteInstance;
 import org.olat.core.util.StringHelper;
+import org.olat.core.util.UserSession;
 
 /**
  * Initial Date:  Jan 16, 2006
- * @author Florian Gnaegi
- * 
- * Comment:  TODO
- * </pre>
+ * @author Florian Gnaegi d
  */
 public class UserAdminSiteDef extends AbstractSiteDefinition implements SiteDefinition {
 
@@ -50,7 +48,9 @@ public class UserAdminSiteDef extends AbstractSiteDefinition implements SiteDefi
 	public SiteInstance createSite(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
 		if(StringHelper.containsNonWhitespace(config.getSecurityCallbackBeanId())) {
 			return new UserAdminSite(this, ureq.getLocale());
-		} else if (ureq.getUserSession().getRoles().isUserManager()) {
+		} 
+		UserSession usess = ureq.getUserSession();
+		if (usess.getRoles().isOLATAdmin() || usess.getRoles().isUserManager()) {
 			// only open for olat-usermanagers
 			return new UserAdminSite(this, ureq.getLocale());
 		} 
diff --git a/src/main/java/org/olat/admin/user/SelectOrganisationController.java b/src/main/java/org/olat/admin/user/SelectOrganisationController.java
new file mode 100644
index 0000000000000000000000000000000000000000..105e99b52e5a317b71ccf9773406801ec9c983be
--- /dev/null
+++ b/src/main/java/org/olat/admin/user/SelectOrganisationController.java
@@ -0,0 +1,92 @@
+package org.olat.admin.user;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.components.form.flexible.FormItemContainer;
+import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
+import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
+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;
+import org.olat.core.id.Organisation;
+
+/**
+ * 
+ * Initial date: 26 avr. 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class SelectOrganisationController extends FormBasicController {
+	
+	private SingleSelection organisationEl;
+	
+	private final List<Organisation> organisations;
+	
+	public SelectOrganisationController(UserRequest ureq, WindowControl wControl, List<Organisation> organisations) {
+		super(ureq, wControl);
+		this.organisations = new ArrayList<>(organisations);
+		initForm(ureq);
+	}
+
+	@Override
+	protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
+		List<String> theKeys = new ArrayList<>();
+		List<String> theValues = new ArrayList<>();
+		
+		for(Organisation organisation:organisations) {
+			theKeys.add(organisation.getKey().toString());
+			theValues.add(organisation.getDisplayName());
+		}
+		organisationEl = uifactory.addDropdownSingleselect("select.organisation", formLayout,
+				theKeys.toArray(new String[theKeys.size()]), theValues.toArray(new String[theValues.size()]));
+
+		FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
+		formLayout.add(buttonsCont);
+		uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
+		uifactory.addFormSubmitButton("save", buttonsCont);
+	}
+
+	@Override
+	protected void doDispose() {
+		//
+	}
+	
+	public Organisation getSelectedOrganisation() {
+		Organisation organisation = null;
+		if(organisationEl.isOneSelected()) {
+			String selectedKey = organisationEl.getSelectedKey();
+			for(Organisation org:organisations) {
+				if(org.getKey().toString().equals(selectedKey)) {
+					organisation = org;
+				}
+			}
+		}
+		return organisation;
+	}
+
+	@Override
+	protected boolean validateFormLogic(UserRequest ureq) {
+		boolean allOk = super.validateFormLogic(ureq);
+		
+		organisationEl.clearError();
+		if(!organisationEl.isOneSelected()) {
+			organisationEl.setErrorKey("form.legende.mandatory", null);
+			allOk &= false;
+		}
+		
+		return allOk;
+	}
+
+	@Override
+	protected void formOK(UserRequest ureq) {
+		fireEvent(ureq, Event.DONE_EVENT);
+	}
+
+	@Override
+	protected void formCancelled(UserRequest ureq) {
+		fireEvent(ureq, Event.CANCELLED_EVENT);
+	}
+}
diff --git a/src/main/java/org/olat/admin/user/SystemRolesAndRightsController.java b/src/main/java/org/olat/admin/user/SystemRolesAndRightsController.java
index 6f4834b133790419490f36e6327f83c0d68fbe48..792c4d031b9382a389774e68ce79baba10c9e460 100644
--- a/src/main/java/org/olat/admin/user/SystemRolesAndRightsController.java
+++ b/src/main/java/org/olat/admin/user/SystemRolesAndRightsController.java
@@ -33,19 +33,26 @@ import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityModule;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.OrganisationService;
+import org.olat.core.commons.persistence.DB;
 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.FormLink;
 import org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement;
 import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
 import org.olat.core.gui.components.form.flexible.elements.SpacerElement;
 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.components.link.Link;
 import org.olat.core.gui.control.Controller;
+import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
+import org.olat.core.id.RolesByOrganisation;
 import org.olat.core.util.UserSession;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -72,16 +79,26 @@ public class SystemRolesAndRightsController extends FormBasicController {
 	private SpacerElement rolesSep;
 	private SingleSelection statusEl;
 	private SingleSelection anonymousEl;
-	private MultipleSelectionElement rolesEl;
+	private FormLayoutContainer rolesCont;
+	private FormLink addToOrganisationButton;
 	private MultipleSelectionElement sendLoginDeniedEmailEl;
+	private final List<MultipleSelectionElement> rolesEls = new ArrayList<>();
 
-	private 	List<String> roleKeys;
-	private 	List<String> roleValues;
 	private 	List<String> statusKeys;
 	private 	List<String> statusValues;
 	
 	private Identity editedIdentity;
+	private List<Organisation> organisations;
+	
+	private final Roles managerRoles;
+	private final List<Organisation> manageableOrganisations;
+	
+
+	private CloseableModalController cmc;
+	private SelectOrganisationController selectOrganisationCtrl;
 	
+	@Autowired
+	private DB dbInstance;
 	@Autowired
 	private BaseSecurity securityManager;
 	@Autowired
@@ -95,12 +112,15 @@ public class SystemRolesAndRightsController extends FormBasicController {
 	 * @param ureq
 	 * @param identity identity to be edited
 	 */
-	public SystemRolesAndRightsController(WindowControl wControl, UserRequest ureq, Identity identity){
-		super(ureq, wControl);
+	public SystemRolesAndRightsController(WindowControl wControl, UserRequest ureq, Identity identity) {
+		super(ureq, wControl, LAYOUT_BAREBONE);
 		this.editedIdentity = identity;
+		organisations = organisationService.getOrganisations(editedIdentity, OrganisationRoles.values());
+
+		managerRoles = ureq.getUserSession().getRoles();
+		manageableOrganisations = organisationService.getManageableOrganisations(getIdentity(), managerRoles, OrganisationRoles.usermanager);
 		
 		initStatusKeysAndValues();
-		initRolesKeysAndValues(ureq);
 		initForm(ureq);
 		update();
 	}
@@ -121,44 +141,114 @@ public class SystemRolesAndRightsController extends FormBasicController {
 			statusValues.add(translate("rightsForm.status.deleted"));
 		}
 	}
+
+	@Override
+	protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
+		boolean iAmOlatAdmin = managerRoles.isOLATAdmin();
+		
+		// anonymous
+		FormLayoutContainer anonymousCont = FormLayoutContainer.createDefaultFormLayout("anonc", getTranslator());
+		formLayout.add(anonymousCont);
+		
+		anonymousEl = uifactory.addRadiosVertical(
+				"anonymous", "rightsForm.isAnonymous", anonymousCont, 
+				new String[]{"true", "false"},
+				new String[]{translate("rightsForm.isAnonymous.true"), translate("rightsForm.isAnonymous.false")}
+		);
+		uifactory.addSpacerElement("syssep", anonymousCont, false);
+		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GUESTS.booleanValue()) {
+			anonymousEl.addActionListener(FormEvent.ONCLICK);
+		} else {
+			anonymousCont.setVisible(false);
+		}
+		
+		// roles
+		rolesCont = FormLayoutContainer.createDefaultFormLayout("rolesc", getTranslator());
+		formLayout.add(rolesCont);
+		
+		initFormRoles();
+		
+		FormLayoutContainer statusCont = FormLayoutContainer.createDefaultFormLayout("statusc", getTranslator());
+		formLayout.add(statusCont);
+		
+		statusEl = uifactory.addRadiosVertical(
+				"status", "rightsForm.status", statusCont,
+				statusKeys.toArray(new String[statusKeys.size()]),
+				statusValues.toArray(new String[statusKeys.size()])
+		);
+		statusEl.addActionListener(FormEvent.ONCHANGE);
+		sendLoginDeniedEmailEl = uifactory.addCheckboxesHorizontal("rightsForm.sendLoginDeniedEmail", statusCont, new String[]{"y"}, new String[]{translate("rightsForm.sendLoginDeniedEmail")});
+		sendLoginDeniedEmailEl.setLabel(null, null);
+		
+		rolesSep.setVisible(iAmOlatAdmin);
+		statusEl.setVisible(iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_INSTITUTIONAL_RESOURCE_MANAGER.booleanValue());
+		sendLoginDeniedEmailEl.setVisible(false);
+		
+		FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
+		statusCont.add(buttonGroupLayout);
+		uifactory.addFormCancelButton("cancel", buttonGroupLayout, ureq, getWindowControl());
+		uifactory.addFormSubmitButton("submit", buttonGroupLayout);
+	}
+
+	private void initFormRoles() {
+		for(Organisation organisation:organisations) {
+			initFormRoles(rolesCont, organisation);
+		}
+		List<Organisation> upgradeableToOrganisations = new ArrayList<>(manageableOrganisations);
+		upgradeableToOrganisations.removeAll(organisations);
+		if(!upgradeableToOrganisations.isEmpty()) {
+			addToOrganisationButton = uifactory.addFormLink("rightsForm.add.to.organisation", rolesCont, Link.BUTTON);
+		}
+
+		rolesSep = uifactory.addSpacerElement("rolesSep", rolesCont, false);
+	}
 	
-	private void initRolesKeysAndValues(UserRequest ureq) {
-		boolean iAmOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
+	private void initFormRoles(FormItemContainer formLayout, Organisation organisation) {
+		boolean iAmAdmin = managerRoles.isOLATAdmin() || managerRoles.hasRoleInParentLine(organisation, OrganisationRoles.administrator); 
+		
+		List<String> roleKeys = new ArrayList<>();
+		List<String> roleValues = new ArrayList<>();
 		
-		roleKeys = new ArrayList<>();
-		roleValues = new ArrayList<>();
+		roleKeys.add(OrganisationRoles.invitee.name());
+		roleValues.add(translate("rightsForm.isInvitee"));
+
+		roleKeys.add(OrganisationRoles.user.name());
+		roleValues.add(translate("rightsForm.isUser"));
 
-		if (iAmOlatAdmin) {
+		roleKeys.add(OrganisationRoles.coach.name());
+		roleValues.add(translate("rightsForm.isCoach"));
+
+		if (iAmAdmin) {
 			roleKeys.add(OrganisationRoles.usermanager.name());
 			roleValues.add(translate("rightsForm.isUsermanager"));
 		}
 		
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GROUPMANAGERS.booleanValue()) {
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GROUPMANAGERS.booleanValue()) {
 			roleKeys.add(OrganisationRoles.groupmanager.name());
 			roleValues.add(translate("rightsForm.isGroupmanager"));
 		}
 
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_POOLMANAGERS.booleanValue()) {
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_POOLMANAGERS.booleanValue()) {
 			roleKeys.add(OrganisationRoles.poolmanager.name());
 			roleValues.add(translate("rightsForm.isPoolmanager"));
 		}
 		
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_CURRICULUMMANAGERS.booleanValue()) {
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_CURRICULUMMANAGERS.booleanValue()) {
 			roleKeys.add(OrganisationRoles.curriculummanager.name());
 			roleValues.add(translate("rightsForm.isCurriculummanager"));
 		}
 
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_AUTHORS.booleanValue()) {
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_AUTHORS.booleanValue()) {
 			roleKeys.add(OrganisationRoles.author.name());
 			roleValues.add(translate("rightsForm.isAuthor"));
 		}
 
-		if (iAmOlatAdmin) {
+		if (iAmAdmin) {
 			roleKeys.add(OrganisationRoles.administrator.name());
 			roleValues.add(translate("rightsForm.isAdmin"));
 		}
 
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_INSTITUTIONAL_RESOURCE_MANAGER.booleanValue()) {
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_INSTITUTIONAL_RESOURCE_MANAGER.booleanValue()) {
 			roleKeys.add(OrganisationRoles.learnresourcemanager.name());
 			String iname = editedIdentity.getUser().getProperty("institutionalName", null);
 			roleValues.add(
@@ -167,71 +257,76 @@ public class SystemRolesAndRightsController extends FormBasicController {
 				: translate("rightsForm.isInstitutionalResourceManager")
 			);
 		}
-	}
-	
-	@Override
-	protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
-		boolean iAmOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
 		
-		anonymousEl = uifactory.addRadiosVertical(
-				"anonymous", "rightsForm.isAnonymous", formLayout, 
-				new String[]{"true", "false"},
-				new String[]{translate("rightsForm.isAnonymous.true"), translate("rightsForm.isAnonymous.false")}
-		);
-		SpacerElement sysSep = uifactory.addSpacerElement("syssep", formLayout, false);
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GUESTS.booleanValue()) {
-			anonymousEl.addActionListener(FormEvent.ONCLICK);
+		MultipleSelectionElement rolesEl;
+		if(organisations.size() == 1) {
+			rolesEl = uifactory.addCheckboxesVertical(
+					"roles-" + organisation.getKey(), "rightsForm.roles", formLayout,
+					roleKeys.toArray(new String[roleKeys.size()]),
+					roleValues.toArray(new String[roleValues.size()]), 1);
 		} else {
-			anonymousEl.setVisible(false);
-			sysSep.setVisible(false);
+			rolesEl = uifactory.addCheckboxesHorizontal(
+					"roles-" + organisation.getKey(), "rightsForm.roles", formLayout,
+					roleKeys.toArray(new String[roleKeys.size()]),
+					roleValues.toArray(new String[roleValues.size()]));
 		}
+		if(organisation.getParent() != null) {
+			rolesEl.setLabel("rightsForm.roles.for", new String[] { organisation.getDisplayName() });
+		}
+		rolesEl.setUserObject(new RolesElement(roleKeys, organisation, rolesEl));
+		rolesEl.setEnabled(iAmAdmin || managerRoles.hasRoleInParentLine(organisation, OrganisationRoles.usermanager));
 		
-		rolesEl = uifactory.addCheckboxesVertical(
-				"roles", "rightsForm.roles", formLayout,
-				roleKeys.toArray(new String[roleKeys.size()]),
-				roleValues.toArray(new String[roleValues.size()]), 1);
-		rolesSep = uifactory.addSpacerElement("rolesSep", formLayout, false);
-		
-		statusEl = uifactory.addRadiosVertical(
-				"status", "rightsForm.status", formLayout,
-				statusKeys.toArray(new String[statusKeys.size()]),
-				statusValues.toArray(new String[statusKeys.size()])
-		);
-		statusEl.addActionListener(FormEvent.ONCHANGE);
-		sendLoginDeniedEmailEl = uifactory.addCheckboxesHorizontal("rightsForm.sendLoginDeniedEmail", formLayout, new String[]{"y"}, new String[]{translate("rightsForm.sendLoginDeniedEmail")});
-		sendLoginDeniedEmailEl.setLabel(null, null);
-		
-		rolesSep.setVisible(iAmOlatAdmin);
-		statusEl.setVisible(iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_INSTITUTIONAL_RESOURCE_MANAGER.booleanValue());
-		sendLoginDeniedEmailEl.setVisible(false);
-		
-		FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
-		formLayout.add(buttonGroupLayout);
-		uifactory.addFormSubmitButton("submit", buttonGroupLayout);
-		uifactory.addFormCancelButton("cancel", buttonGroupLayout, ureq, getWindowControl());
+		rolesEls.add(rolesEl);
 	}
 	
 	private void update() {
 		Roles editedRoles = securityManager.getRoles(editedIdentity);
-
 		if(editedRoles.isGuestOnly()) {
 			anonymousEl.select("true", true);
 		} else {
 			anonymousEl.select("false", true);
 		}
 		
-		setRole(OrganisationRoles.usermanager, editedRoles.isUserManager());
-		setRole(OrganisationRoles.groupmanager, editedRoles.isGroupManager());
-		setRole(OrganisationRoles.author, editedRoles.isAuthor());
-		setRole(OrganisationRoles.administrator, editedRoles.isOLATAdmin());
-		if(editedRoles.isOLATAdmin()) {
+		for(MultipleSelectionElement rolesEl:rolesEls) {
+			RolesElement wrapper = (RolesElement)rolesEl.getUserObject();
+			update(wrapper, editedRoles.getRoles(wrapper.getOrganisation()));
+		}
+	}
+	
+	private void updateRoles() {
+		if(rolesSep != null) {
+			rolesCont.remove(rolesSep);
+		}
+		if(addToOrganisationButton != null) {
+			rolesCont.remove(addToOrganisationButton);
+		}
+		for(MultipleSelectionElement roleEl:rolesEls) {
+			rolesCont.remove(roleEl);
+		}
+		initFormRoles();
+		update();
+	}
+	
+	private void update(RolesElement wrapper, RolesByOrganisation editedRoles) {
+		wrapper.setRole(OrganisationRoles.user, editedRoles.isUser());
+		wrapper.setRole(OrganisationRoles.invitee, editedRoles.isInvitee());
+	
+		wrapper.setRole(OrganisationRoles.coach, editedRoles.isCoach());
+		wrapper.setRole(OrganisationRoles.author, editedRoles.isAuthor());
+
+		wrapper.setRole(OrganisationRoles.usermanager, editedRoles.isUserManager());
+		wrapper.setRole(OrganisationRoles.groupmanager, editedRoles.isGroupManager());
+		wrapper.setRole(OrganisationRoles.learnresourcemanager, editedRoles.isLearnResourceManager());
+		wrapper.setRole(OrganisationRoles.poolmanager, editedRoles.isPoolManager());
+		wrapper.setRole(OrganisationRoles.curriculummanager, editedRoles.isCurriculumManager());
+		
+		wrapper.setRole(OrganisationRoles.administrator, editedRoles.isAdministrator());
+		if(editedRoles.isAdministrator()) {
 			statusEl.setEnabled(false);
 		}
-		setRole(OrganisationRoles.learnresourcemanager, editedRoles.isInstitutionalResourceManager());
-		setRole(OrganisationRoles.poolmanager, editedRoles.isPoolAdmin());
-		setRole(OrganisationRoles.curriculummanager, editedRoles.isCurriculumManager());
+		
 		setStatus(editedIdentity.getStatus());
-		rolesEl.setVisible(!isAnonymous());
+		wrapper.getRolesEl().setVisible(!isAnonymous());
 		rolesSep.setVisible(!isAnonymous());
 	}
 	
@@ -248,23 +343,65 @@ public class SystemRolesAndRightsController extends FormBasicController {
 	public boolean isAnonymous() {
 		return anonymousEl.getSelectedKey().equals("true");
 	}
+
+	private Integer getStatus() {
+		return new Integer(statusEl.getSelectedKey());
+	}
 	
-	private boolean getRole(OrganisationRoles k) {
-		return roleKeys.contains(k.name()) && rolesEl.getSelectedKeys().contains(k.name());
+	public boolean getSendLoginDeniedEmail() {
+		return sendLoginDeniedEmailEl.isSelected(0);
 	}
 	
-	private void setRole(OrganisationRoles k, boolean enabled) {
-		if(roleKeys.contains(k.name()) && enabled) {
-			rolesEl.select(k.name(), enabled);
+	@Override
+	protected void event(UserRequest ureq, Controller source, Event event) {
+		if(selectOrganisationCtrl == source) {
+			if(event == Event.DONE_EVENT) {
+				doAddIdentityToOrganisation(selectOrganisationCtrl.getSelectedOrganisation());
+			}
+			cmc.deactivate();
+			cleanUp();
+		} else if(cmc == source) {
+			cleanUp();
 		}
+		super.event(ureq, source, event);
 	}
 	
-	private Integer getStatus() {
-		return new Integer(statusEl.getSelectedKey());
+	private void cleanUp() {
+		removeAsListenerAndDispose(selectOrganisationCtrl);
+		removeAsListenerAndDispose(cmc);
+		selectOrganisationCtrl = null;
+		cmc = null;
+	}
+
+	@Override
+	protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
+		if(addToOrganisationButton == source) {
+			doAddToOrganisation(ureq);
+		}
+		super.formInnerEvent(ureq, source, event);
 	}
 	
-	public boolean getSendLoginDeniedEmail() {
-		return sendLoginDeniedEmailEl.isSelected(0);
+	private void doAddToOrganisation(UserRequest ureq) {
+		if(selectOrganisationCtrl != null) return;
+		
+		List<Organisation> upgradeableToOrganisations = new ArrayList<>(manageableOrganisations);
+		upgradeableToOrganisations.removeAll(organisations);
+		selectOrganisationCtrl = new SelectOrganisationController(ureq, getWindowControl(), upgradeableToOrganisations);
+		listenTo(selectOrganisationCtrl);
+		
+		String title = translate("rightsForm.add.to.organisation");
+		cmc = new CloseableModalController(getWindowControl(), translate("close"), selectOrganisationCtrl.getInitialComponent(), true, title);
+		listenTo(cmc);
+		cmc.activate();	
+	}
+	
+
+	private void doAddIdentityToOrganisation(Organisation organisation) {
+		organisationService.addMember(organisation, editedIdentity, OrganisationRoles.user);
+		dbInstance.commit();
+		organisations = organisationService.getOrganisations(editedIdentity, OrganisationRoles.values());
+		
+		updateRoles();
 	}
 
 	@Override
@@ -282,76 +419,139 @@ public class SystemRolesAndRightsController extends FormBasicController {
 	 */
 	private void saveFormData(UserRequest ureq) {
 		UserSession usess = ureq.getUserSession();
-		boolean iAmOlatAdmin = usess.getRoles().isOLATAdmin();
-		boolean iAmUserManager = usess.getRoles().isUserManager();
-		List<String> currentRoles = securityManager.getRolesAsString(editedIdentity);
+		Roles editorRoles = usess.getRoles();
+		boolean iAmOlatAdmin = editorRoles.isOLATAdmin();
+	
+		Roles editedRoles = securityManager.getRoles(editedIdentity);
 		
 		// 1) general user type - anonymous or user
 		// anonymous users
-		boolean isAnonymous = currentRoles.contains(OrganisationRoles.guest.name());
-		Boolean canGuestsByConfig = BaseSecurityModule.USERMANAGER_CAN_MANAGE_GUESTS;	
-		if (canGuestsByConfig.booleanValue() || iAmOlatAdmin) {
+		boolean isAnonymous = editedRoles.isGuestOnly();
+		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GUESTS.booleanValue()) {
 			isAnonymous = anonymousEl.getSelectedKey().equals("true");
 		}
 		
+		if(isAnonymous) {
+			saveAnonymousData(ureq);
+		} else {
+			for(MultipleSelectionElement rolesEl:rolesEls) {
+				if(rolesEl.isEnabled()) {
+					RolesElement wrapper = (RolesElement)rolesEl.getUserObject();
+					saveOrganisationRolesFormData(wrapper, editedRoles, editorRoles);
+				}
+			}
+		}
+		
+		if ((iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_STATUS.booleanValue()) &&  !editedIdentity.getStatus().equals(getStatus()) ) {			
+			int oldStatus = editedIdentity.getStatus();
+			String oldStatusText = (oldStatus == Identity.STATUS_PERMANENT ? "permanent" : (oldStatus == Identity.STATUS_ACTIV ? "active" : (oldStatus == Identity.STATUS_LOGIN_DENIED ? "login_denied" : (oldStatus == Identity.STATUS_DELETED ? "deleted" : "unknown"))));
+			int newStatus = getStatus();
+			String newStatusText = (newStatus == Identity.STATUS_PERMANENT ? "permanent" : (newStatus == Identity.STATUS_ACTIV ? "active" : (newStatus == Identity.STATUS_LOGIN_DENIED ? "login_denied"	 : (newStatus == Identity.STATUS_DELETED ? "deleted" : "unknown"))));
+			if(oldStatus != newStatus && newStatus == Identity.STATUS_LOGIN_DENIED && getSendLoginDeniedEmail()) {
+				userBulkChangeManager.sendLoginDeniedEmail(editedIdentity);
+			}
+			
+			editedIdentity = securityManager.saveIdentityStatus(editedIdentity, newStatus);
+			logAudit("User::" + getIdentity().getName() + " changed account status for user::" + editedIdentity.getName() + " from::" + oldStatusText + " to::" + newStatusText, null);
+		}
+	}
+	
+	private void saveAnonymousData(UserRequest ureq) {
+		organisationService.setAsGuest(editedIdentity);
+		dbInstance.commit();
+		organisations = organisationService.getOrganisations(editedIdentity, OrganisationRoles.values());
+		updateRoles();
+	}
+	
+	private void saveOrganisationRolesFormData(RolesElement wrapper, Roles editedRoles, Roles editorRoles) {
+		
+		Organisation organisation = wrapper.getOrganisation();
+		boolean iAmUserManager = editorRoles.hasRoleInParentLine(organisation, OrganisationRoles.usermanager);
+		boolean iAmAdmin = editorRoles.isOLATAdmin() || editorRoles.hasRoleInParentLine(organisation, OrganisationRoles.administrator);
+		
+		RolesByOrganisation editedOrganisationRoles = editedRoles.getRoles(wrapper.getOrganisation());
+
 		// 2) system roles
+		boolean invitee = wrapper.getRole(OrganisationRoles.invitee);
+		boolean user = wrapper.getRole(OrganisationRoles.user);
+		boolean coach = wrapper.getRole(OrganisationRoles.coach);
+
 		// group manager
-		boolean groupManager = currentRoles.contains(OrganisationRoles.groupmanager.name());
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GROUPMANAGERS.booleanValue()) {
-			groupManager = getRole(OrganisationRoles.groupmanager);
+		boolean groupManager = editedOrganisationRoles.hasRole(OrganisationRoles.groupmanager);
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_GROUPMANAGERS.booleanValue()) {
+			groupManager = wrapper.getRole(OrganisationRoles.groupmanager);
 		}
 		// pool manager
-		boolean poolmanager = currentRoles.contains(OrganisationRoles.poolmanager.name());
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_POOLMANAGERS.booleanValue()) {
-			poolmanager = getRole(OrganisationRoles.poolmanager);
+		boolean poolmanager = editedOrganisationRoles.hasRole(OrganisationRoles.poolmanager);
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_POOLMANAGERS.booleanValue()) {
+			poolmanager = wrapper.getRole(OrganisationRoles.poolmanager);
 		}
 		// curriculum manager
-		boolean curriculummanager = currentRoles.contains(OrganisationRoles.curriculummanager.name());
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_POOLMANAGERS.booleanValue()) {
-			curriculummanager = getRole(OrganisationRoles.curriculummanager);
+		boolean curriculummanager = editedOrganisationRoles.hasRole(OrganisationRoles.curriculummanager);
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_POOLMANAGERS.booleanValue()) {
+			curriculummanager = wrapper.getRole(OrganisationRoles.curriculummanager);
 		}
 		// author
-		boolean author = currentRoles.contains(OrganisationRoles.author.name());
-		if (iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_AUTHORS.booleanValue()) {
-			author = getRole(OrganisationRoles.author);
+		boolean author = editedOrganisationRoles.hasRole(OrganisationRoles.author);
+		if (iAmAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_AUTHORS.booleanValue()) {
+			author = wrapper.getRole(OrganisationRoles.author);
 		}
 		// user manager, only allowed by admin
-		boolean usermanager = currentRoles.contains(OrganisationRoles.usermanager.name());
-		if (iAmOlatAdmin) {
-			usermanager = getRole(OrganisationRoles.usermanager);
+		boolean usermanager = editedOrganisationRoles.hasRole(OrganisationRoles.usermanager);
+		if (iAmAdmin) {
+			usermanager = wrapper.getRole(OrganisationRoles.usermanager);
 		}
 	 	// institutional resource manager, only allowed by admin
-		boolean learnresourcemanager = currentRoles.contains(OrganisationRoles.learnresourcemanager.name());
-		if (iAmUserManager || iAmOlatAdmin) {
-			learnresourcemanager = getRole(OrganisationRoles.learnresourcemanager);
+		boolean learnresourcemanager = editedOrganisationRoles.hasRole(OrganisationRoles.learnresourcemanager);
+		if (iAmUserManager || iAmAdmin) {
+			learnresourcemanager = wrapper.getRole(OrganisationRoles.learnresourcemanager);
 		}
 		// system administrator, only allowed by admin
-		boolean admin = currentRoles.contains(OrganisationRoles.administrator.name());
-		if (iAmOlatAdmin) {
-			admin = getRole(OrganisationRoles.administrator);
+		boolean admin = editedOrganisationRoles.hasRole(OrganisationRoles.administrator);
+		if (iAmAdmin) {
+			admin = wrapper.getRole(OrganisationRoles.administrator);
 		}
 		
-		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		Roles updatedRoles = new Roles(false, admin, usermanager, groupManager, author, isAnonymous,
-				learnresourcemanager, poolmanager, curriculummanager, false);//TODO roles
-		securityManager.updateRoles(getIdentity(), editedIdentity, defOrganisation, updatedRoles);
-		
-		if ((iAmOlatAdmin || BaseSecurityModule.USERMANAGER_CAN_MANAGE_STATUS.booleanValue()) &&  !editedIdentity.getStatus().equals(getStatus()) ) {			
-			int oldStatus = editedIdentity.getStatus();
-			String oldStatusText = (oldStatus == Identity.STATUS_PERMANENT ? "permanent" : (oldStatus == Identity.STATUS_ACTIV ? "active" : (oldStatus == Identity.STATUS_LOGIN_DENIED ? "login_denied" : (oldStatus == Identity.STATUS_DELETED ? "deleted" : "unknown"))));
-			int newStatus = getStatus();
-			String newStatusText = (newStatus == Identity.STATUS_PERMANENT ? "permanent" : (newStatus == Identity.STATUS_ACTIV ? "active" : (newStatus == Identity.STATUS_LOGIN_DENIED ? "login_denied"	 : (newStatus == Identity.STATUS_DELETED ? "deleted" : "unknown"))));
-			if(oldStatus != newStatus && newStatus == Identity.STATUS_LOGIN_DENIED && getSendLoginDeniedEmail()) {
-				userBulkChangeManager.sendLoginDeniedEmail(editedIdentity);
-			}
-			
-			editedIdentity = securityManager.saveIdentityStatus(editedIdentity, newStatus);
-			logAudit("User::" + getIdentity().getName() + " changed account status for user::" + editedIdentity.getName() + " from::" + oldStatusText + " to::" + newStatusText, null);
-		}
+		RolesByOrganisation updatedRoles = RolesByOrganisation.roles(wrapper.getOrganisation(),
+				invitee, user, coach, author,
+				groupManager, poolmanager, curriculummanager,
+				usermanager, learnresourcemanager, admin);
+		securityManager.updateRoles(getIdentity(), editedIdentity, updatedRoles);
 	}
 
 	@Override
 	protected void doDispose() {
 		// nothing to do
 	}
+	
+	private class RolesElement {
+		
+		private final List<String> roleKeys;
+		private final Organisation organisation;
+		private final MultipleSelectionElement rolesEl;
+		
+		public RolesElement(List<String> roleKeys, Organisation organisation, MultipleSelectionElement rolesEl) {
+			this.roleKeys = roleKeys;
+			this.rolesEl = rolesEl;
+			this.organisation = organisation;
+		}
+		
+		public MultipleSelectionElement getRolesEl() {
+			return rolesEl;
+		}
+		
+		public Organisation getOrganisation() {
+			return organisation;
+		}
+		
+		private boolean getRole(OrganisationRoles k) {
+			return roleKeys.contains(k.name()) && rolesEl.getSelectedKeys().contains(k.name());
+		}
+		
+		private void setRole(OrganisationRoles k, boolean enabled) {
+			if(roleKeys.contains(k.name()) && enabled) {
+				rolesEl.select(k.name(), enabled);
+			}
+		}
+	}
 }
diff --git a/src/main/java/org/olat/admin/user/UserAdminController.java b/src/main/java/org/olat/admin/user/UserAdminController.java
index 14fbefd1befc1b8c0c8366ad78222a6aa749ac4b..bd70419eb707a7b333db747390126e76de9edc6d 100644
--- a/src/main/java/org/olat/admin/user/UserAdminController.java
+++ b/src/main/java/org/olat/admin/user/UserAdminController.java
@@ -51,6 +51,7 @@ import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
 import org.olat.core.gui.control.generic.dtabs.Activateable2;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.context.ContextEntry;
 import org.olat.core.id.context.StateEntry;
@@ -388,7 +389,8 @@ public class UserAdminController extends BasicController implements Activateable
 		if (canQuota.booleanValue() || isOlatAdmin) {
 			userTabP.addTab(translate(NLS_EDIT_UQUOTA),  uureq -> {
 				String relPath = FolderConfig.getUserHomes() + "/" + identity.getName();
-				quotaCtr = quotaManager.getQuotaEditorInstance(uureq, getWindowControl(), relPath);
+				List<Organisation> identityOrganisations = organisationService.getOrganisations(identity, OrganisationRoles.values());
+				quotaCtr = quotaManager.getQuotaEditorInstance(uureq, getWindowControl(), relPath, identityOrganisations);
 				return quotaCtr.getInitialComponent();
 			});
 		}
diff --git a/src/main/java/org/olat/admin/user/UserCreateController.java b/src/main/java/org/olat/admin/user/UserCreateController.java
index 8f3c44f1506d641f9100d27b8039413cc2da140a..a8a29fd8b12cb14415950040ed3861de0b977d1a 100644
--- a/src/main/java/org/olat/admin/user/UserCreateController.java
+++ b/src/main/java/org/olat/admin/user/UserCreateController.java
@@ -25,10 +25,13 @@
 
 package org.olat.admin.user;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
 import org.olat.basesecurity.BaseSecurity;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.events.SingleIdentityChosenEvent;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
@@ -45,6 +48,7 @@ import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.User;
 import org.olat.core.id.UserConstants;
 import org.olat.core.logging.OLog;
@@ -135,20 +139,30 @@ class NewUserForm extends FormBasicController {
 	private static final String FIELD_NEW2 = "passwordnew2";
 	private static final String LOGINNAME = "loginname";
 	private static final String USER_CREATE_SUCCESS = "user successfully created: ";
-	private List<UserPropertyHandler> userPropertyHandlers;
+	
+
 	private boolean showPasswordFields = false;
+	private List<UserPropertyHandler> userPropertyHandlers;
+	private List<Organisation> manageableOrganisations;
 	
 	private TextElement emailTextElement;
 	private TextElement usernameTextElement;
 	private TextElement psw1TextElement;
 	private TextElement psw2TextElement;
+	private SingleSelection organisationsElement;
 	private SingleSelection languageSingleSelection;
 	private SelectionElement authCheckbox;
 	
+	
+	
 	@Autowired
 	private UserModule userModule;
 	@Autowired
+	private UserManager userManager;
+	@Autowired
 	private BaseSecurity securityManager;
+	@Autowired
+	private OrganisationService organisationService;
 
 	/**
 	 * 
@@ -159,8 +173,10 @@ class NewUserForm extends FormBasicController {
 	 */
 	public NewUserForm(UserRequest ureq, WindowControl wControl, boolean showPasswordFields, Translator translator) {
 		super(ureq, wControl);
+		setTranslator(translator);
 		this.showPasswordFields = showPasswordFields;
-		this.setTranslator(translator);
+		manageableOrganisations = organisationService
+				.getManageableOrganisations(getIdentity(), ureq.getUserSession().getRoles(), OrganisationRoles.usermanager);
 		initForm(ureq);
 	}	 
 	
@@ -175,9 +191,8 @@ class NewUserForm extends FormBasicController {
 		usernameTextElement.setMandatory(true);
 		usernameTextElement.setDisplaySize(30);
 		usernameTextElement.setElementCssClass("o_sel_id_username");
-		
-		UserManager um = UserManager.getInstance();
-		userPropertyHandlers = um.getUserPropertyHandlersFor(USER_PROPS_IDENTIFIER, true);
+
+		userPropertyHandlers = userManager.getUserPropertyHandlersFor(USER_PROPS_IDENTIFIER, true);
 		// Add all available user fields to this form
 		for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
 			if (userPropertyHandler == null) continue;
@@ -202,6 +217,19 @@ class NewUserForm extends FormBasicController {
 		// select default language in form
 		languageSingleSelection.select(I18nModule.getDefaultLocale().toString(), true);
 		
+		List<String> organisationKeys = new ArrayList<>();
+		List<String> organisationValues = new ArrayList<>();
+		for(Organisation organisation:manageableOrganisations) {
+			organisationKeys.add(organisation.getKey().toString());
+			organisationValues.add(organisation.getDisplayName());
+		}
+		organisationsElement = uifactory.addDropdownSingleselect("new.form.organisations", formLayout,
+				organisationKeys.toArray(new String[organisationKeys.size()]), organisationValues.toArray(new String[organisationValues.size()]), null);
+		organisationsElement.setVisible(organisationKeys.size() > 1);
+		if(!organisationKeys.isEmpty()) {
+			organisationsElement.select(organisationKeys.get(0), true);
+		}
+		
 		//add password fields!!!
 		if (showPasswordFields) {
 			uifactory.addStaticTextElement("heading2", null, translate("new.form.please.enter.pwd"), formLayout);
@@ -242,62 +270,69 @@ class NewUserForm extends FormBasicController {
 	
 	@Override
 	protected boolean validateFormLogic(UserRequest ureq) {
+		boolean allOk = super.validateFormLogic(ureq);
+		
 		// validate if username does match the syntactical login requirements
 		String loginName = usernameTextElement.getValue();
-		if (usernameTextElement.isEmpty() || !UserManager.getInstance().syntaxCheckOlatLogin(loginName)) {			
+		usernameTextElement.clearError();
+		if (usernameTextElement.isEmpty() || !userManager.syntaxCheckOlatLogin(loginName)) {			
 			usernameTextElement.setErrorKey("new.error.loginname.empty", new String[]{});
-			return false;
-		}
-		// Check if login is still available
-		Identity identity = securityManager.findIdentityByName(loginName);
-		if (identity != null) {			
-			usernameTextElement.setErrorKey("new.error.loginname.choosen", new String[]{});
-			return false;
+			allOk &= false;
+		} else {
+			// Check if login is still available
+			Identity identity = securityManager.findIdentityByName(loginName);
+			if (identity != null) {			
+				usernameTextElement.setErrorKey("new.error.loginname.choosen", new String[]{});
+				allOk &= false;
+			}
 		}
-		usernameTextElement.clearError();
 
 		// validate special rules for each user property
 		for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {			
 			//we assume here that there are only textElements for the user properties
 			FormItem formItem = flc.getFormComponent(userPropertyHandler.getName());
+			formItem.clearError();
 			if ( ! userPropertyHandler.isValid(null, formItem, null) || formItem.hasError()) {
-				return false;				
+				allOk &= false;				
 			}
-			formItem.clearError();
 		}
 
 		// special test on email address: validate if email is already used
 		String email = emailTextElement.getValue();
-		if (!UserManager.getInstance().isEmailAllowed(email)) {
+		emailTextElement.clearError();
+		if (!userManager.isEmailAllowed(email)) {
 			emailTextElement.setErrorKey("new.error.email.choosen", new String[] {});
-			return false;
+			allOk &= false;
+		}
+		
+		// organization
+		organisationsElement.clearError();
+		if(organisationsElement.isVisible() && !organisationsElement.isOneSelected()) {
+			organisationsElement.setErrorKey("form.legende.mandatory", null);
+			allOk &= false;
 		}
 
-		// validate if new password does match the syntactical password requirements
-
+		// validate if new password does match the syntactical password requirement
 		// password fields depend on form configuration
-		if (showPasswordFields && psw1TextElement!=null && psw2TextElement!=null && authCheckbox.isSelected(0)) {
+		if (showPasswordFields && psw1TextElement != null && psw2TextElement != null && authCheckbox.isSelected(0)) {
+			psw1TextElement.clearError();
+			psw2TextElement.clearError();
+			
 			String pwd = psw1TextElement.getValue();
 			if(psw1TextElement.isEmpty("new.form.mandatory") || psw1TextElement.hasError()) {
-				return false;
-			}
-			if (!UserManager.getInstance().syntaxCheckOlatPassword(pwd)) {					
+				allOk &= false;
+			} else if (!userManager.syntaxCheckOlatPassword(pwd)) {					
 				psw1TextElement.setErrorKey("form.checkPassword", new String[]{});					
-				return false;
+				allOk &=  false;
 			}
-			psw1TextElement.clearError();
 			if(psw2TextElement.isEmpty("new.form.mandatory") || psw2TextElement.hasError()) {
-				return false;
-			}
-			// validate that both passwords are the same
-			if (!pwd.equals(psw2TextElement.getValue())) {
+				allOk &= false;
+			} else if (!pwd.equals(psw2TextElement.getValue())) {
 				psw2TextElement.setErrorKey("new.error.password.nomatch", new String []{});
-				return false;
+				allOk &= false;
 			}
-			psw2TextElement.clearError();
 		}
-		// all checks passed
-		return true;
+		return allOk;
 	}
 	
 	@Override
@@ -333,18 +368,27 @@ class NewUserForm extends FormBasicController {
 		}
 		// Create new user and identity and put user to users group
 		// Create transient user without firstName,lastName, email
-		UserManager um = UserManager.getInstance();
-		User newUser = um.createUser(null, null, null);
+		User newUser = userManager.createUser(null, null, null);
 		// Now add data from user fields (firstName,lastName and email are mandatory)
 		for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
-			FormItem propertyItem = this.flc.getFormComponent(userPropertyHandler.getName());
+			FormItem propertyItem = flc.getFormComponent(userPropertyHandler.getName());
 			userPropertyHandler.updateUserFromFormItem(newUser, propertyItem);
 		}
 		// Init preferences
 		newUser.getPreferences().setLanguage(lang);
 		newUser.getPreferences().setInformSessionTimeout(true);
 		// Save everything in database
-		return securityManager.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(username, null, pwd, newUser);
+		Organisation userOrganisation = null;
+		if(organisationsElement.isOneSelected()) {
+			String selectedOrganisationKey = organisationsElement.getSelectedKey();
+			for(Organisation organisation: manageableOrganisations) {
+				if(selectedOrganisationKey.equals(organisation.getKey().toString())) {
+					userOrganisation = organisation;
+					break;
+				}
+			}
+		}
+		return securityManager.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(username, null, pwd, newUser, userOrganisation);
 	}
 	
 	@Override
diff --git a/src/main/java/org/olat/admin/user/UserSearchController.java b/src/main/java/org/olat/admin/user/UserSearchController.java
index 3aae1aac53fec4b8b1d0ec8cb667c0522e59f0f1..32a80abb841169c29448d9a05564d11145df74f9 100644
--- a/src/main/java/org/olat/admin/user/UserSearchController.java
+++ b/src/main/java/org/olat/admin/user/UserSearchController.java
@@ -27,6 +27,7 @@ import java.util.Map;
 
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityModule;
+import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.SearchIdentityParams;
 import org.olat.basesecurity.events.MultiIdentityChosenEvent;
@@ -184,7 +185,8 @@ public class UserSearchController extends BasicController {
 		if(usess.getRoles().isOLATAdmin()) {
 			searchableOrganisations = null;//null mean all
 		} else {
-			searchableOrganisations = organisationService.getSearchableOrganisations(getIdentity(), usess.getRoles());
+			searchableOrganisations = organisationService
+					.getSearchableOrganisations(getIdentity(), usess.getRoles(), OrganisationRoles.usermanager);
 		}
 		
 		Roles roles = usess.getRoles();
diff --git a/src/main/java/org/olat/admin/user/UserSearchFlexiController.java b/src/main/java/org/olat/admin/user/UserSearchFlexiController.java
index e6d8eda303733124a13c3080b571753d830566c2..11061ff5d19b776d7caf569fcb6e181045346fe5 100644
--- a/src/main/java/org/olat/admin/user/UserSearchFlexiController.java
+++ b/src/main/java/org/olat/admin/user/UserSearchFlexiController.java
@@ -29,6 +29,7 @@ import java.util.Set;
 
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityModule;
+import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.SearchIdentityParams;
 import org.olat.basesecurity.events.SingleIdentityChosenEvent;
@@ -139,7 +140,8 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
 		if(usess.getRoles().isOLATAdmin()) {
 			searchableOrganisations = null;//null mean all
 		} else {
-			searchableOrganisations = organisationService.getSearchableOrganisations(getIdentity(), usess.getRoles());
+			searchableOrganisations = organisationService
+					.getSearchableOrganisations(getIdentity(), usess.getRoles(), OrganisationRoles.usermanager);
 		}
 
 		ListProvider provider = new UserSearchListProvider(searchableOrganisations);
diff --git a/src/main/java/org/olat/admin/user/UsermanagerUserSearchController.java b/src/main/java/org/olat/admin/user/UsermanagerUserSearchController.java
index 590c9b01934577d6a4dbe3204e31e2b74190be64..e28296913e96239b7fec447a31a47080bdc61b83 100644
--- a/src/main/java/org/olat/admin/user/UsermanagerUserSearchController.java
+++ b/src/main/java/org/olat/admin/user/UsermanagerUserSearchController.java
@@ -101,7 +101,8 @@ public class UsermanagerUserSearchController extends BasicController implements
 
 	private UsermanagerUserSearchForm searchFormCtrl;
 	private UserSearchTableController tableCtr;
-	private List<Identity> identitiesList, selectedIdentities;
+	private List<Identity> identitiesList;
+	private List<Identity> selectedIdentities;
 	private List<String> notUpdatedIdentities = new ArrayList<>();
 	private ExtendedIdentitiesTableDataModel tdm;
 	private ContactFormController contactCtr;
@@ -112,7 +113,7 @@ public class UsermanagerUserSearchController extends BasicController implements
 	
 	
 	private final boolean isAdministrativeUser;
-	private List<Organisation> parentOrganisations;
+	private List<Organisation> manageableOrganisations;
 	private SearchIdentityParams identityQueryParams;
 	
 	@Autowired
@@ -131,12 +132,12 @@ public class UsermanagerUserSearchController extends BasicController implements
 	 * @param wControl
 	 */
 	public UsermanagerUserSearchController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackedPanel,
-			List<Organisation> parentOrganisations) {
+			List<Organisation> manageableOrganisations) {
 		super(ureq, wControl);
 		setTranslator(userManager.getPropertyHandlerTranslator(getTranslator()));
 		
 		this.stackedPanel = stackedPanel;
-		this.parentOrganisations = parentOrganisations;
+		this.manageableOrganisations = manageableOrganisations;
 		
 		isAdministrativeUser = securityModule.isUserAllowedAdminProps(ureq.getUserSession().getRoles());
 		
@@ -153,7 +154,7 @@ public class UsermanagerUserSearchController extends BasicController implements
 		userListVC.contextPut("emptyList", Boolean.FALSE);
 		userListVC.contextPut("showTitle", Boolean.TRUE);
 
-		searchFormCtrl = new UsermanagerUserSearchForm(ureq, wControl, isAdministrativeUser);
+		searchFormCtrl = new UsermanagerUserSearchForm(ureq, wControl, isAdministrativeUser, manageableOrganisations);
 		listenTo(searchFormCtrl);
 		
 		userSearchVC.put("usersearch", searchFormCtrl.getInitialComponent());
@@ -358,7 +359,9 @@ public class UsermanagerUserSearchController extends BasicController implements
 	
 	private void doPushSearch(UserRequest ureq) {
 		identityQueryParams = searchFormCtrl.getSearchIdentityParams();
-		identityQueryParams.setOrganisationParents(parentOrganisations);
+		if(identityQueryParams.getOrganisations() == null || identityQueryParams.getOrganisations().isEmpty()) {
+			identityQueryParams.setOrganisations(manageableOrganisations);
+		}
 		
 		OLATResourceable ores = OresHelper.createOLATResourceableInstance("table", 0l);
 		ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
diff --git a/src/main/java/org/olat/admin/user/UsermanagerUserSearchForm.java b/src/main/java/org/olat/admin/user/UsermanagerUserSearchForm.java
index 5d286a012ab00f92ec695d46c7c34afec8fd4e46..eb7ff864dab214c8a09fccb12ff18fdf9b3fe884 100644
--- a/src/main/java/org/olat/admin/user/UsermanagerUserSearchForm.java
+++ b/src/main/java/org/olat/admin/user/UsermanagerUserSearchForm.java
@@ -52,6 +52,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.context.StateMapped;
 import org.olat.core.util.StringHelper;
 import org.olat.login.LoginModule;
@@ -72,10 +73,11 @@ import org.springframework.beans.factory.annotation.Autowired;
  * used by the UserManagerSearchController
  */
 public class UsermanagerUserSearchForm extends FormBasicController {
+	
 	private static final String formIdentifyer = UsermanagerUserSearchForm.class.getCanonicalName();
 	
-	private TextElement login;
 	private MultipleSelectionElement roles;
+	private MultipleSelectionElement organisations;
 	private SingleSelection status;
 	private SelectionElement auth;
 	private DateChooser beforeDate;
@@ -84,37 +86,40 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 	private DateChooser userLoginAfter;
 	private FormLink searchButton;
 
-	private List<UserPropertyHandler> userPropertyHandlers;
 	
 	private String[] statusKeys;
 	private String[] statusValues;
 	private String[] roleKeys;
 	private String[] roleValues;
+	private String[] organisationKeys;
+	private String[] organisationValues;
 	private String[] authKeys;
 	private String[] authValues;
-	
-	private Map <String,FormItem>items;
+
 	private final boolean isAdministrativeUser;
+	private List<UserPropertyHandler> userPropertyHandlers;
+	private final Map <String,FormItem> items = new HashMap<>();
+	private final List<Organisation> manageableOrganisations;
 	
 	@Autowired
 	private LoginModule loginModule;
 	@Autowired
+	private UserManager userManager;
+	@Autowired
 	private OAuthLoginModule oauthLoginModule;
 	
 	/**
 	 * @param binderName
 	 * @param cancelbutton
 	 */
-	public UsermanagerUserSearchForm(UserRequest ureq, WindowControl wControl, boolean isAdministrativeUser) {
+	public UsermanagerUserSearchForm(UserRequest ureq, WindowControl wControl,
+			boolean isAdministrativeUser, List<Organisation> manageableOrganisations) {
 		super(ureq, wControl);
-		this.isAdministrativeUser = isAdministrativeUser;
-
-		UserManager um = UserManager.getInstance();
-		setTranslator(um.getPropertyHandlerTranslator(getTranslator()));
-		
-		userPropertyHandlers = um.getUserPropertyHandlersFor(formIdentifyer, true);
+		setTranslator(userManager.getPropertyHandlerTranslator(getTranslator()));
 		
-		items = new HashMap<>(); 
+		this.isAdministrativeUser = isAdministrativeUser;
+		userPropertyHandlers = userManager.getUserPropertyHandlersFor(formIdentifyer, true);
+		this.manageableOrganisations = new ArrayList<>(manageableOrganisations);
 		
 		roleKeys = new String[] {
 				OrganisationRoles.administrator.name(),
@@ -135,7 +140,7 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 				translate("search.form.constraint.poolmanager"),
 				translate("search.form.constraint.curriculummanager")
 		};
-		
+
 		statusKeys = new String[] { 
 				Integer.toString(Identity.STATUS_VISIBLE_LIMIT),
 				Integer.toString(Identity.STATUS_ACTIV),
@@ -151,6 +156,15 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 				translate("rightsForm.status.deleted")
 		};
 		
+		List<String> organisationKeyList = new ArrayList<>();
+		List<String> organisationValueList = new ArrayList<>();
+		for(Organisation organisation:manageableOrganisations) {
+			organisationKeyList.add(organisation.getKey().toString());
+			organisationValueList.add(organisation.getDisplayName());
+		}
+		organisationKeys = organisationKeyList.toArray(new String[organisationKeyList.size()]);
+		organisationValues = organisationValueList.toArray(new String[organisationValueList.size()]);
+		
 		// take all providers from the config file
 		// convention is that a translation key "search.form.constraint.auth." +
 		// providerName
@@ -218,11 +232,13 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 		if (userPropertiesSearch.isEmpty()) {
 			userPropertiesSearch = null;
 		}
-
+		
 		OrganisationRoles[] selectedRoles = getRoles().toArray(new OrganisationRoles[0]);
-		return new SearchIdentityParams(loginVal, userPropertiesSearch, true,
+		SearchIdentityParams params = new SearchIdentityParams(loginVal, userPropertiesSearch, true,
 				selectedRoles, getAuthProviders(), getAfterDate(), getBeforeDate(),
 				getUserLoginAfter(), getUserLoginBefore(), getStatus());
+		params.setOrganisations(getOrganisations());
+		return params;
 	}
 
 	public List<UserPropertyHandler> getPropertyHandlers() {
@@ -275,6 +291,17 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 		return selectedRoles;
 	}
 	
+	protected List<Organisation> getOrganisations() {
+		List<Organisation> selectedOrganisations = new ArrayList<>();
+		Collection<String> selectedKeys = organisations.getSelectedKeys();
+		for(Organisation organisation:manageableOrganisations) {
+			if(selectedKeys.contains(organisation.getKey().toString())) {
+				selectedOrganisations.add(organisation);
+			}
+		}
+		return selectedOrganisations;
+	}
+	
 	protected Integer getStatus () {
 		return new Integer(status.getSelectedKey());
 	}
@@ -341,7 +368,7 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 	protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
 		formLayout.setElementCssClass("o_sel_user_search_form");
 	
-		login = uifactory.addTextElement("login", "search.form.login", 128, "", formLayout);
+		TextElement login = uifactory.addTextElement("login", "search.form.login", 128, "", formLayout);
 		login.setVisible(isAdministrativeUser);
 		login.setElementCssClass("o_sel_user_search_username");
 		items.put("login", login);
@@ -374,6 +401,10 @@ public class UsermanagerUserSearchForm extends FormBasicController {
 		}
 
 		uifactory.addSpacerElement("space1", formLayout, false);
+		
+		organisations = uifactory.addCheckboxesVertical(
+				"organisations", "search.form.title.organisations", formLayout, organisationKeys, organisationValues, 1);
+		
 		roles = uifactory.addCheckboxesVertical(
 				"roles", "search.form.title.roles", formLayout, roleKeys, roleValues, 1);
 
diff --git a/src/main/java/org/olat/admin/user/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/admin/user/_i18n/LocalStrings_de.properties
index 00864425799563e720b4be16798732811c4a7c01..306aeb88869a6f324c4996a6ae8c71a127ce41e0 100644
--- a/src/main/java/org/olat/admin/user/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/admin/user/_i18n/LocalStrings_de.properties
@@ -62,6 +62,7 @@ new.form.auth.false=nicht jetzt anlegen
 new.form.auth.true=anlegen
 new.form.language=Sprache
 new.form.mandatory=Dieses Feld muss aufgef\u00FCllt werden.
+new.form.organisations=Organisation
 new.form.password.new1=Passwort
 new.form.password.new2=Passwort verifizieren
 new.form.please.enter=Angaben zur Person des neuen Benutzerkontos
@@ -72,19 +73,24 @@ new.user.successful=Das neue Benutzerkonto wurde angelegt.
 notification.noNews=Seit diesem Datum haben sich keine neue Benutzer angemeldet
 notification.noSubscription=Sie haben Benachrichtigung \u00FCber neue Benutzer nicht abonniert
 rightForm.error.anonymous.no.roles=Anonyme G\u00E4ste k\u00F6nnen keine Systemrollen wahrnehmen
+rightsForm.add.to.organisation=Zur Organisation hinzuf\u00FCgen
 rightsForm.isAdmin=Systemadministrator
 rightsForm.isAnonymous=Benutzertyp
 rightsForm.isAnonymous.false=Registrierter Benutzer
 rightsForm.isAnonymous.true=Anonymer Gast
 rightsForm.isAuthor=Autor
+rightsForm.isCoach=Betreuer
 rightsForm.isCurriculummanager=Curriculumverwalter
 rightsForm.isGroupmanager=Gruppenverwalter
 rightsForm.isInstitutionalResourceManager=Lernressourcenverwalter
 rightsForm.isInstitutionalResourceManager.institution=Lernressourcenverwalter ({0})
+rightsForm.isInvitee=Einladung
 rightsForm.isLoginDenied=Login gesperrt
 rightsForm.isPoolmanager=Poolverwalter
+rightsForm.isUser=Benutzer
 rightsForm.isUsermanager=Benutzerverwalter
 rightsForm.roles=Rollen
+rightsForm.roles.for=Rollen f\u00FCr "{0}"
 rightsForm.sendLoginDeniedEmail=Benutzer \u00FCber Loginsperre informieren
 rightsForm.status=Status
 rightsForm.status.activ=Aktiv
@@ -117,9 +123,11 @@ search.form.title.date=Einschr\u00E4nkung auf Erstellungsdatum
 search.form.title.roles=Einschr\u00E4nkung auf Systemrolle
 search.form.title.status=Einschr\u00E4nkung auf Account Status
 search.form.title.user=Einschr\u00E4nkung auf Benutzer
+search.form.title.organisations=Organisationen
 search.form.userLoginAfterDate=Nutzer hat sich zuletzt angemeldet nach
 search.form.userLoginBeforeDate=Nutzer hat sich zuletzt angemeldet vor
 selectall=$org.olat.core.gui.components.table\:checkall
+select.organisation=Organisation
 sendtoken.wrong.auth=Dieser Benutzer verf\u00FCgt \u00FCber Authentifizierungsmethoden, welche nicht \u00FCber diesen Passwortlink ge\u00E4ndert werden k\u00F6nnen. Bitte pr\u00FCfen und l\u00F6schen Sie diese Authentifizierungsmethoden zuerst.
 submit.cancel=Abbrechen
 submit.save=Speichern
diff --git a/src/main/java/org/olat/admin/user/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/admin/user/_i18n/LocalStrings_en.properties
index 4641446fa70fc082e1b7ce042c38133541adc3e8..bd7b9874ad06f3b292eef6332ac84851b48e91ac 100644
--- a/src/main/java/org/olat/admin/user/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/admin/user/_i18n/LocalStrings_en.properties
@@ -62,6 +62,7 @@ new.form.auth.false=Do not create now
 new.form.auth.true=Create now
 new.form.language=Language
 new.form.mandatory=This field is mandatory.
+new.form.organisations=Organisation
 new.form.password.new1=Password
 new.form.password.new2=Verify password
 new.form.please.enter=Please enter information on new user
@@ -72,19 +73,24 @@ new.user.successful=The new user account has been created successfully.
 notification.noNews=No new users have logged on since that date.
 notification.noSubscription=You have not subscribed to get news about new users.
 rightForm.error.anonymous.no.roles=Anonymous guests cannot exercise system roles
+rightsForm.add.to.organisation=Add to organisation
 rightsForm.isAdmin=System administrator
 rightsForm.isAnonymous=User type
 rightsForm.isAnonymous.false=System user
 rightsForm.isAnonymous.true=Anonymous guest
 rightsForm.isAuthor=Author
+rightsForm.isCoach=Coach
 rightsForm.isCurriculummanager=Curriculum manager
 rightsForm.isGroupmanager=Group management
 rightsForm.isInstitutionalResourceManager=Learning resource manager
 rightsForm.isInstitutionalResourceManager.institution=Learning resource manager ({0})
+rightsForm.isInvitee=Invitee
 rightsForm.isLoginDenied=Login locked
 rightsForm.isPoolmanager=Question bank manager
+rightsForm.isUser=User
 rightsForm.isUsermanager=User management
 rightsForm.roles=Roles
+rightsForm.roles.for=Roles for "{0}"
 rightsForm.sendLoginDeniedEmail=Notify user about login denied change
 rightsForm.status=Status
 rightsForm.status.activ=Active
@@ -117,9 +123,11 @@ search.form.title.date=Creation date restrictions
 search.form.title.roles=System role restrictions
 search.form.title.status=Restriction to account status
 search.form.title.user=User restrictions
+search.form.title.organisations=Organisation
 search.form.userLoginAfterDate=Last user login after
 search.form.userLoginBeforeDate=Last user login before
 selectall=$org.olat.core.gui.components.table\:checkall
+select.organisation=Organisation
 sendtoken.wrong.auth=This user has authentication tokens which can not be changed using this password link. Please review and delete this additional authentication tokens first.
 submit.cancel=Cancel
 submit.save=Save
diff --git a/src/main/java/org/olat/admin/user/bulkChange/UserBulkChangeStep01.java b/src/main/java/org/olat/admin/user/bulkChange/UserBulkChangeStep01.java
index 21735c4c7a9d913ad184ad279a9d7a32d1bac75f..3966fbd8911f7af7e117479752fd229867765197 100644
--- a/src/main/java/org/olat/admin/user/bulkChange/UserBulkChangeStep01.java
+++ b/src/main/java/org/olat/admin/user/bulkChange/UserBulkChangeStep01.java
@@ -246,7 +246,7 @@ class UserBulkChangeStep01 extends BasicStep {
 			}
 			
 			// learn resource manager
-			if (roles.isOLATAdmin() || roles.isInstitutionalResourceManager()) {
+			if (roles.isOLATAdmin() || roles.isLearnResourceManager()) {
 				chkInstitutionManager = uifactory.addCheckboxesHorizontal("InsitutionManager", "table.role.institutionManager", innerFormLayout, onKeys, onValues);
 				chkInstitutionManager.select("Author", false);
 				chkInstitutionManager.addActionListener(FormEvent.ONCLICK);
diff --git a/src/main/java/org/olat/admin/user/imp/UserImportController.java b/src/main/java/org/olat/admin/user/imp/UserImportController.java
index 4b864276227a9019f0cd5fdbc15aae56e470d5a5..f6428c70b91604d30e54988a7b3cb034d3edf014 100644
--- a/src/main/java/org/olat/admin/user/imp/UserImportController.java
+++ b/src/main/java/org/olat/admin/user/imp/UserImportController.java
@@ -194,7 +194,7 @@ public class UserImportController extends BasicController {
 			report.incrementCreatedUser();
 			report.incrementUpdatedShibboletAuthentication();
 		} else {
-			ident = securityManager.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(login, null, pwd, newUser);
+			ident = securityManager.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(login, null, pwd, newUser, null);
 			report.incrementCreatedUser();
 		}
 		return ident;
diff --git a/src/main/java/org/olat/basesecurity/BaseSecurity.java b/src/main/java/org/olat/basesecurity/BaseSecurity.java
index d53196efe52bfca55032ef59ef4a3ca827a59786..060090f2238a3ca071965cfdb48058a656cee89e 100644
--- a/src/main/java/org/olat/basesecurity/BaseSecurity.java
+++ b/src/main/java/org/olat/basesecurity/BaseSecurity.java
@@ -33,7 +33,9 @@ import java.util.Map;
 
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
+import org.olat.core.id.RolesByOrganisation;
 import org.olat.core.id.User;
 import org.olat.core.util.Encoder;
 
@@ -60,6 +62,8 @@ public interface BaseSecurity {
 	 */
 	public List<String> getRolesAsString(IdentityRef identity);
 	
+	public List<String> getRolesAsString(IdentityRef identity, OrganisationRef organisation);
+	
 	/**
 	 * Update the roles
 	 * @param actingIdentity The identity who is performing the change
@@ -67,6 +71,8 @@ public interface BaseSecurity {
 	 * @param roles The new roles to set on updatedIdentity
 	 */
 	public void updateRoles(Identity actingIdentity, Identity updatedIdentity, Organisation organisation, Roles roles);
+	
+	public void updateRoles(Identity actingIdentity, Identity updatedIdentity, RolesByOrganisation organisation);
 
 	public boolean isGuest(IdentityRef identity);
 	
@@ -245,10 +251,11 @@ public interface BaseSecurity {
 	 * @param externalId
 	 * @param pwd null: no OLAT authentication is generated. If not null, the password will be 
 	 *   encrypted and and an OLAT authentication is generated.
-	 * @param newUser unpersisted users
+	 * @param newUser The unpersisted users
+	 * @param organisation The organization where it is user (if null the default organization will be choosed)
 	 * @return Identity
 	 */
-	public Identity createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(String loginName, String externalId, String pwd, User newUser);
+	public Identity createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(String loginName, String externalId, String pwd, User newUser, Organisation organisation);
 	
 	/**
 	 * Persists the given user, creates an identity for it and adds the user to
diff --git a/src/main/java/org/olat/basesecurity/BaseSecurityManager.java b/src/main/java/org/olat/basesecurity/BaseSecurityManager.java
index f4cb9dc6ddf3d2c7ee54b45cc126c43a7062e276..486a9541917ac7b661e9dd696bae3e3bc9a3f281 100644
--- a/src/main/java/org/olat/basesecurity/BaseSecurityManager.java
+++ b/src/main/java/org/olat/basesecurity/BaseSecurityManager.java
@@ -31,6 +31,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -43,6 +44,7 @@ import javax.persistence.TypedQuery;
 
 import org.olat.basesecurity.events.NewIdentityCreatedEvent;
 import org.olat.basesecurity.manager.AuthenticationHistoryDAO;
+import org.olat.basesecurity.model.OrganisationRefImpl;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
 import org.olat.core.commons.services.webdav.manager.WebDAVAuthManager;
@@ -50,7 +52,9 @@ import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
+import org.olat.core.id.RolesByOrganisation;
 import org.olat.core.id.User;
 import org.olat.core.id.UserConstants;
 import org.olat.core.logging.AssertException;
@@ -137,27 +141,82 @@ public class BaseSecurityManager implements BaseSecurity {
 	public Roles getRoles(IdentityRef identity) {
 		boolean isGuestOnly = false;
 		boolean isInvitee = false;
+		
+		StringBuilder sb = new StringBuilder();
+		sb.append("select org.key, membership.role from organisation as org ")
+		  .append(" inner join org.group baseGroup")
+		  .append(" inner join baseGroup.members membership")
+		  .append(" where membership.identity.key=:identityKey");
+		
+		List<Object[]> rawObjects = dbInstance.getCurrentEntityManager()
+				.createQuery(sb.toString(), Object[].class)
+				.setParameter("identityKey", identity.getKey())
+				.getResultList();
+		Map<OrganisationRef, List<OrganisationRoles>> orgToRoles = new HashMap<>();
+		
+		boolean sysAdmin = false;
+		boolean admin = false;
+		
+		boolean groupManager = false;
+		boolean userManager = false;
+		boolean resourceManager = false;
+		boolean poolManager = false;
+		boolean curriculumnManager = false;
+		
+		boolean author = false;
+		boolean coach = false;
+		
+		for(Object[] rawObject:rawObjects) {
+			Long organisationKey = (Long)rawObject[0];
+			String role = (String)rawObject[1];
+
+			List<OrganisationRoles> roleList = orgToRoles
+					.computeIfAbsent(new OrganisationRefImpl(organisationKey), key -> new ArrayList<>());
+			roleList.add(OrganisationRoles.valueOf(role));
+			
+			sysAdmin |= role.equals(OrganisationRoles.sysadmin.name());
+			admin |= role.equals(OrganisationRoles.administrator.name());
+			
+			groupManager |= role.equals(OrganisationRoles.groupmanager.name());
+			userManager |= role.equals(OrganisationRoles.usermanager.name());
+			resourceManager |= role.equals(OrganisationRoles.learnresourcemanager.name());
+			poolManager |= role.equals(OrganisationRoles.poolmanager.name());
+			curriculumnManager |= role.equals(OrganisationRoles.curriculummanager.name());
+			
+
+			author |= role.equals(OrganisationRoles.author.name());
+			coach |= role.equals(OrganisationRoles.coach.name());
+		}
+		
+		admin |= sysAdmin;
+		
+		groupManager |= admin;
+		userManager |= admin;
+		poolManager |= admin;
+		curriculumnManager |= admin;
+		
+		author |= admin;
+		coach |= admin;
 
 		List<String> rolesStr = getRolesAsString(identity);
-		boolean sysAdmin = rolesStr.contains(OrganisationRoles.sysadmin.name());
-		boolean admin = sysAdmin || rolesStr.contains(OrganisationRoles.administrator.name());
-		boolean author = admin || rolesStr.contains(OrganisationRoles.author.name());
-		boolean groupManager = admin || rolesStr.contains(OrganisationRoles.groupmanager.name());
-		boolean userManager = admin || rolesStr.contains(OrganisationRoles.usermanager.name());
-		boolean resourceManager = rolesStr.contains(OrganisationRoles.learnresourcemanager.name());
-		boolean poolManager = admin || rolesStr.contains(OrganisationRoles.poolmanager.name());
-		boolean curriculumnManager = admin || rolesStr.contains(OrganisationRoles.curriculummanager.name());
+		
 		
 		if(!rolesStr.contains(OrganisationRoles.user.name())) {
 			isInvitee = invitationDao.isInvitee(identity);
 			isGuestOnly = rolesStr.contains(OrganisationRoles.guest.name());
 		}
-		return new Roles(sysAdmin, admin, userManager, groupManager, author, isGuestOnly, resourceManager, poolManager, curriculumnManager, isInvitee);
+		Roles roles = new Roles(sysAdmin, admin, userManager, groupManager, author, isGuestOnly, resourceManager, poolManager, curriculumnManager, coach, isInvitee);
+		List<RolesByOrganisation> rolesByOrganisations = new ArrayList<>();
+		for(Map.Entry<OrganisationRef, List<OrganisationRoles>> entry:orgToRoles.entrySet()) {
+			rolesByOrganisations.add(new RolesByOrganisation(entry.getKey(), entry.getValue()));
+		}
+		roles.setRolesByOrganisation(rolesByOrganisations);
+		return roles;
 	}
 
 	@Override
 	public List<String> getRolesAsString(IdentityRef identity) {
-		StringBuilder sb = new StringBuilder();
+		StringBuilder sb = new StringBuilder(255);
 		sb.append("select membership.role from organisation as org ")
 		  .append(" inner join org.group baseGroup")
 		  .append(" inner join baseGroup.members membership")
@@ -169,6 +228,21 @@ public class BaseSecurityManager implements BaseSecurity {
 				.getResultList();
 	}
 
+	@Override
+	public List<String> getRolesAsString(IdentityRef identity, OrganisationRef organisation) {
+		StringBuilder sb = new StringBuilder(255);
+		sb.append("select membership.role from organisation as org ")
+		  .append(" inner join org.group baseGroup")
+		  .append(" inner join baseGroup.members membership")
+		  .append(" where membership.identity.key=:identityKey and org.key=:organisationKey");
+		
+		return dbInstance.getCurrentEntityManager()
+				.createQuery(sb.toString(), String.class)
+				.setParameter("identityKey", identity.getKey())
+				.setParameter("organisationKey", organisation.getKey())
+				.getResultList();
+	}
+
 	@Override
 	public void updateRoles(Identity actingIdentity, Identity updatedIdentity, Organisation organisation, Roles roles) {
 		List<String> currentRoles = getRolesAsString(updatedIdentity);
@@ -186,7 +260,7 @@ public class BaseSecurityManager implements BaseSecurity {
 
 		// author
 		boolean hasBeenAuthor = currentRoles.contains(OrganisationRoles.author.name());
-		boolean isAuthor = (roles.isAuthor() || roles.isInstitutionalResourceManager()) && !roles.isGuestOnly() && !roles.isInvitee();
+		boolean isAuthor = (roles.isAuthor() || roles.isLearnResourceManager()) && !roles.isGuestOnly() && !roles.isInvitee();
 		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.author, hasBeenAuthor, isAuthor);
 
 		// user manager, only allowed by admin
@@ -196,7 +270,7 @@ public class BaseSecurityManager implements BaseSecurity {
 
  		// institutional resource manager
 		boolean hasBeenInstitutionalResourceManager = currentRoles.contains(OrganisationRoles.learnresourcemanager.name());
-		boolean institutionalResourceManager = roles.isInstitutionalResourceManager() && !roles.isGuestOnly() && !roles.isInvitee();
+		boolean institutionalResourceManager = roles.isLearnResourceManager() && !roles.isGuestOnly() && !roles.isInvitee();
 		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.learnresourcemanager, hasBeenInstitutionalResourceManager, institutionalResourceManager);
 
 		// institutional resource manager
@@ -215,6 +289,61 @@ public class BaseSecurityManager implements BaseSecurity {
 		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.administrator, hasBeenAdmin, isOLATAdmin);		
 	}
 	
+	@Override
+	public void updateRoles(Identity actingIdentity, Identity updatedIdentity, RolesByOrganisation roles) {
+		Organisation organisation = organisationService.getOrganisation(roles.getOrganisation());
+		
+		List<String> currentRoles = getRolesAsString(updatedIdentity, organisation);
+		
+		boolean hasBeenAnonymous = currentRoles.contains(OrganisationRoles.guest.name());
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.guest, hasBeenAnonymous, roles.isGuestOnly());
+		
+		// system users - opposite of anonymous users
+		boolean hasBeenUser = currentRoles.contains(OrganisationRoles.user.name());
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity,  OrganisationRoles.user, hasBeenUser, !roles.isGuestOnly());
+
+		// coach
+		boolean hasBeenAuthor = currentRoles.contains(OrganisationRoles.author.name());
+		boolean isAuthor = (roles.isAuthor() || roles.isLearnResourceManager()) && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.author, hasBeenAuthor, isAuthor);
+
+		// author
+		boolean hasBeenCoach = currentRoles.contains(OrganisationRoles.coach.name());
+		boolean isCoach = roles.isCoach() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.coach, hasBeenCoach, isCoach);
+
+		// group manager
+		boolean hasBeenGroupManager = currentRoles.contains(OrganisationRoles.groupmanager.name());
+		boolean groupManager = roles.isGroupManager() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.groupmanager, hasBeenGroupManager, groupManager);
+		
+		// user manager, only allowed by admin
+		boolean hasBeenUserManager = currentRoles.contains(OrganisationRoles.usermanager.name());
+		boolean userManager = roles.isUserManager() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity,  OrganisationRoles.usermanager, hasBeenUserManager, userManager);
+
+ 		// institutional resource manager
+		boolean hasBeenInstitutionalResourceManager = currentRoles.contains(OrganisationRoles.learnresourcemanager.name());
+		boolean institutionalResourceManager = roles.isLearnResourceManager() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.learnresourcemanager, hasBeenInstitutionalResourceManager, institutionalResourceManager);
+
+		// institutional resource manager
+		boolean hasBeenPoolManager = currentRoles.contains(OrganisationRoles.poolmanager.name());
+		boolean poolManager = roles.isPoolManager() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.poolmanager, hasBeenPoolManager, poolManager);
+		
+		// institutional resource manager
+		boolean hasBeenCurriculumManager = currentRoles.contains(OrganisationRoles.curriculummanager.name());
+		boolean curriculumManager = roles.isCurriculumManager() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.curriculummanager, hasBeenCurriculumManager, curriculumManager);
+
+		// system administrator
+		boolean hasBeenAdmin = currentRoles.contains(OrganisationRoles.administrator.name());
+		boolean isOLATAdmin = roles.isAdministrator() && !roles.isGuestOnly() && !roles.isInvitee();
+		updateRolesInSecurityGroup(organisation, actingIdentity, updatedIdentity, OrganisationRoles.administrator, hasBeenAdmin, isOLATAdmin);		
+	}
+	
+	
 	private void updateRolesInSecurityGroup(Organisation organisation, Identity actingIdentity, Identity updatedIdentity, OrganisationRoles role, boolean hasBeen, boolean isNow) {
 		if (!hasBeen && isNow) {
 			// user not yet in security group, add him
@@ -299,8 +428,9 @@ public class BaseSecurityManager implements BaseSecurity {
 	 * @return Identity
 	 */
 	@Override
-	public Identity createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(String loginName, String externalId, String pwd,  User newUser) {
-		Identity ident = null;
+	public Identity createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(String loginName, String externalId, String pwd,
+			User newUser, Organisation organisation) {
+		Identity ident;
 		if (pwd == null) {
 			// when no password is used the provider must be set to null to not generate
 			// an OLAT authentication token. See method doku.
@@ -312,7 +442,11 @@ public class BaseSecurityManager implements BaseSecurity {
 		}
 
 		// Add user to the default organization as user
-		organisationService.addMember(ident, OrganisationRoles.user);
+		if(organisation == null) {
+			organisationService.addMember(ident, OrganisationRoles.user);
+		} else {
+			organisationService.addMember(organisation, ident, OrganisationRoles.user);
+		}
 		return ident;
 	}
 	
diff --git a/src/main/java/org/olat/basesecurity/OrganisationRoles.java b/src/main/java/org/olat/basesecurity/OrganisationRoles.java
index 7e408ab5bc6b881f55f875289a252750b4555dce..5a0ea7c39835e39bd878a06a511b11eaacf1c60e 100644
--- a/src/main/java/org/olat/basesecurity/OrganisationRoles.java
+++ b/src/main/java/org/olat/basesecurity/OrganisationRoles.java
@@ -37,7 +37,9 @@ public enum OrganisationRoles {
 	poolmanager,
 	curriculummanager,
 	author,
+	coach,
 	user,
+	invitee,
 	guest;
 	
 	public static boolean valid(String value) {
@@ -51,7 +53,7 @@ public enum OrganisationRoles {
 		}
 	}
 	
-	public static OrganisationRoles[] valuesWithoutGuest() {
+	public static OrganisationRoles[] valuesWithoutGuestAndInvitee() {
 		return new OrganisationRoles[]{
 				sysadmin,
 				administrator,
diff --git a/src/main/java/org/olat/basesecurity/OrganisationService.java b/src/main/java/org/olat/basesecurity/OrganisationService.java
index ea78b7201b4ac6b96e861630419fa052a18e27bf..bf70729e79f13d470a58a796016d4b4bfba6176d 100644
--- a/src/main/java/org/olat/basesecurity/OrganisationService.java
+++ b/src/main/java/org/olat/basesecurity/OrganisationService.java
@@ -24,6 +24,7 @@ import java.util.List;
 import org.olat.basesecurity.model.OrganisationMember;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 
 /**
@@ -70,7 +71,22 @@ public interface OrganisationService {
 	 * @param roles
 	 * @return
 	 */
-	public List<Organisation> getSearchableOrganisations(IdentityRef member, Roles roles);
+	public List<Organisation> getSearchableOrganisations(IdentityRef member, Roles roles, OrganisationRoles additionalManagerRole);
+	
+	/**
+	 * Return the organization the specified user
+	 * is allow to manage. The method calculate with
+	 * administrator and the specified additional role
+	 * (user manager or learn resource manager)
+	 * 
+	 * 
+	 * @param member The user 
+	 * @param roles The roles of the specified user
+	 * @param managerRole The additional manager
+	 * @return A list of organizations a user can manage
+	 */
+	public List<Organisation> getManageableOrganisations(IdentityRef member, Roles roles, OrganisationRoles managerRole);
+
 	
 	public Organisation getDefaultOrganisation();
 
@@ -90,6 +106,8 @@ public interface OrganisationService {
 	
 	public void removeMember(Organisation organisation, IdentityRef member, OrganisationRoles role);
 	
+	public void setAsGuest(Identity identity);
+	
 	public List<OrganisationMember> getMembers(Organisation organisation);
 
 	
diff --git a/src/main/java/org/olat/basesecurity/SearchIdentityParams.java b/src/main/java/org/olat/basesecurity/SearchIdentityParams.java
index ca68d674955a96ed881cc6c261ea4d6d150dc8e1..c4d1aa7cc36b0d0c7160a47bec2f86ddd1beb8d3 100644
--- a/src/main/java/org/olat/basesecurity/SearchIdentityParams.java
+++ b/src/main/java/org/olat/basesecurity/SearchIdentityParams.java
@@ -28,6 +28,7 @@ import java.util.Map;
 
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 
 /**
  * 
diff --git a/src/main/java/org/olat/basesecurity/manager/IdentityPowerSearchQueriesImpl.java b/src/main/java/org/olat/basesecurity/manager/IdentityPowerSearchQueriesImpl.java
index 3f4f24344b43c6bd90df028b203b40aa5a502e17..a564d05a36c5a75956f58340b7058d0162f55d86 100644
--- a/src/main/java/org/olat/basesecurity/manager/IdentityPowerSearchQueriesImpl.java
+++ b/src/main/java/org/olat/basesecurity/manager/IdentityPowerSearchQueriesImpl.java
@@ -33,13 +33,13 @@ import javax.persistence.TypedQuery;
 import org.olat.basesecurity.AuthenticationImpl;
 import org.olat.basesecurity.IdentityImpl;
 import org.olat.basesecurity.IdentityPowerSearchQueries;
-import org.olat.basesecurity.OrganisationRef;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.SearchIdentityParams;
 import org.olat.basesecurity.model.IdentityPropertiesRow;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.SortKey;
 import org.olat.core.id.Identity;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.util.CodeHelper;
 import org.olat.user.propertyhandlers.UserPropertyHandler;
 import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/org/olat/basesecurity/manager/OrganisationDAO.java b/src/main/java/org/olat/basesecurity/manager/OrganisationDAO.java
index 6f7f39b2b183759091b03e38c541b2ad697f2132..2e8a15990ada2f088e27bd9935c0175dfb5e5f5c 100644
--- a/src/main/java/org/olat/basesecurity/manager/OrganisationDAO.java
+++ b/src/main/java/org/olat/basesecurity/manager/OrganisationDAO.java
@@ -20,13 +20,15 @@
 package org.olat.basesecurity.manager;
 
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import javax.persistence.TypedQuery;
 
 import org.olat.basesecurity.IdentityRef;
-import org.olat.basesecurity.OrganisationRef;
 import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.OrganisationType;
 import org.olat.basesecurity.model.OrganisationImpl;
@@ -34,6 +36,7 @@ import org.olat.basesecurity.model.OrganisationMember;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.util.StringHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -214,7 +217,7 @@ public class OrganisationDAO {
 	
 	public List<Organisation> getOrganisations(IdentityRef identity, List<String> roleList) {
 		StringBuilder sb = new StringBuilder(256);
-		sb.append("select org from organisation org")
+		sb.append("select distinct org from organisation org")
 		  .append(" inner join fetch org.group baseGroup")
 		  .append(" inner join baseGroup.members membership")
 		  .append(" where membership.identity.key=:identityKey and membership.role in (:roles)");
@@ -225,6 +228,55 @@ public class OrganisationDAO {
 				.getResultList();
 	}
 	
+	public List<Organisation> getOrganisations(Collection<OrganisationRef> rootOrganisations) {
+		if(rootOrganisations == null || rootOrganisations.isEmpty()) return Collections.emptyList();
+		
+		StringBuilder sb = new StringBuilder(128);
+		sb.append("select org from organisation org")
+		  .append(" where org.key in (:organisationKeys)");
+
+		List<Long> organisationKeys = rootOrganisations.stream()
+				.map(OrganisationRef::getKey).collect(Collectors.toList());
+		return dbInstance.getCurrentEntityManager()
+				.createQuery(sb.toString(), Organisation.class)
+				.setParameter("organisationKeys", organisationKeys)
+				.getResultList();
+	}
+	
+	public List<Organisation> getDescendants(Organisation organisation) {
+		StringBuilder sb = new StringBuilder(128);
+		sb.append("select org from organisation org")
+		  .append(" where org.materializedPathKeys like :materializedPathKeys");
+		return dbInstance.getCurrentEntityManager()
+				.createQuery(sb.toString(), Organisation.class)
+				.setParameter("materializedPathKeys", organisation.getMaterializedPathKeys() + "%")
+				.getResultList();
+	}
+	
+
+	public boolean hasAnyRole(IdentityRef identity, String excludeRole) {
+		StringBuilder sb = new StringBuilder(256);
+		sb.append("select membership.key from organisation org")
+		  .append(" inner join org.group baseGroup")
+		  .append(" inner join baseGroup.members membership")
+		  .append(" where membership.identity.key=:identityKey");
+		
+		if(StringHelper.containsNonWhitespace(excludeRole)) {
+			sb.append(" and not(membership.role=:excludeRole)");
+		}
+		TypedQuery<Long> query = dbInstance.getCurrentEntityManager()
+				.createQuery(sb.toString(), Long.class)
+				.setParameter("identityKey", identity.getKey());
+		if(StringHelper.containsNonWhitespace(excludeRole)) {
+			query.setParameter("excludeRole", excludeRole);
+		}
+
+		List<Long> memberships = query.setFirstResult(0)
+			.setMaxResults(1)
+			.getResultList();
+		return memberships != null && !memberships.isEmpty() && memberships.get(0) != null && memberships.get(0).longValue() > 0;	
+	}
+	
 	public boolean hasRole(IdentityRef identity, String organisationIdentifier, String... role) {
 		StringBuilder sb = new StringBuilder(256);
 		sb.append("select membership.key from organisation org")
diff --git a/src/main/java/org/olat/basesecurity/manager/OrganisationServiceImpl.java b/src/main/java/org/olat/basesecurity/manager/OrganisationServiceImpl.java
index 91175f325aaba879b3563060e2fd4b1fd84ecd73..df8315ee27c45b259ceaf4e1d144fee3a3b5cd5b 100644
--- a/src/main/java/org/olat/basesecurity/manager/OrganisationServiceImpl.java
+++ b/src/main/java/org/olat/basesecurity/manager/OrganisationServiceImpl.java
@@ -20,11 +20,12 @@
 package org.olat.basesecurity.manager;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.olat.basesecurity.IdentityRef;
 import org.olat.basesecurity.OrganisationManagedFlag;
-import org.olat.basesecurity.OrganisationRef;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.OrganisationType;
@@ -33,6 +34,7 @@ import org.olat.basesecurity.model.OrganisationMember;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -116,7 +118,7 @@ public class OrganisationServiceImpl implements OrganisationService, Initializin
 	}
 
 	@Override
-	public List<Organisation> getSearchableOrganisations(IdentityRef member, Roles roles) {
+	public List<Organisation> getSearchableOrganisations(IdentityRef member, Roles roles, OrganisationRoles additionalManagerRole) {
 		List<String> roleList = new ArrayList<>();// if user manager, descent organization tree
 		for(OrganisationRoles r:OrganisationRoles.values()) {
 			if(r !=  OrganisationRoles.guest) {
@@ -125,14 +127,53 @@ public class OrganisationServiceImpl implements OrganisationService, Initializin
 		}
 		List<Organisation> organisations = organisationDao.getOrganisations(member, roleList);
 		
-		return organisations;
+		Set<Organisation> organisationWithDescendants = new HashSet<>();
+		for(Organisation organisation:organisations) {
+			organisationWithDescendants.add(organisation);
+			if(roles.hasRole(organisation, additionalManagerRole)
+					|| roles.hasRole(organisation, OrganisationRoles.administrator)) {
+				List<Organisation> descendants = organisationDao.getDescendants(organisation);
+				organisationWithDescendants.addAll(descendants);
+			}
+		}
+
+		return new ArrayList<>(organisationWithDescendants);
+	}
+
+	@Override
+	public List<Organisation> getManageableOrganisations(IdentityRef member, Roles roles, OrganisationRoles additionalManagerRole) {
+		Set<OrganisationRef> manageableRootOrganisations = new HashSet<>();
+		manageableRootOrganisations.addAll(roles.getOrganisationsWithRoles(OrganisationRoles.administrator));
+		manageableRootOrganisations.addAll(roles.getOrganisationsWithRoles(additionalManagerRole));
+
+		List<Organisation> organisations = organisationDao.getOrganisations(manageableRootOrganisations);
+		Set<Organisation> organisationWithDescendants = new HashSet<>();
+		for(Organisation organisation:organisations) {
+			organisationWithDescendants.add(organisation);
+			if(roles.hasRole(organisation, additionalManagerRole)
+					|| roles.hasRole(organisation, OrganisationRoles.administrator)) {
+				List<Organisation> descendants = organisationDao.getDescendants(organisation);
+				organisationWithDescendants.addAll(descendants);
+			}
+		}
+		
+		return new ArrayList<>(organisationWithDescendants);
 	}
 
 	@Override
 	public List<OrganisationMember> getMembers(Organisation organisation) {
 		return organisationDao.getMembers(organisation);
 	}
-	
+
+	@Override
+	public void setAsGuest(Identity identity) {
+		OrganisationImpl defOrganisation = (OrganisationImpl)getDefaultOrganisation();
+		if(!groupDao.hasRole(defOrganisation.getGroup(), identity, OrganisationRoles.guest.name())) {
+			groupDao.removeMemberships(identity);
+			addMember(defOrganisation, identity, OrganisationRoles.guest);
+		}
+	}
+
 	@Override
 	public void addMember(Identity member, OrganisationRoles role) {
 		Organisation defOrganisation = getDefaultOrganisation();
diff --git a/src/main/java/org/olat/basesecurity/model/OrganisationImpl.java b/src/main/java/org/olat/basesecurity/model/OrganisationImpl.java
index 22a8bac3a62146b500f4f9fcb3e27c986c337607..409a2a6c5892cac031ae3f4dada0e123e48e3e5e 100644
--- a/src/main/java/org/olat/basesecurity/model/OrganisationImpl.java
+++ b/src/main/java/org/olat/basesecurity/model/OrganisationImpl.java
@@ -19,7 +19,9 @@
  */
 package org.olat.basesecurity.model;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -32,12 +34,16 @@ import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import javax.persistence.Transient;
 
 import org.olat.basesecurity.Group;
 import org.olat.basesecurity.OrganisationManagedFlag;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.OrganisationType;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Persistable;
+import org.olat.core.util.StringHelper;
 
 /**
  * 
@@ -127,6 +133,11 @@ public class OrganisationImpl implements Persistable, Organisation {
 		lastModified = date;
 	}
 
+	@Override
+	public boolean isDefault() {
+		return OrganisationService.DEFAULT_ORGANISATION_IDENTIFIER.equals(identifier);
+	}
+
 	@Override
 	public String getIdentifier() {
 		return identifier;
@@ -217,6 +228,7 @@ public class OrganisationImpl implements Persistable, Organisation {
 		this.group = group;
 	}
 
+	@Override
 	public Organisation getRoot() {
 		return root;
 	}
@@ -225,6 +237,7 @@ public class OrganisationImpl implements Persistable, Organisation {
 		this.root = root;
 	}
 
+	@Override
 	public Organisation getParent() {
 		return parent;
 	}
@@ -233,6 +246,24 @@ public class OrganisationImpl implements Persistable, Organisation {
 		this.parent = parent;
 	}
 
+	@Override
+	@Transient
+	public List<OrganisationRef> getParentLine() {
+		List<OrganisationRef> parentLine = new ArrayList<>();
+		if(StringHelper.containsNonWhitespace(materializedPathKeys)) {
+			String[] parentKeyStrings = materializedPathKeys.split("[/]");
+			for(String parentKeyString:parentKeyStrings) {
+				if(StringHelper.containsNonWhitespace(parentKeyString)) {
+					Long parentKey = Long.valueOf(parentKeyString);
+					if(!parentKey.equals(getKey())) {
+						parentLine.add(new OrganisationRefImpl(parentKey));
+					}
+				}
+			}
+		}
+		return parentLine;
+	}
+
 	public OrganisationType getType() {
 		return type;
 	}
@@ -262,4 +293,15 @@ public class OrganisationImpl implements Persistable, Organisation {
 	public boolean equalsByPersistableKey(Persistable persistable) {
 		return equals(persistable);
 	}
+	
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder(255);
+		sb.append("organisation[key=").append(getKey() == null ? "" : getKey().toString())
+		  .append(":displayName=").append(displayName == null ? "" : displayName)
+		  .append(":identifier=").append(identifier == null ? "" : identifier)
+		  .append("]")
+		  .append(super.toString());
+		return sb.toString();
+	}
 }
diff --git a/src/main/java/org/olat/basesecurity/model/OrganisationRefImpl.java b/src/main/java/org/olat/basesecurity/model/OrganisationRefImpl.java
index 3ae8dc3e71e6a812589996dd087dc3c302a5c3d8..b13f83513905a76726c44f21f5b648bd7cabc1b3 100644
--- a/src/main/java/org/olat/basesecurity/model/OrganisationRefImpl.java
+++ b/src/main/java/org/olat/basesecurity/model/OrganisationRefImpl.java
@@ -19,7 +19,7 @@
  */
 package org.olat.basesecurity.model;
 
-import org.olat.basesecurity.OrganisationRef;
+import org.olat.core.id.OrganisationRef;
 
 /**
  * 
@@ -56,4 +56,12 @@ public class OrganisationRefImpl implements OrganisationRef {
 		}
 		return false;
 	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder(255);
+		sb.append("organisationRef[key=").append(getKey() == null ? "" : getKey().toString()).append("]")
+		  .append(super.toString());
+		return sb.toString();
+	}
 }
diff --git a/src/main/java/org/olat/basesecurity/model/OrganisationTypeImpl.java b/src/main/java/org/olat/basesecurity/model/OrganisationTypeImpl.java
index 50b3a2ab0bedaa7d65394ddf5f26b3f9d11f51e1..ed696451f6d40d665fb2aa486bff4d5ffca00911 100644
--- a/src/main/java/org/olat/basesecurity/model/OrganisationTypeImpl.java
+++ b/src/main/java/org/olat/basesecurity/model/OrganisationTypeImpl.java
@@ -194,4 +194,15 @@ public class OrganisationTypeImpl implements Persistable, OrganisationType {
 	public boolean equalsByPersistableKey(Persistable persistable) {
 		return equals(persistable);
 	}
+	
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder(255);
+		sb.append("organisationType[key=").append(getKey() == null ? "" : getKey().toString())
+		  .append(":displayName=").append(displayName == null ? "" : displayName)
+		  .append(":identifier=").append(identifier == null ? "" : identifier)
+		  .append("]")
+		  .append(super.toString());
+		return sb.toString();
+	}
 }
diff --git a/src/main/java/org/olat/collaboration/CollaborationToolsSettingsController.java b/src/main/java/org/olat/collaboration/CollaborationToolsSettingsController.java
index ba9a03127f843742b3c95cccf544d88a552a3b7e..797ece9ca511d85e10a1701067b9bb1c2e053dd5 100644
--- a/src/main/java/org/olat/collaboration/CollaborationToolsSettingsController.java
+++ b/src/main/java/org/olat/collaboration/CollaborationToolsSettingsController.java
@@ -108,7 +108,7 @@ public class CollaborationToolsSettingsController extends BasicController {
 			if(managed) {
 				quotaCtr = quotaManager.getQuotaViewInstance(ureq, getWindowControl(), collabTools.getFolderRelPath());
 			} else {
-				quotaCtr = quotaManager.getQuotaEditorInstance(ureq, getWindowControl(), collabTools.getFolderRelPath());
+				quotaCtr = quotaManager.getQuotaEditorInstance(ureq, getWindowControl(), collabTools.getFolderRelPath(), null);//TODO roles
 			}
 			listenTo(quotaCtr);
 		} else {
diff --git a/src/main/java/org/olat/core/commons/controllers/resume/ResumeSessionController.java b/src/main/java/org/olat/core/commons/controllers/resume/ResumeSessionController.java
index c19ed4dba84809d9f9e191a4dbb1a4ff88c7f58a..f1a5f54761253353d09af238037c3f1220ed92d8 100644
--- a/src/main/java/org/olat/core/commons/controllers/resume/ResumeSessionController.java
+++ b/src/main/java/org/olat/core/commons/controllers/resume/ResumeSessionController.java
@@ -231,10 +231,10 @@ public class ResumeSessionController extends BasicController {
 	private Long getLastRunTimeForController(String ctrlName) {
 		for (Property prop : preferencesList) {
 			if (prop.getName().equals(ctrlName)) {
-				return new Long(prop.getLastModified().getTime() / 1000);
+				return Long.valueOf(prop.getLastModified().getTime() / 1000);
 			}
 		}
-		return new Long(0);
+		return Long.valueOf(0l);
 	}
 
 	private boolean getRunStateForController(String ctrlName) {
@@ -331,7 +331,7 @@ public class ResumeSessionController extends BasicController {
 				String url = toUrl(getLandingBC(ureq));
 				option = new Redirect(url);
 			} else if ("auto".equals(resumePrefs)) {
-				HistoryPoint historyEntry = HistoryManager.getInstance().readHistoryPoint(ureq.getIdentity());
+				HistoryPoint historyEntry = historyManager.readHistoryPoint(ureq.getIdentity());
 				if(historyEntry != null && StringHelper.containsNonWhitespace(historyEntry.getBusinessPath())) {
 					List<ContextEntry> cloneCes = BusinessControlFactory.getInstance().cloneContextEntries(historyEntry.getEntries());
 					String bc = BusinessControlFactory.getInstance().getAsRestPart(cloneCes, true);
diff --git a/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java b/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java
index 279e96e038846ff0a38a691a22dee1276978f0b5..3ef83bde529fe33496e3feaacb0c006b9087214c 100644
--- a/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java
+++ b/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java
@@ -504,7 +504,7 @@ public class FolderRunController extends BasicController implements Activateable
 		} 
 		
 		Boolean newEditQuota = Boolean.FALSE;
-		if (usess.getRoles().isOLATAdmin() || usess.getRoles().isInstitutionalResourceManager()) {
+		if (usess.getRoles().isOLATAdmin() || usess.getRoles().isLearnResourceManager()) {//TODO roles
 			// Only sys admins or institutonal resource managers can have the quota button
 			Quota q = VFSManager.isTopLevelQuotaContainer(folderComponent.getCurrentContainer());
 			newEditQuota = (q == null)? Boolean.FALSE : Boolean.TRUE;
diff --git a/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditQuota.java b/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditQuota.java
index 09d9d57241c8a6ea4a095a10ff9a2c5b3556d02c..b46bf21691323e1eef76926b2517de0a9e68bc9e 100644
--- a/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditQuota.java
+++ b/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditQuota.java
@@ -67,7 +67,7 @@ public class CmdEditQuota extends DefaultController implements FolderCommand, Co
 		// cleanup old controller first
 		if (quotaEditController != null) quotaEditController.dispose();
 		// create a edit controller
-		quotaEditController = quotaManager.getQuotaEditorInstance(ureq, wControl, currentSecCallback.getQuota().getPath());
+		quotaEditController = quotaManager.getQuotaEditorInstance(ureq, wControl, currentSecCallback.getQuota().getPath(), null);//TODO roles
 		quotaEditController.addControllerListener(this);
 		if (quotaEditController != null) {
 			setInitialComponent(quotaEditController.getInitialComponent());
diff --git a/src/main/java/org/olat/core/commons/services/csp/manager/CSPManagerImpl.java b/src/main/java/org/olat/core/commons/services/csp/manager/CSPManagerImpl.java
index 8110a539833fbf63fc740589465439dd693d37fa..592c710cab05039f948d70496d523bd93501d295 100644
--- a/src/main/java/org/olat/core/commons/services/csp/manager/CSPManagerImpl.java
+++ b/src/main/java/org/olat/core/commons/services/csp/manager/CSPManagerImpl.java
@@ -49,22 +49,22 @@ public class CSPManagerImpl implements CSPManager {
 	public CSPLog log(CSPReport report, Identity identity) {
 		CSPLogImpl log = new CSPLogImpl();
 		log.setCreationDate(new Date());
-		log.setBlockedUri(report.getBlockedUri());
+		log.setBlockedUri(cut(report.getBlockedUri(), 1024));
 		if(StringHelper.isLong(report.getColumnNumber())) {
 			log.setColumnNumber(Long.parseLong(report.getColumnNumber()));
 		}
 		log.setDisposition(report.getDisposition());
-		log.setDocumentUri(report.getDocumentUri());
+		log.setDocumentUri(cut(report.getDocumentUri(), 1024));
 		log.setEffectiveDirective(report.getEffectiveDirective());
 		if(StringHelper.isLong(report.getLineNumber())) {
 			log.setLineNumber(Long.parseLong(report.getLineNumber()));
 		}
 		log.setOriginalPolicy(report.getOriginalPolicy());
-		log.setReferrer(report.getReferrer());
+		log.setReferrer(cut(report.getReferrer(), 1024));
 		log.setScriptSample(report.getScriptSample());
-		log.setSourceFile(report.getSourceFile());
-		log.setStatusCode(report.getStatusCode());
-		log.setViolatedDirective(report.getViolatedDirective());
+		log.setSourceFile(cut(report.getSourceFile(), 1024));
+		log.setStatusCode(cut(report.getStatusCode(), 1024));
+		log.setViolatedDirective(cut(report.getViolatedDirective(), 1024));
 		if(identity != null) {
 			log.setIdentityKey(identity.getKey());
 		}
@@ -72,6 +72,13 @@ public class CSPManagerImpl implements CSPManager {
 		dbInstance.getCurrentEntityManager().persist(log);
 		return log;
 	}
+	
+	private String cut(String value, int length) {
+		if(StringHelper.containsNonWhitespace(value) && value.length() > length) {
+			value = value.substring(0, length - 10);
+		}
+		return value;
+	}
 
 	@Override
 	public int countLog() {
diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/FormLayoutContainer.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/FormLayoutContainer.java
index 63d2fc38aac62d7beb9498e16df5e4a73aaeac7e..6e4280d8cfc98aa94aa40668c02ea9670d220a44 100644
--- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/FormLayoutContainer.java
+++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/FormLayoutContainer.java
@@ -71,7 +71,7 @@ public class FormLayoutContainer extends FormItemImpl implements FormItemContain
 	/**
 	 * manage the form components of this form container
 	 */
-	private VelocityContainer formLayoutContainer;
+	private final VelocityContainer formLayoutContainer;
 	/**
 	 * formComponents and formComponentNames are managed together, change something here needs a change there.
 	 * formComponents contain the FormItem based on their name
@@ -128,12 +128,7 @@ public class FormLayoutContainer extends FormItemImpl implements FormItemContain
 		listeningOnlyFormComponents = new HashMap<>();
 	}
 
-	
-	
-	/**
-	 * @see org.olat.core.gui.components.form.flexible.FormComponent#rememberFormRequest(org.olat.core.gui.UserRequest,
-	 *      long[], int)
-	 */
+	@Override
 	public void evalFormRequest(UserRequest ureq) {
 		// form layouter has no values to store temporary
 	}
@@ -155,10 +150,7 @@ public class FormLayoutContainer extends FormItemImpl implements FormItemContain
 		hasRootForm = true;
 	}
 
-	/**
-	 * @see org.olat.core.gui.components.form.flexible.FormContainer#add(java.lang.String,
-	 *      org.olat.core.gui.components.form.flexible.FormComponentImpl)
-	 */
+	@Override
 	public void add(FormItem formComp) {
 		add(formComp.getName(), formComp);
 	}
@@ -214,7 +206,7 @@ public class FormLayoutContainer extends FormItemImpl implements FormItemContain
 		
 		//make collection accessible with <name> in the container.
 		//collection contains then only the names.
-		List<String> foItemsCollectionAsNames = new ArrayList<String>();
+		List<String> foItemsCollectionAsNames = new ArrayList<>();
 		formLayoutContainer.contextPut(name, foItemsCollectionAsNames);
 
 		//add all items as form items to the container
@@ -590,10 +582,11 @@ public class FormLayoutContainer extends FormItemImpl implements FormItemContain
 	}
 
 	/**
+	 * Create a layout based on a velocity template.
 	 * 
-	 * @param name
-	 * @param formTranslator
-	 * @param page
+	 * @param name The name of the component
+	 * @param formTranslator The translator
+	 * @param page The velocity template
 	 * @return
 	 */
 	public static FormLayoutContainer createCustomFormLayout(String name, Translator formTranslator, String page) {
diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FileElementImpl.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FileElementImpl.java
index d77d68fc5868ffcccc6e948e73fc72b250dd4723..14763b6b56ba64d0fdf9bcc4e3968be80d7121da 100644
--- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FileElementImpl.java
+++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FileElementImpl.java
@@ -162,8 +162,8 @@ public class FileElementImpl extends FormItemImpl
 			}
 
 			uploadFilename = form.getRequestMultipartFileName(component.getFormDispatchId());
-			// prevent an issue with Firefox
-			uploadFilename = FileUtils.normalizeFilenameWithSuffix(uploadFilename);
+			// prevent an issue with different operation systems and .
+			uploadFilename = FileUtils.cleanFilename(uploadFilename);
 			// use mime-type from file name to have deterministic mime types
 			uploadMimeType = WebappHelper.getMimeType(uploadFilename);
 			if (uploadMimeType == null) {
diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java
index 3f3b0468039d327d370fe37d0c6511e55b7c3456..f0026a4a847843c2fd8901cf495e023314f0e0b2 100644
--- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java
+++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java
@@ -229,12 +229,14 @@ public class FlexiTableElementImpl extends FormItemImpl implements FlexiTableEle
 			customTypeButton = new FormLinkImpl(dispatchId + "_customRTypeButton", "rCustomRTypeButton", "", Link.BUTTON + Link.NONTRANSLATED);
 			customTypeButton.setTranslator(translator);
 			customTypeButton.setIconLeftCSS("o_icon o_icon_table_custom o_icon-lg");
+			customTypeButton.setElementCssClass("o_sel_custom");
 			customTypeButton.setActive(FlexiTableRendererType.custom == rendererType);
 			components.put("rTypeCustom", customTypeButton);
 			//classic tables
 			classicTypeButton = new FormLinkImpl(dispatchId + "_classicRTypeButton", "rClassicRTypeButton", "", Link.BUTTON + Link.NONTRANSLATED);
 			classicTypeButton.setTranslator(translator);
 			classicTypeButton.setIconLeftCSS("o_icon o_icon_table o_icon-lg");
+			classicTypeButton.setElementCssClass("o_sel_table");
 			classicTypeButton.setActive(FlexiTableRendererType.classic == rendererType);
 			components.put("rTypeClassic", classicTypeButton);
 			
diff --git a/src/main/java/org/olat/core/gui/control/generic/portal/PortalMainController.java b/src/main/java/org/olat/core/gui/control/generic/portal/PortalMainController.java
index 06bff91d631481b89aed3238726c1e7578763a6b..c8d0f782620f3bc689414f875479ab5e66334851 100644
--- a/src/main/java/org/olat/core/gui/control/generic/portal/PortalMainController.java
+++ b/src/main/java/org/olat/core/gui/control/generic/portal/PortalMainController.java
@@ -78,7 +78,8 @@ public class PortalMainController extends BasicController {
 				portalTemplate = ((PortalImpl)CoreSpringFactory.getBean("guestportal"));
 				portalEditButton.setEnabled(false);
 				portalEditButton.setVisible(false);
-			} else if((roles.isGroupManager() || roles.isInstitutionalResourceManager() || roles.isOLATAdmin() || roles.isPoolAdmin() || roles.isUserManager())
+			} else if((roles.isGroupManager() || roles.isLearnResourceManager() || roles.isOLATAdmin()
+					|| roles.isPoolAdmin() || roles.isUserManager() || roles.isCurriculumManager())
 					&& CoreSpringFactory.containsBean("authorportal")) {
 				portalTemplate = ((PortalImpl)CoreSpringFactory.getBean("authorportal"));
 			} else {
diff --git a/src/main/java/org/olat/core/gui/control/navigation/callback/ManagersSecurityCallback.java b/src/main/java/org/olat/core/gui/control/navigation/callback/ManagersSecurityCallback.java
index 9a5b4fbd22605ff706793a165c93f9415e9fc87b..6f3a8d3b2802c6b73c6d203a1640aa105ded5bcc 100644
--- a/src/main/java/org/olat/core/gui/control/navigation/callback/ManagersSecurityCallback.java
+++ b/src/main/java/org/olat/core/gui/control/navigation/callback/ManagersSecurityCallback.java
@@ -22,6 +22,7 @@ package org.olat.core.gui.control.navigation.callback;
 
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.navigation.SiteSecurityCallback;
+import org.olat.core.util.UserSession;
 
 /**
  * <h3>Description:</h3>
@@ -33,21 +34,18 @@ import org.olat.core.gui.control.navigation.SiteSecurityCallback;
  */
 public class ManagersSecurityCallback implements SiteSecurityCallback {
 
-	/**
-	 * @see com.frentix.olat.coursesite.SiteSecurityCallback#isAllowedToLaunchSite(org.olat.core.gui.UserRequest)
-	 */
 	@Override
 	public boolean isAllowedToLaunchSite(UserRequest ureq) {
-		if (ureq.getUserSession().getRoles() == null) {
+		UserSession usess = ureq.getUserSession();
+		if (usess.getRoles() == null) {
 			return false;
-		} else if (ureq.getUserSession().getRoles().isOLATAdmin()
-				|| ureq.getUserSession().getRoles().isGroupManager()
-				|| ureq.getUserSession().getRoles().isInstitutionalResourceManager()
-				|| ureq.getUserSession().getRoles().isUserManager()
-				|| ureq.getUserSession().getRoles().isPoolAdmin()) {
-			return true;
-		} else {
-			return false; 
 		}
+		
+		return usess.getRoles().isOLATAdmin()
+				|| usess.getRoles().isGroupManager()
+				|| usess.getRoles().isLearnResourceManager()
+				|| usess.getRoles().isUserManager()
+				|| usess.getRoles().isPoolAdmin()
+				|| usess.getRoles().isCurriculumManager();
 	}
 }
diff --git a/src/main/java/org/olat/core/gui/control/navigation/callback/SiteSecurityCallbackWithRolesRestriction.java b/src/main/java/org/olat/core/gui/control/navigation/callback/SiteSecurityCallbackWithRolesRestriction.java
index 86329149f8a73c777ff292e187b0113c48b71ee3..0c2f8db9c72c45daba8d20786c365583ff1a5933 100644
--- a/src/main/java/org/olat/core/gui/control/navigation/callback/SiteSecurityCallbackWithRolesRestriction.java
+++ b/src/main/java/org/olat/core/gui/control/navigation/callback/SiteSecurityCallbackWithRolesRestriction.java
@@ -48,17 +48,19 @@ public class SiteSecurityCallbackWithRolesRestriction implements SiteSecurityCal
 						return true;
 					} else if (theRole.equals("administrator") && roles.isOLATAdmin()) {
 						return true;
-					} else if (theRole.equals("groupmanager") && roles.isGroupManager()) {
+					} else if (theRole.equals("groupmanager") && (roles.isOLATAdmin() || roles.isGroupManager())) {
 						return true;
-					} else if (theRole.equals("usermanager") && roles.isUserManager()) {
+					} else if (theRole.equals("usermanager") && (roles.isOLATAdmin() || roles.isUserManager())) {
 						return true;
-					} else if (theRole.equals("author") && roles.isAuthor()) {
+					} else if (theRole.equals("pooladmin") && (roles.isOLATAdmin() || roles.isPoolAdmin())) {
 						return true;
-					} else if (theRole.equals("pooladmin") && roles.isPoolAdmin()) {
+					} else if (theRole.equals("institutionalresourcemanager") && (roles.isOLATAdmin() || roles.isLearnResourceManager())) {
 						return true;
-					} else if (theRole.equals("institutionalresourcemanager") && roles.isInstitutionalResourceManager()) {
+					} else if (theRole.equals("author") && (roles.isOLATAdmin() || roles.isAuthor())) {
 						return true;
-					}
+					} else if (theRole.equals("coach") && (roles.isOLATAdmin() || roles.isCoach())) {
+						return true;
+					} 
 				}
 			}
 			return false;
@@ -72,8 +74,6 @@ public class SiteSecurityCallbackWithRolesRestriction implements SiteSecurityCal
 	public void setLimitToRole(String limitToRoleConfig) {
 		if (limitToRoleConfig != null) {
 			limitToRole = limitToRoleConfig.split(",");			
-		} else {
-			limitToRoleConfig = null;
 		}
 	}
 }
diff --git a/src/main/java/org/olat/core/id/Organisation.java b/src/main/java/org/olat/core/id/Organisation.java
index 6d6247221e5c25820bd858a814c9a6f76e2ce725..38c719ca9c6b3fc9c0429d5dda6c7c53d7db1c72 100644
--- a/src/main/java/org/olat/core/id/Organisation.java
+++ b/src/main/java/org/olat/core/id/Organisation.java
@@ -19,8 +19,9 @@
  */
 package org.olat.core.id;
 
+import java.util.List;
+
 import org.olat.basesecurity.OrganisationManagedFlag;
-import org.olat.basesecurity.OrganisationRef;
 
 /**
  * 
@@ -30,6 +31,8 @@ import org.olat.basesecurity.OrganisationRef;
  */
 public interface Organisation extends CreateInfo, ModifiedInfo, OrganisationRef {
 	
+	public boolean isDefault();
+	
 	public String getMaterializedPathKeys();
 	
 	public String getIdentifier();
@@ -54,6 +57,8 @@ public interface Organisation extends CreateInfo, ModifiedInfo, OrganisationRef
 	
 	public Organisation getParent();
 	
+	public List<OrganisationRef> getParentLine();
+	
 	public Organisation getRoot();
 
 }
diff --git a/src/main/java/org/olat/basesecurity/OrganisationRef.java b/src/main/java/org/olat/core/id/OrganisationRef.java
similarity index 97%
rename from src/main/java/org/olat/basesecurity/OrganisationRef.java
rename to src/main/java/org/olat/core/id/OrganisationRef.java
index 184d04f2c507a11823a13d5b57c69457d11e9fd6..e3c49c3446e537c6230acb1ced3063e66cd44ee7 100644
--- a/src/main/java/org/olat/basesecurity/OrganisationRef.java
+++ b/src/main/java/org/olat/core/id/OrganisationRef.java
@@ -17,7 +17,7 @@
  * frentix GmbH, http://www.frentix.com
  * <p>
  */
-package org.olat.basesecurity;
+package org.olat.core.id;
 
 /**
  * 
diff --git a/src/main/java/org/olat/core/id/Roles.java b/src/main/java/org/olat/core/id/Roles.java
index a1d6b2122e6cb5118e8d2a04b1c3fe1dde8ca5b7..d91faeb7337f67ecd656ba76c675e33960d2426a 100644
--- a/src/main/java/org/olat/core/id/Roles.java
+++ b/src/main/java/org/olat/core/id/Roles.java
@@ -27,6 +27,12 @@
 package org.olat.core.id;
 
 import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.olat.basesecurity.OrganisationRoles;
 
 /**
 *  Description:<br>
@@ -34,16 +40,19 @@ import java.io.Serializable;
 */
 public class Roles implements Serializable {
 	private static final long serialVersionUID = 4726449291059674346L;
-	private boolean isSystemAdmin;
-	private boolean isOLATAdmin;
-	private boolean isUserManager;
-	private boolean isGroupManager;
-	private boolean isAuthor;
-	private boolean isGuestOnly;
-	private boolean isInstitutionalResourceManager;
-	private boolean isPoolAdmin;
-	private boolean isCurriculumManager;
-	private boolean isInvitee;
+	private final boolean isSystemAdmin;
+	private final boolean isOLATAdmin;
+	private final boolean isUserManager;
+	private final boolean isGroupManager;
+	private final boolean isAuthor;
+	private final boolean isCoach;
+	private final boolean isGuestOnly;
+	private final boolean isInstitutionalResourceManager;
+	private final boolean isPoolAdmin;
+	private final boolean isCurriculumManager;
+	private final boolean isInvitee;
+	
+	private List<RolesByOrganisation> rolesByOrganisations;
 
 	/**
 	 * @param isOLATAdmin
@@ -55,11 +64,11 @@ public class Roles implements Serializable {
 	 */
 	public Roles(boolean isOLATAdmin, boolean isUserManager, boolean isGroupManager, boolean isAuthor, boolean isGuestOnly,
 			boolean isInstitutionalResourceManager, boolean isInvitee) {
-		this(false, isOLATAdmin, isGroupManager, isUserManager, isAuthor, isGuestOnly, isInstitutionalResourceManager, false,  false, isInvitee);
+		this(false, isOLATAdmin, isGroupManager, isUserManager, isAuthor, isGuestOnly, isInstitutionalResourceManager, false,  false, false, isInvitee);
 	}
 	
 	public Roles(boolean isSystemAdmin, boolean isOLATAdmin, boolean isUserManager, boolean isGroupManager, boolean isAuthor, boolean isGuestOnly,
-			boolean isInstitutionalResourceManager, boolean isPoolAdmin, boolean isCurriculumManager, boolean isInvitee) {
+			boolean isInstitutionalResourceManager, boolean isPoolAdmin, boolean isCurriculumManager, boolean isCoach, boolean isInvitee) {
 		this.isSystemAdmin = isSystemAdmin;
 		this.isOLATAdmin = isOLATAdmin;
 		this.isGroupManager = isGroupManager;
@@ -70,6 +79,7 @@ public class Roles implements Serializable {
 		this.isPoolAdmin = isPoolAdmin;
 		this.isCurriculumManager = isCurriculumManager;
 		this.isInvitee = isInvitee;
+		this.isCoach = isCoach;
 	}
 	
 	/**
@@ -78,9 +88,89 @@ public class Roles implements Serializable {
 	 * @return The roles object
 	 */
 	public static final Roles userRoles() {
-		return new Roles(false, false, false, false, false, false, false, false, false, false);
+		return new Roles(false, false, false, false, false, false, false, false, false, false, false);
+	}
+	
+	public void setRolesByOrganisation(List<RolesByOrganisation> rolesByOrganisations) {
+		this.rolesByOrganisations = new ArrayList<>(rolesByOrganisations);
 	}
 	
+	public RolesByOrganisation getRoles(OrganisationRef organisation) {
+		RolesByOrganisation setOfRoles = null;
+		if(rolesByOrganisations != null) {
+			for(int i=rolesByOrganisations.size(); i--> 0; ) {
+				if(rolesByOrganisations.get(i).matchOrganisation(organisation)) {
+					setOfRoles = rolesByOrganisations.get(i);
+				}
+			}
+		}
+		return setOfRoles;
+	}
+	
+	/**
+	 * All the organizations 
+	 * 
+	 * @return
+	 */
+	public List<OrganisationRef> getOrganisations() {
+		Set<OrganisationRef> organisations = new HashSet<>();
+		if(rolesByOrganisations != null) {
+			for(int i=rolesByOrganisations.size(); i--> 0; ) {
+				organisations.add(rolesByOrganisations.get(i).getOrganisation());
+			}
+		}
+		return new ArrayList<>(organisations);
+	}
+	
+	public List<OrganisationRef> getOrganisationsWithRoles(OrganisationRoles role) {
+		List<OrganisationRef> organisations = new ArrayList<>();
+		if(rolesByOrganisations != null) {
+			for(int i=rolesByOrganisations.size(); i--> 0; ) {
+				if(rolesByOrganisations.get(i).hasRole(role)) {
+					organisations.add(rolesByOrganisations.get(i).getOrganisation());
+				}
+			}
+		}
+		return organisations;
+	}
+	
+	public boolean hasRole(OrganisationRef organisation, OrganisationRoles role) {
+		boolean foundRole = false;
+		if(rolesByOrganisations != null) {
+			for(int i=rolesByOrganisations.size(); i--> 0; ) {
+				if(rolesByOrganisations.get(i).matchOrganisation(organisation) && rolesByOrganisations.get(i).hasRole(role)) {
+					foundRole = true;
+				}
+			}
+		}
+		return foundRole;
+	}
+	
+	public boolean hasRoleInParentLine(Organisation organisation, OrganisationRoles role) {
+		boolean foundRole = false;
+		if(rolesByOrganisations != null) {
+			for(int i=rolesByOrganisations.size(); i--> 0; ) {
+				if(rolesByOrganisations.get(i).matchOrganisationOrItsParents(organisation) && rolesByOrganisations.get(i).hasRole(role)) {
+					foundRole = true;
+				}
+			}
+		}
+		return foundRole;
+	}
+	
+	public boolean hasRole(List<? extends OrganisationRef> organisations, OrganisationRoles role) {
+		if(rolesByOrganisations != null) {
+			for(OrganisationRef organisation: organisations) {
+				for(int i=rolesByOrganisations.size(); i--> 0; ) {
+					if(rolesByOrganisations.get(i).matchOrganisation(organisation) && rolesByOrganisations.get(i).hasRole(role)) {
+						return true;
+					}
+				}
+			}
+		}
+		return false;
+	}
+
 	public boolean isSystemAdmin() {
 		return isSystemAdmin;
 	}
@@ -99,6 +189,10 @@ public class Roles implements Serializable {
 		return isAuthor;
 	}
 	
+	public boolean isCoach() {
+		return isCoach;
+	}
+	
 	/**
 	 * @return boolean
 	 */
@@ -114,16 +208,16 @@ public class Roles implements Serializable {
 	}
 
 	/**
-	 * @return boolean
+	 * @return boolean true if the user has the role "user manager" in some organizations.
 	 */
 	public boolean isUserManager() {
 		return isUserManager;
 	}
 	
 	/**
-	 * @return boolean
+	 * @return boolean True if the user has the role "learn resource manager" in some organizations.
 	 */
-	public boolean isInstitutionalResourceManager() {
+	public boolean isLearnResourceManager() {
 		return isInstitutionalResourceManager;
 	}
 	
diff --git a/src/main/java/org/olat/core/id/RolesByOrganisation.java b/src/main/java/org/olat/core/id/RolesByOrganisation.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ea89f897108d83425d05eb0d5659ff426a1c0ae
--- /dev/null
+++ b/src/main/java/org/olat/core/id/RolesByOrganisation.java
@@ -0,0 +1,148 @@
+package org.olat.core.id;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.olat.basesecurity.OrganisationRoles;
+
+/**
+ * 
+ * Initial date: 25 avr. 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class RolesByOrganisation implements Serializable {
+
+	private static final long serialVersionUID = -8830925452353030770L;
+	
+	private final OrganisationRef organisation;
+	private final OrganisationRoles[] roles;
+	
+	public RolesByOrganisation(OrganisationRef organisation, OrganisationRoles[] roles) {
+		this.organisation = organisation;
+		this.roles = roles;
+	}
+	
+	public RolesByOrganisation(OrganisationRef organisation, List<OrganisationRoles> roles) {
+		this.organisation = organisation;
+		this.roles = roles == null ? new OrganisationRoles[0] : roles.toArray(new OrganisationRoles[roles.size()]);
+	}
+	
+	public static RolesByOrganisation roles(OrganisationRef org, boolean invitee, boolean user,
+			boolean coach, boolean author,
+			boolean groupManager, boolean poolManager, boolean curriculummanager,
+			boolean usermanager, boolean learnresourcemanager, boolean admin) {
+		
+		List<OrganisationRoles> roleList = new ArrayList<>();
+		if(user) {
+			roleList.add(OrganisationRoles.user);
+		}
+		if(invitee) {
+			roleList.add(OrganisationRoles.invitee);
+		}
+		if(coach) {
+			roleList.add(OrganisationRoles.coach);
+		}
+		if(groupManager) {
+			roleList.add(OrganisationRoles.groupmanager);
+		}
+		if(poolManager) {
+			roleList.add(OrganisationRoles.poolmanager);
+		}
+		if(curriculummanager) {
+			roleList.add(OrganisationRoles.curriculummanager);
+		}
+		if(author) {
+			roleList.add(OrganisationRoles.author);
+		}
+		if(usermanager) {
+			roleList.add(OrganisationRoles.usermanager);
+		}
+		if(learnresourcemanager) {
+			roleList.add(OrganisationRoles.learnresourcemanager);
+		}
+		if(admin) {
+			roleList.add(OrganisationRoles.administrator);
+		}
+		return new RolesByOrganisation(org, roleList.toArray(new OrganisationRoles[roleList.size()]));
+	}
+	
+	public OrganisationRef getOrganisation() {
+		return organisation;
+	}
+	
+	public boolean matchOrganisation(OrganisationRef org) {
+		return organisation.getKey().equals(org.getKey());
+	}
+	
+	public boolean matchOrganisationOrItsParents(Organisation org) {
+		if(organisation.getKey().equals(org.getKey())) {
+			return true;
+		}
+		
+		for(OrganisationRef parent:org.getParentLine()) {
+			if(parent.getKey().equals(organisation.getKey())) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	public boolean isGuestOnly() {
+		return hasRole(OrganisationRoles.guest);
+	}
+	
+	public boolean isInvitee() {
+		return hasRole(OrganisationRoles.invitee);
+	}
+	
+	public boolean isUser() {
+		return hasRole(OrganisationRoles.user);
+	}
+	
+	public boolean isCoach() {
+		return hasRole(OrganisationRoles.coach);
+	}
+	
+	public boolean isAuthor() {
+		return hasRole(OrganisationRoles.author);
+	}
+	
+	public boolean isGroupManager() {
+		return hasRole(OrganisationRoles.groupmanager);
+	}
+	
+	public boolean isUserManager() {
+		return hasRole(OrganisationRoles.usermanager);
+	}
+	
+	public boolean isPoolManager() {
+		return hasRole(OrganisationRoles.poolmanager);
+	}
+	
+	public boolean isCurriculumManager() {
+		return hasRole(OrganisationRoles.curriculummanager);
+	}
+	
+	public boolean isLearnResourceManager() {
+		return hasRole(OrganisationRoles.learnresourcemanager);
+	}
+	
+	public boolean isAdministrator() {
+		return hasRole(OrganisationRoles.administrator);
+	}
+	
+	public boolean hasRole(OrganisationRoles role) {
+		boolean hasRole = false;
+		if(roles != null && roles.length > 0) {
+			for(int i=roles.length; i-->0; ) {
+				if(roles[i] == role) {
+					hasRole = true;
+				}
+			}
+		}
+		return hasRole;
+	}
+
+}
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 2d2b789a0814e16f7e8aefbf1f0a02ff0d7587e2..641a3438ea0731354302aa666bd559d191db8a1c 100644
--- a/src/main/java/org/olat/core/id/context/HistoryManager.java
+++ b/src/main/java/org/olat/core/id/context/HistoryManager.java
@@ -52,7 +52,6 @@ public class HistoryManager {
 	
 	private static final OLog log = Tracing.createLoggerFor(HistoryManager.class);
 	
-	private static HistoryManager THIS;
 	private static XStream historyReadStream = XStreamHelper.createXStreamInstance();
 	private static XStream historyWriteStream = XStreamHelper.createXStreamInstance();
 	static {
@@ -72,6 +71,7 @@ public class HistoryManager {
 		historyReadStream.omitField(RepositoryEntry.class, "tutorGroup");
 		historyReadStream.omitField(RepositoryEntry.class, "metaDataElements");
 		historyReadStream.omitField(RepositoryEntry.class, "version");
+		historyReadStream.omitField(RepositoryEntry.class, "organisations");
 		historyReadStream.omitField(org.olat.core.commons.persistence.PersistentObject.class, "version");
 		
 		historyReadStream.alias("org.olat.core.util.resource.OresHelper$1", Resourceable.class);
@@ -83,14 +83,6 @@ public class HistoryManager {
 		historyReadStream.aliasAttribute(Resourceable.class, "resourceableId", "val$key");
 	}
 	
-	public HistoryManager() {
-		THIS = this;
-	}
-	
-	public static HistoryManager getInstance() {
-		return THIS;
-	}
-	
 	public void persistHistoryPoint(Identity identity, HistoryPoint historyPoint) {
 		try {
 			String pathHomePage = FolderConfig.getCanonicalRoot() + FolderConfig.getUserHomePage(identity.getName());
diff --git a/src/main/java/org/olat/core/util/FileUtils.java b/src/main/java/org/olat/core/util/FileUtils.java
index 00e65b8c823d13610d4657908ffc46011a8587a7..62a71d5060545fa0e36729d7040b83f42a88d2d0 100644
--- a/src/main/java/org/olat/core/util/FileUtils.java
+++ b/src/main/java/org/olat/core/util/FileUtils.java
@@ -75,8 +75,9 @@ public class FileUtils {
 	
 	//windows: invalid characters for filenames: \ / : * ? " < > | 
 	//linux: invalid characters for file/folder names: /, but you have to escape certain chars, like ";$%&*"
+	//zip: may cause errors: =
 	//OLAT reserved char: ":"	
-	public static char[] FILE_NAME_FORBIDDEN_CHARS = { '/', '\n', '\r', '\t', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':', ',' };
+	public static char[] FILE_NAME_FORBIDDEN_CHARS = { '/', '\n', '\r', '\t', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':', ',', '=' };
   //private static char[] FILE_NAME_ACCEPTED_CHARS = { 'ä', 'Ä', 'ü', 'Ü', 'ö', 'Ö', ' '};
 	public static char[] FILE_NAME_ACCEPTED_CHARS = { '\u0228', '\u0196', '\u0252', '\u0220', '\u0246', '\u0214', ' '};
 	// known metadata files
@@ -893,7 +894,15 @@ public class FileUtils {
 		return nameSanitized;
 	}
 	
-	public static String normalizeFilenameWithSuffix(String filename) {
+	/**
+	 * Cleans the filename from invalid character to make a filename compatible for
+	 * the usual operating systems and browsers.. Suffixes are preserved. This
+	 * method is not as strict as {@link #normalizeFilename(String)}.
+	 * 
+	 * @param filename
+	 * @return the cleaned filename
+	 */
+	public static String cleanFilename(String filename) {
 		boolean hasExtension = false;
 		String name = filename;
 		String extension = getFileSuffix(filename);
@@ -902,14 +911,23 @@ public class FileUtils {
 			name = filename.substring(0, filename.length() - extension.length() - 1);
 		}
 		StringBuilder normalizedFilename = new StringBuilder();
-		normalizedFilename.append(normalizeFilename(name));
+		normalizedFilename.append(cleanFilenamePart(name));
 		if (hasExtension) {
 			normalizedFilename.append(".");
-			normalizedFilename.append(normalizeFilename(extension));
+			normalizedFilename.append(cleanFilenamePart(extension));
 		}
 		return normalizedFilename.toString();
 	}
 	
+	private static String cleanFilenamePart(String filename) {
+		String cleaned = Normalizer.normalize(filename, Normalizer.Form.NFKD);
+		cleaned = cleaned.replaceAll("\\p{InCombiningDiacriticalMarks}+","");
+		for (char character: FILE_NAME_FORBIDDEN_CHARS) {
+			cleaned = cleaned.replace(character, '_');
+		}
+		return cleaned;
+	}
+	
 	/**
 	 * Creates a new directory in the specified directory, using the given prefix and suffix strings to generate its name.
 	 * It uses File.createTempFile() and should provide a unique name.
diff --git a/src/main/java/org/olat/core/util/mail/ui/EMailCalloutCtrl.java b/src/main/java/org/olat/core/util/mail/ui/EMailCalloutCtrl.java
index 3419224c376d98b177336c985332b9e6ef9dfaf4..d2d66784c2987c8d7a7b045938981ab4bdd4e28e 100644
--- a/src/main/java/org/olat/core/util/mail/ui/EMailCalloutCtrl.java
+++ b/src/main/java/org/olat/core/util/mail/ui/EMailCalloutCtrl.java
@@ -24,6 +24,7 @@ import java.util.List;
 import org.olat.admin.user.UserSearchListProvider;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityModule;
+import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.events.SingleIdentityChosenEvent;
 import org.olat.core.gui.UserRequest;
@@ -86,7 +87,8 @@ public class EMailCalloutCtrl extends FormBasicController {
 			if(roles.isOLATAdmin()) {
 				searcheableOrganisations = null;
 			} else {
-				searcheableOrganisations = organisationService.getSearchableOrganisations(getIdentity(), roles);
+				searcheableOrganisations = organisationService
+						.getSearchableOrganisations(getIdentity(), roles, OrganisationRoles.usermanager);
 			}
 			ListProvider provider = new UserSearchListProvider(searcheableOrganisations);
 			autocompleterC = new FlexiAutoCompleterController(ureq, getWindowControl(), provider, null, isAdministrativeUser, allowExternalAddress, 60, 3, null, mainForm);
diff --git a/src/main/java/org/olat/core/util/vfs/QuotaManager.java b/src/main/java/org/olat/core/util/vfs/QuotaManager.java
index 3361a53c2208afae919971a89d961a0bf6263e88..df19a437f7ea8e9e611abebed44c947bc5ae5521 100644
--- a/src/main/java/org/olat/core/util/vfs/QuotaManager.java
+++ b/src/main/java/org/olat/core/util/vfs/QuotaManager.java
@@ -33,6 +33,7 @@ import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.id.Identity;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 
 /**
@@ -150,7 +151,7 @@ public interface QuotaManager {
 	 * @param relPath
 	 * @return
 	 */
-	public Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath);
+	public Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath, List<? extends OrganisationRef> resourceOwnership);
 	
 	public Controller getQuotaViewInstance(UserRequest ureq, WindowControl wControl, String relPath);
 	
@@ -161,5 +162,5 @@ public interface QuotaManager {
 	 * @return true: user is allowed to launch quota editor ; false: user is not
 	 *         allowed to launch quota editor
 	 */
-	public boolean hasQuotaEditRights(Identity identity, Roles roles);
+	public boolean hasQuotaEditRights(Identity identity, Roles roles, List<OrganisationRef> resourceOwnership);
 }
diff --git a/src/main/java/org/olat/course/CourseFactory.java b/src/main/java/org/olat/course/CourseFactory.java
index 08cf7c9a7d9039c5ae9f3d206b4e34081b5ccd6b..4499e35e3cdc340560e885a57f3d05f311767078 100644
--- a/src/main/java/org/olat/course/CourseFactory.java
+++ b/src/main/java/org/olat/course/CourseFactory.java
@@ -26,7 +26,6 @@
 package org.olat.course;
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -42,7 +41,6 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.zip.ZipOutputStream;
 
-import org.apache.commons.io.IOUtils;
 import org.olat.admin.quota.QuotaConstants;
 import org.olat.commons.calendar.CalendarManager;
 import org.olat.commons.calendar.CalendarNotificationManager;
@@ -126,11 +124,8 @@ 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.RepositoryEntryImportExport;
 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.RepositoryEntrySecurity;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
@@ -158,20 +153,15 @@ public class CourseFactory {
   //this is the lock that must be aquired at course editing, copy course, export course, configure course.
 	private static Map<Long,PersistingCourseImpl> courseEditSessionMap = new ConcurrentHashMap<>();
 	private static final OLog log = Tracing.createLoggerFor(CourseFactory.class);
-	private static RepositoryManager repositoryManager;
 	private static ReferenceManager referenceManager;
-	private static RepositoryService repositoryService;
 
 
 	/**
 	 * [used by spring]
 	 */
-	private CourseFactory(CoordinatorManager coordinatorManager, RepositoryManager repositoryManager,
-			RepositoryService repositoryService, ReferenceManager referenceManager) {
+	private CourseFactory(CoordinatorManager coordinatorManager, ReferenceManager referenceManager) {
 		loadedCourses = coordinatorManager.getCoordinator().getCacher().getCache(CourseFactory.class.getSimpleName(), "courses");
-		CourseFactory.repositoryManager = repositoryManager;
 		CourseFactory.referenceManager = referenceManager;
-		CourseFactory.repositoryService = repositoryService;
 	}
 
 	/**
@@ -568,39 +558,6 @@ public class CourseFactory {
 		return null;
 	}
 
-	/**
-	 * Deploys a course from an exported course ZIP file. This process is unatended and
-	 * therefore relies on some default assumptions on how to setup the entry and add
-	 * any referenced resources to the repository.
-	 *
-	 * @param exportedCourseZIPFile
-	 */
-	public static RepositoryEntry deployCourseFromZIP(File exportedCourseZIPFile, String softKey, int access) {
-
-		RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(exportedCourseZIPFile);
-		if(!StringHelper.containsNonWhitespace(softKey)) {
-			softKey = importExport.getSoftkey();
-		}
-		RepositoryEntry existingEntry = repositoryManager.lookupRepositoryEntryBySoftkey(softKey, false);
-		if (existingEntry != null) {
-			log.info("RepositoryEntry with softkey " + softKey + " already exists. Course will not be deployed.");
-			return existingEntry;
-		}
-
-
-		RepositoryHandler courseHandler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(CourseModule.getCourseTypeName());
-		RepositoryEntry re = courseHandler.importResource(null, importExport.getInitialAuthor(), importExport.getDisplayName(), importExport.getDescription(),
-				true, Locale.ENGLISH, exportedCourseZIPFile, exportedCourseZIPFile.getName());
-
-		re.setSoftkey(softKey);
-		repositoryService.update(re);
-
-		ICourse course = loadCourse(re);
-		publishCourse(course, access, false,  null, Locale.ENGLISH);
-		return re;
-	}
-
-
 	/**
 	 * Publish the course with some standard options
 	 * @param course
@@ -1057,9 +1014,7 @@ public class CourseFactory {
 			this.charset = charset;
 		}
 
-		/**
-		 * @see org.olat.core.util.tree.Visitor#visit(org.olat.core.util.nodes.INode)
-		 */
+		@Override
 		public void visit(INode node) {
 			CourseNode cn = (CourseNode) node;
 
@@ -1067,18 +1022,12 @@ public class CourseFactory {
 					+ StringHelper.transformDisplayNameToFileSystemName(cn.getShortName())
 					+ "_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
 
-			FileOutputStream fileStream = null;
-			ZipOutputStream exportStream = null;
-			try {
-				File exportFile = new File(exportPath, archiveName);
-				fileStream = new FileOutputStream(exportFile);
-				exportStream = new ZipOutputStream(fileStream);
+			File exportFile = new File(exportPath, archiveName);
+			try(FileOutputStream fileStream = new FileOutputStream(exportFile);
+					ZipOutputStream exportStream = new ZipOutputStream(fileStream);) {
 				cn.archiveNodeData(locale, course, null, exportStream, charset);
-			} catch (FileNotFoundException e) {
+			} catch (IOException e) {
 				log.error("", e);
-			} finally {
-				IOUtils.closeQuietly(exportStream);
-				IOUtils.closeQuietly(fileStream);
 			}
 		}
 	}
diff --git a/src/main/java/org/olat/course/_spring/courseContext.xml b/src/main/java/org/olat/course/_spring/courseContext.xml
index 9c33dc5bcb4e17e64c53fe65b5f0a5f7cc03e3e5..407dc3371c3de7d3d0240722ddbf48d9963022dd 100644
--- a/src/main/java/org/olat/course/_spring/courseContext.xml
+++ b/src/main/java/org/olat/course/_spring/courseContext.xml
@@ -29,9 +29,7 @@
 	<bean id="courseFactory" class="org.olat.course.CourseFactory"
 		depends-on="businessGroupService,resourceManager,baseSecurityManager,glossaryManager">
 		<constructor-arg index="0" ref="coordinatorManager" />
-		<constructor-arg index="1" ref="repositoryManager" />
-		<constructor-arg index="2" ref="repositoryService" />
-		<constructor-arg index="3" ref="referenceManager" />
+		<constructor-arg index="1" ref="referenceManager" />
 	</bean>
 	
 	<!-- Three Logs are available within a course:
diff --git a/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java b/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java
index a6b7cbe8d94b3e63a1e531587f3e5ff6249108c9..532cd2f2e511c05a53301697c7812f093832d075 100644
--- a/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java
+++ b/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java
@@ -367,10 +367,13 @@ public class ScoreAccountingHelper {
 			if(acnode instanceof STCourseNode || !acnode.hasScoreConfigured()) {
 				minVal = maxVal = cutVal = "-";
 			} else {
-				minVal = acnode.getMinScoreConfiguration() == null ? "-" : AssessmentHelper.getRoundedScore(acnode.getMinScoreConfiguration());
-				maxVal = acnode.getMaxScoreConfiguration() == null ? "-" : AssessmentHelper.getRoundedScore(acnode.getMaxScoreConfiguration());
+				Float minScoreConfig = acnode.getMinScoreConfiguration();
+				Float maxScoreConfig = acnode.getMaxScoreConfiguration();
+				minVal = minScoreConfig == null ? "-" : AssessmentHelper.getRoundedScore(minScoreConfig);
+				maxVal = maxScoreConfig == null ? "-" : AssessmentHelper.getRoundedScore(maxScoreConfig);
 				if (acnode.hasPassedConfigured()) {
-					cutVal = acnode.getCutValueConfiguration() == null ? "-" : AssessmentHelper.getRoundedScore(acnode.getCutValueConfiguration());
+					Float cutValueConfig = acnode.getCutValueConfiguration();
+					cutVal = cutValueConfig == null ? "-" : AssessmentHelper.getRoundedScore(cutValueConfig);
 				} else {
 					cutVal = "-";
 				}
diff --git a/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementController.java b/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementController.java
index b9f6f16c34dfbba06075c59915b0707d6951c45d..0ae3fb00fe39da84b5ed147f901d278805696877 100644
--- a/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementController.java
+++ b/src/main/java/org/olat/course/certificate/ui/CertificateAndEfficiencyStatementController.java
@@ -113,6 +113,8 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 	private CertificateController certificateCtrl;
 	private IdentityAssessmentOverviewController courseDetailsCtrl;
 	
+	@Autowired
+	private UserManager userManager;
 	@Autowired
 	private EfficiencyStatementMediaHandler mediaHandler;
 	@Autowired
@@ -158,7 +160,7 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 			BusinessGroup businessGroup, Long resourceKey, RepositoryEntry courseRepo, EfficiencyStatement efficiencyStatement, boolean links) {
 		super(ureq, wControl);
 		setTranslator(Util.createPackageTranslator(AssessmentModule.class, getLocale(), getTranslator()));
-		setTranslator(UserManager.getInstance().getPropertyHandlerTranslator(getTranslator()));
+		setTranslator(userManager.getPropertyHandlerTranslator(getTranslator()));
 		
 		this.courseRepoEntry = courseRepo;
 		this.businessGroup = businessGroup;
@@ -210,12 +212,6 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 		}
 
 		putInitialPanel(mainVC);
-		//message, that no data is available. This may happen in the case the "open efficiency" link is available, while in the meantime an author
-		//disabled the efficiency statement.
-		//String text = translate("efficiencystatement.nodata");
-		//Controller messageCtr = MessageUIFactory.createSimpleMessage(ureq, getWindowControl(), text);
-		//listenTo(messageCtr);//gets disposed as this controller gets disposed.
-		//mainVC.put("assessmentOverviewTable",  messageCtr.getInitialComponent());
 	}
 
 	@Override
@@ -255,8 +251,8 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 		mainVC.contextPut("username", statementOwner.getName());
 		
 		Roles roles = ureq.getUserSession().getRoles();
-		boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());	
-		List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
+		boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());
+		List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
 		mainVC.contextPut("userPropertyHandlers", userPropertyHandlers);
 
 		if(!getIdentity().equals(statementOwner) && links) {
@@ -355,7 +351,7 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 	
 	private void doOpenGroup(UserRequest ureq) {
 		if(businessGroup != null) {
-			List<ContextEntry> ces = new ArrayList<ContextEntry>(1);
+			List<ContextEntry> ces = new ArrayList<>(1);
 			OLATResourceable ores = OresHelper.createOLATResourceableInstance("BusinessGroup", businessGroup.getKey());
 			ces.add(BusinessControlFactory.getInstance().createContextEntry(ores));
 	
@@ -367,7 +363,7 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 	
 	private void doOpenCourse(UserRequest ureq) {
 		if(courseRepoEntry != null) {
-			List<ContextEntry> ces = new ArrayList<ContextEntry>(1);
+			List<ContextEntry> ces = new ArrayList<>(1);
 			OLATResourceable ores = OresHelper.createOLATResourceableInstance("RepositoryEntry", courseRepoEntry.getKey());
 			ces.add(BusinessControlFactory.getInstance().createContextEntry(ores));
 	
@@ -378,7 +374,7 @@ public class CertificateAndEfficiencyStatementController extends BasicController
 	}
 	
 	private void doOpenHome(UserRequest ureq) {
-		List<ContextEntry> ces = new ArrayList<ContextEntry>(1);
+		List<ContextEntry> ces = new ArrayList<>(1);
 		ces.add(BusinessControlFactory.getInstance().createContextEntry(statementOwner));
 
 		BusinessControl bc = BusinessControlFactory.getInstance().createFromContextEntries(ces);
diff --git a/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java b/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java
index 3420bc9427a8901d2972ad377732b1043111cd68..e2920308fba79797c5a4d1a8e1a5880d1e04cbb2 100644
--- a/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java
+++ b/src/main/java/org/olat/course/groupsandrights/CourseGroupManager.java
@@ -31,6 +31,7 @@ import java.util.List;
 import org.olat.basesecurity.IdentityRef;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Roles;
 import org.olat.course.export.CourseEnvironmentMapper;
 import org.olat.group.BusinessGroup;
 import org.olat.group.area.BGArea;
@@ -123,6 +124,13 @@ public interface CourseGroupManager {
 	 */
 	public boolean isIdentityCourseAdministrator(Identity identity);
 	
+	/**
+	 * 
+	 * @param identity
+	 * @return
+	 */
+	public boolean isIdentityCourseLearnResourceManager(Identity identity, Roles roles);
+	
 	/**
 	 * Checks if user is course participant
 	 * 
diff --git a/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java b/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java
index 4c9374039d4a3a24403b362ad52ed60c6a58b1cd..8304d329fe95e533bae3b8582630d76e74253b91 100644
--- a/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java
+++ b/src/main/java/org/olat/course/groupsandrights/PersistingCourseGroupManager.java
@@ -37,6 +37,7 @@ import org.olat.basesecurity.OrganisationService;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.StringHelper;
@@ -76,6 +77,7 @@ public class PersistingCourseGroupManager implements CourseGroupManager {
 	
 	private final BGAreaManager areaManager;
 	private final BGRightManager rightManager;
+	private final RepositoryManager repositoryManager;
 	private final RepositoryService repositoryService;
 	private final OrganisationService organisationService;
 	private final BusinessGroupService businessGroupService;
@@ -88,6 +90,7 @@ public class PersistingCourseGroupManager implements CourseGroupManager {
 		this.courseResource = courseResource;
 		areaManager = CoreSpringFactory.getImpl(BGAreaManager.class);
 		rightManager = CoreSpringFactory.getImpl(BGRightManager.class);
+		repositoryManager = CoreSpringFactory.getImpl(RepositoryManager.class);
 		repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
 		businessGroupService = CoreSpringFactory.getImpl(BusinessGroupService.class);
@@ -98,6 +101,7 @@ public class PersistingCourseGroupManager implements CourseGroupManager {
 		this.courseResource = courseRepoEntry.getOlatResource();
 		areaManager = CoreSpringFactory.getImpl(BGAreaManager.class);
 		rightManager = CoreSpringFactory.getImpl(BGRightManager.class);
+		repositoryManager = CoreSpringFactory.getImpl(RepositoryManager.class);
 		repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
 		businessGroupService = CoreSpringFactory.getImpl(BusinessGroupService.class);
@@ -268,6 +272,11 @@ public class PersistingCourseGroupManager implements CourseGroupManager {
 		return repositoryService.hasRole(identity, getCourseEntry(), GroupRoles.owner.name());
 	}
 	
+	@Override
+	public boolean isIdentityCourseLearnResourceManager(Identity identity, Roles roles) {
+		return repositoryManager.isInstitutionalRessourceManagerFor(identity, roles, courseRepoEntry);
+	}
+
 	@Override
 	public boolean isIdentityInOrganisation(IdentityRef identity, String organisationIdentifier, OrganisationRoles... roles) {
 		return organisationService.hasRole(organisationIdentifier, identity, roles);
diff --git a/src/main/java/org/olat/course/nodes/AbstractFeedCourseNode.java b/src/main/java/org/olat/course/nodes/AbstractFeedCourseNode.java
index e2489c71bce80f498464db1a13f65ba2fc24c7b2..f9e8b81cc85b2163dd2bbfc46eb55574895f0731 100644
--- a/src/main/java/org/olat/course/nodes/AbstractFeedCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/AbstractFeedCourseNode.java
@@ -27,6 +27,7 @@ import org.olat.core.commons.services.notifications.SubscriptionContext;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.course.CourseModule;
 import org.olat.course.ICourse;
 import org.olat.course.condition.Condition;
@@ -138,19 +139,9 @@ public abstract class AbstractFeedCourseNode extends GenericCourseNode {
 		this.config = getModuleConfiguration();
 		String repoSoftkey = (String) config.get(CONFIG_KEY_REPOSITORY_SOFTKEY);
 		RepositoryManager rm = RepositoryManager.getInstance();
-		RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repoSoftkey, false);
-		return entry;
+		return rm.lookupRepositoryEntryBySoftkey(repoSoftkey, false);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#isConfigValid()
-	 */
-	@Override
-	public abstract StatusDescription isConfigValid();
-
-	/**
-	 * @see org.olat.course.nodes.CourseNode#needsReferenceToARepositoryEntry()
-	 */
 	@Override
 	public boolean needsReferenceToARepositoryEntry() {
 		return true;
@@ -251,11 +242,11 @@ public abstract class AbstractFeedCourseNode extends GenericCourseNode {
 		reie.exportDoExport();
 	}
 
-	public void importFeed(RepositoryHandler handler, File importDirectory, Identity owner, Locale locale) {
+	public void importFeed(RepositoryHandler handler, File importDirectory, Identity owner, Organisation organisation, Locale locale) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if (rie.anyExportedPropertiesAvailable()) {
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-				rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+				rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			FeedNodeEditController.setReference(re, getModuleConfiguration());
 		} else {
 			FeedNodeEditController.removeReference(getModuleConfiguration());
diff --git a/src/main/java/org/olat/course/nodes/BCCourseNode.java b/src/main/java/org/olat/course/nodes/BCCourseNode.java
index 8ecc7c80ffea374de4bd24727f2f34b8231bdef7..3617351e25070ffbfac00321991864f7ed1a7f7e 100644
--- a/src/main/java/org/olat/course/nodes/BCCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/BCCourseNode.java
@@ -43,6 +43,7 @@ import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.PackageTranslator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.IdentityEnvironment;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.StringHelper;
 import org.olat.core.util.Util;
@@ -208,8 +209,7 @@ public class BCCourseNode extends AbstractAccessableCourseNode {
 	public static OlatNamedContainerImpl getNodeFolderContainer(BCCourseNode node, CourseEnvironment courseEnv) {
 		String path = getFoldernodePathRelToFolderBase(courseEnv, node);
 		OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(path, null);
-		OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(node.getShortTitle(), rootFolder);
-		return namedFolder;
+		return new OlatNamedContainerImpl(node.getShortTitle(), rootFolder);
 	}
 	
 	public static OlatNamedContainerImpl getSecurisedNodeFolderContainer(BCCourseNode node, CourseEnvironment courseEnv, IdentityEnvironment ienv) {
@@ -236,7 +236,7 @@ public class BCCourseNode extends AbstractAccessableCourseNode {
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		// the export has copies the files under the node's ID
 		File fFolderNodeData = new File(importDirectory, this.getIdent());
 		// the whole folder can be moved back to the root direcotry of foldernodes
@@ -424,9 +424,9 @@ public class BCCourseNode extends AbstractAccessableCourseNode {
 		List<ConditionExpression> retVal;
 		List<ConditionExpression> parentsConditions = super.getConditionExpressions();
 		if (parentsConditions.size() > 0) {
-			retVal = new ArrayList<ConditionExpression>(parentsConditions);
-		}else {
-			retVal = new ArrayList<ConditionExpression>();
+			retVal = new ArrayList<>(parentsConditions);
+		} else {
+			retVal = new ArrayList<>();
 		}
 		//
 		String coS = getPreConditionDownloaders().getConditionExpression();
diff --git a/src/main/java/org/olat/course/nodes/BlogCourseNode.java b/src/main/java/org/olat/course/nodes/BlogCourseNode.java
index 7791c9a86db0fa9f000fc7bc7a7e8421058a5449..20dd644676c3091d83db02bbb2d579171cce1b9c 100644
--- a/src/main/java/org/olat/course/nodes/BlogCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/BlogCourseNode.java
@@ -30,6 +30,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.context.BusinessControlFactory;
 import org.olat.core.id.context.ContextEntry;
 import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
@@ -79,11 +80,6 @@ public class BlogCourseNode extends AbstractFeedCourseNode {
 		updateModuleConfigDefaults(true);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AbstractAccessableCourseNode#createEditController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl, org.olat.course.ICourse,
-	 *      org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public TabbableController createEditController(UserRequest ureq, WindowControl wControl,  BreadcrumbPanel stackPanel, ICourse course, UserCourseEnvironment euce) {
 		CourseNode chosenNode = course.getEditorTreeModel().getCourseNode(euce.getCourseEditorEnv().getCurrentCourseNodeId());
@@ -91,19 +87,11 @@ public class BlogCourseNode extends AbstractFeedCourseNode {
 		return new NodeEditController(ureq, wControl, course.getEditorTreeModel(), course, chosenNode, euce, blogChildController);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AbstractAccessableCourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation, java.lang.String)
-	 */
 	@Override
 	public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
 			UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
 		RepositoryEntry entry = getReferencedRepositoryEntry();
-		// create business path courseID:nodeID
-		// userCourseEnv.getCourseEnvironment().getCourseResourceableId();
-		// getIdent();
+
 		Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
 		String nodeId = this.getIdent();
 		boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
@@ -123,17 +111,9 @@ public class BlogCourseNode extends AbstractFeedCourseNode {
 		List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType(nodecmd);
 		blogCtr.activate(ureq, entries, null);
 		Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, blogCtr, this, "o_blog_icon");
-		NodeRunConstructionResult result = new NodeRunConstructionResult(wrapperCtrl);
-		return result;
-
+		return new NodeRunConstructionResult(wrapperCtrl);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#createPeekViewRunController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation)
-	 */
 	@Override
 	public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv,
 			NodeEvaluation ne) {
@@ -148,8 +128,7 @@ public class BlogCourseNode extends AbstractFeedCourseNode {
 			boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
 			FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
 			FeedUIFactory uiFactory = BlogUIFactory.getInstance(ureq.getLocale());
-			Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_blog_peekview");
-			return peekViewController;
+			return new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_blog_peekview");
 		} else {
 			// use standard peekview
 			return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
@@ -161,9 +140,6 @@ public class BlogCourseNode extends AbstractFeedCourseNode {
 		return CourseNode.DISPLAY_OPTS_CONTENT;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#isConfigValid(org.olat.course.editor.CourseEditorEnv)
-	 */
 	@Override
 	public StatusDescription[] isConfigValid(CourseEditorEnv cev) {
 		oneClickStatusCache = null;
@@ -193,10 +169,10 @@ public class BlogCourseNode extends AbstractFeedCourseNode {
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		if(withReferences) {
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(BlogFileResource.TYPE_NAME);
-			importFeed(handler, importDirectory, owner, locale);
+			importFeed(handler, importDirectory, owner, organisation, locale);
 		} else {
 			FeedNodeEditController.removeReference(getModuleConfiguration());
 		}
diff --git a/src/main/java/org/olat/course/nodes/CPCourseNode.java b/src/main/java/org/olat/course/nodes/CPCourseNode.java
index 6b641e22eaf0a8ed59d903e791f8711d4a27bc51..a8b26988db3403c197435e5216d2618c9e7a9c04 100644
--- a/src/main/java/org/olat/course/nodes/CPCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/CPCourseNode.java
@@ -37,6 +37,7 @@ import org.olat.core.gui.control.generic.iframe.DeliveryOptions;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.Util;
@@ -79,10 +80,6 @@ public class CPCourseNode extends AbstractAccessableCourseNode {
 		updateModuleConfigDefaults(true);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#createEditController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl, org.olat.course.ICourse)
-	 */
 	@Override
 	public TabbableController createEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, ICourse course, UserCourseEnvironment euce) {
 		updateModuleConfigDefaults(false);
@@ -91,12 +88,6 @@ public class CPCourseNode extends AbstractAccessableCourseNode {
 		return new NodeEditController(ureq, wControl, course.getEditorTreeModel(), course, chosenNode, euce, childTabCntrllr);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation)
-	 */
 	@Override
 	public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
 			UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
@@ -106,18 +97,11 @@ public class CPCourseNode extends AbstractAccessableCourseNode {
 		return cprunC.createNodeRunConstructionResult(ureq, null);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#createPreviewController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation)
-	 */
 	@Override
 	public Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
 		updateModuleConfigDefaults(false);
 		OLATResourceable ores = OresHelper.createOLATResourceableInstance(ICourse.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
-		CPRunController cprunC = new CPRunController(getModuleConfiguration(), ureq, wControl, this, null, ores, true);
-		return cprunC;
+		return new CPRunController(getModuleConfiguration(), ureq, wControl, this, null, ores, true);
 	}
 	
 	@Override
@@ -125,9 +109,6 @@ public class CPCourseNode extends AbstractAccessableCourseNode {
 		return CourseNode.DISPLAY_OPTS_CONTENT;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#isConfigValid()
-	 */
 	@Override
 	public StatusDescription isConfigValid() {/*
 																						 * first check the one click cache
@@ -162,15 +143,11 @@ public class CPCourseNode extends AbstractAccessableCourseNode {
 		return StatusDescriptionHelper.sort(statusDescs);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#getReferencedRepositoryEntry()
-	 */
 	@Override
 	public RepositoryEntry getReferencedRepositoryEntry() {
 		// ",false" because we do not want to be strict, but just indicate whether
 		// the reference still exists or not
-		RepositoryEntry entry = CPEditController.getCPReference(getModuleConfiguration(), false);
-		return entry;
+		return CPEditController.getCPReference(getModuleConfiguration(), false);
 	}
 
 	/**
@@ -292,12 +269,12 @@ public class CPCourseNode extends AbstractAccessableCourseNode {
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(ImsCPFileResource.TYPE_NAME);
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-					rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+					rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			CPEditController.setCPReference(re, getModuleConfiguration());
 		} else {
 			CPEditController.removeCPReference(getModuleConfiguration());
diff --git a/src/main/java/org/olat/course/nodes/CheckListCourseNode.java b/src/main/java/org/olat/course/nodes/CheckListCourseNode.java
index 40a3cb6729094ab2fc34ad24fbf8c88516ced498..335ba8241a2d7f7abd148aa4e902eec5d8dcf834 100644
--- a/src/main/java/org/olat/course/nodes/CheckListCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/CheckListCourseNode.java
@@ -43,6 +43,7 @@ import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.IdentityEnvironment;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLATRuntimeException;
 import org.olat.core.util.FileUtils;
@@ -538,11 +539,6 @@ public class CheckListCourseNode extends AbstractAccessableCourseNode implements
 		am.updateLastModifications(this, assessedIdentity, userCourseEnvironment, by);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getDetailsEditController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public Controller getDetailsEditController(UserRequest ureq, WindowControl wControl,
 			BreadcrumbPanel stackPanel, UserCourseEnvironment coachCourseEnv, UserCourseEnvironment assessedUserCourseEnv) {
@@ -559,26 +555,17 @@ public class CheckListCourseNode extends AbstractAccessableCourseNode implements
 		return new IdentityListCourseNodeController(ureq, wControl, stackPanel,
 				courseEntry, group, this, coachCourseEnv, toolContainer, assessmentCallback);
 	}
-	
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getDetailsListView(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
+
 	@Override
 	public String getDetailsListView(UserCourseEnvironment userCourseEnvironment) {
 		return null;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getDetailsListViewHeaderKey()
-	 */
 	@Override
 	public String getDetailsListViewHeaderKey() {
 		return null;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#hasDetails()
-	 */
 	@Override
 	public boolean hasDetails() {
 		return true;
@@ -668,7 +655,7 @@ public class CheckListCourseNode extends AbstractAccessableCourseNode implements
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		CheckboxManager checkboxManager = CoreSpringFactory.getImpl(CheckboxManager.class);
 		ModuleConfiguration config = getModuleConfiguration();
 		CheckboxList list = (CheckboxList)config.get(CONFIG_KEY_CHECKBOX);
diff --git a/src/main/java/org/olat/course/nodes/CourseNode.java b/src/main/java/org/olat/course/nodes/CourseNode.java
index e07dd0ad6e47ca7d88bafe4fe3e5a5abccb612e7..664ea2a7ef731605a5a762f6c026c423b3546f49 100644
--- a/src/main/java/org/olat/course/nodes/CourseNode.java
+++ b/src/main/java/org/olat/course/nodes/CourseNode.java
@@ -37,6 +37,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.nodes.INode;
 import org.olat.course.ICourse;
 import org.olat.course.condition.Condition;
@@ -359,7 +360,7 @@ public interface CourseNode extends INode, ShortName {
 	 * @return Controller for user driven import, or null after all import tasks
 	 *         have finished.
 	 */
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences);
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences);
 	
 	/**
 	 * Remap the node to the context of the course after import.
diff --git a/src/main/java/org/olat/course/nodes/GTACourseNode.java b/src/main/java/org/olat/course/nodes/GTACourseNode.java
index b3599f4af6175da73c2cd3102f5385d91f7789a5..f1eca544712e8d8d48f81ded09f37495af6be53e 100644
--- a/src/main/java/org/olat/course/nodes/GTACourseNode.java
+++ b/src/main/java/org/olat/course/nodes/GTACourseNode.java
@@ -45,6 +45,7 @@ import org.olat.core.gui.control.generic.messages.MessageUIFactory;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLATRuntimeException;
 import org.olat.core.logging.OLog;
@@ -403,7 +404,7 @@ public class GTACourseNode extends AbstractAccessableCourseNode implements Persi
 	}
 	
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		File fNodeImportDir = new File(importDirectory, getIdent());
 		GTAManager gtaManager = CoreSpringFactory.getImpl(GTAManager.class);
 		
diff --git a/src/main/java/org/olat/course/nodes/GenericCourseNode.java b/src/main/java/org/olat/course/nodes/GenericCourseNode.java
index 9d417bb3af25d71cdb647c56f9f253b2ff328980..23dce10d9ffd6cce55df16ecb285c2b79f799347 100644
--- a/src/main/java/org/olat/course/nodes/GenericCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/GenericCourseNode.java
@@ -40,6 +40,7 @@ import org.olat.core.gui.control.generic.messages.MessageUIFactory;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.CodeHelper;
 import org.olat.core.util.StringHelper;
 import org.olat.core.util.Util;
@@ -413,10 +414,6 @@ public abstract class GenericCourseNode extends GenericNode implements CourseNod
 		return true;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#exportNode(java.io.File,
-	 *      org.olat.course.ICourse)
-	 */
 	@Override
 	public void exportNode(File exportDirectory, ICourse course) {
 	// nothing to do in default implementation
@@ -424,12 +421,9 @@ public abstract class GenericCourseNode extends GenericNode implements CourseNod
 
 	/**
 	 * Implemented by specialized node
-	 * @see org.olat.course.nodes.CourseNode#importNode(java.io.File,
-	 *      org.olat.course.ICourse, org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl, boolean)
 	 */
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		// nothing to do in default implementation
 	}
 
diff --git a/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java b/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java
index 89f9a049d0b7079f679f8d9f1d8219cd9550ebe0..ca913615cebd14b8d917517437fdbd44146de86e 100644
--- a/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/IQSELFCourseNode.java
@@ -43,6 +43,7 @@ import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.PackageTranslator;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.Util;
@@ -310,7 +311,7 @@ public class IQSELFCourseNode extends AbstractAccessableCourseNode implements Se
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
 			File file = rie.importGetExportedFile();
@@ -319,12 +320,12 @@ public class IQSELFCourseNode extends AbstractAccessableCourseNode implements Se
 			RepositoryEntry re;
 			if(handlerQTI21.acceptImport(file, "repo.zip").isValid()) {
 				re = handlerQTI21.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-						rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+						rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 				getModuleConfiguration().set(IQEditController.CONFIG_KEY_TYPE_QTI, IQEditController.CONFIG_VALUE_QTI21);
 			} else {
 				RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(TestFileResource.TYPE_NAME);
 				re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-					rie.getDescription(), false, locale, file, null);
+					rie.getDescription(), false, organisation, locale, file, null);
 			}
 			IQEditController.setIQReference(re, getModuleConfiguration());
 		} else {
diff --git a/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java b/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java
index 3251ff2431168e563f9f1ea117ab1bea9cfd44df..12d17e47104f545b5006c032fbcbad3241d07cad 100644
--- a/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/IQSURVCourseNode.java
@@ -42,6 +42,7 @@ import org.olat.core.gui.translator.PackageTranslator;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -341,12 +342,12 @@ public class IQSURVCourseNode extends AbstractAccessableCourseNode implements QT
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(SurveyFileResource.TYPE_NAME);
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-				rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+				rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			IQEditController.setIQReference(re, getModuleConfiguration());
 		} else {
 			IQEditController.removeIQReference(getModuleConfiguration());
diff --git a/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java b/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java
index ac00486f636fa4bdae866ddafdc98f4ceb93e992..06dc2c331e75cc7029da9828e9d57587328bce21 100644
--- a/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/IQTESTCourseNode.java
@@ -45,6 +45,7 @@ import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.DBRuntimeException;
 import org.olat.core.logging.KnownIssueException;
@@ -104,6 +105,7 @@ import org.olat.ims.qti21.QTI21Service;
 import org.olat.ims.qti21.manager.AssessmentTestSessionDAO;
 import org.olat.ims.qti21.manager.archive.QTI21ArchiveFormat;
 import org.olat.ims.qti21.model.QTI21StatisticSearchParams;
+import org.olat.ims.qti21.model.xml.QtiNodesExtractor;
 import org.olat.ims.qti21.resultexport.QTI21ResultsExportMediaResource;
 import org.olat.ims.qti21.ui.QTI21AssessmentDetailsController;
 import org.olat.ims.qti21.ui.statistics.QTI21StatisticResourceResult;
@@ -145,10 +147,6 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 		updateModuleConfigDefaults(true);
 	}
 	
-	/**
-	 * @see org.olat.course.nodes.CourseNode#createEditController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl, org.olat.course.ICourse)
-	 */
 	@Override
 	public TabbableController createEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, ICourse course, UserCourseEnvironment euce) {
 		updateModuleConfigDefaults(false);
@@ -229,11 +227,8 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 			if(!configRef && config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1) > 0) {
 				timeLimit = true;
 			} else {
-				File unzippedDirRoot = FileResourceManager.getInstance().unzipFileResource(testEntry.getOlatResource());
-				ResolvedAssessmentTest resolvedAssessmentTest = CoreSpringFactory.getImpl(QTI21Service.class)
-						.loadAndResolveAssessmentTest(unzippedDirRoot, false, false);
-				AssessmentTest assessmentTest = resolvedAssessmentTest.getRootNodeLookup().extractIfSuccessful();
-				if(assessmentTest.getTimeLimits() != null && assessmentTest.getTimeLimits().getMaximum() != null) {
+				AssessmentTest assessmentTest = loadAssessmentTest(testEntry);
+				if(assessmentTest != null && assessmentTest.getTimeLimits() != null && assessmentTest.getTimeLimits().getMaximum() != null) {
 					timeLimit = true;
 				}
 			}
@@ -257,17 +252,30 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 			if(!configRef && config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1) > 0) {
 				timeLimit = config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1);
 			} else {
-				File unzippedDirRoot = FileResourceManager.getInstance().unzipFileResource(testEntry.getOlatResource());
-				ResolvedAssessmentTest resolvedAssessmentTest = CoreSpringFactory.getImpl(QTI21Service.class)
-						.loadAndResolveAssessmentTest(unzippedDirRoot, false, false);
-				AssessmentTest assessmentTest = resolvedAssessmentTest.getRootNodeLookup().extractIfSuccessful();
-				if(assessmentTest.getTimeLimits() != null && assessmentTest.getTimeLimits().getMaximum() != null) {
+				AssessmentTest assessmentTest = loadAssessmentTest(testEntry);
+				if(assessmentTest != null && assessmentTest.getTimeLimits() != null && assessmentTest.getTimeLimits().getMaximum() != null) {
 					timeLimit = assessmentTest.getTimeLimits().getMaximum().intValue();
 				}
 			}
 		}
 		return timeLimit;
 	}
+	
+	/**
+	 * 
+	 * @return
+	 */
+	public AssessmentTest loadAssessmentTest(RepositoryEntry testEntry) {
+		if(testEntry == null) return null;
+		
+		File unzippedDirRoot = FileResourceManager.getInstance().unzipFileResource(testEntry.getOlatResource());
+		ResolvedAssessmentTest resolvedAssessmentTest = CoreSpringFactory.getImpl(QTI21Service.class)
+				.loadAndResolveAssessmentTest(unzippedDirRoot, false, false);
+		if(resolvedAssessmentTest != null) {
+			return resolvedAssessmentTest.getRootNodeLookup().extractIfSuccessful();
+		}
+		return null;
+	}
 
 	/**
 	 * @see org.olat.course.nodes.CourseNode#createPreviewController(org.olat.core.gui.UserRequest,
@@ -429,36 +437,72 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 		return false;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
-	 */
 	@Override
 	public Float getCutValueConfiguration() {
-		ModuleConfiguration config = this.getModuleConfiguration();
-		return (Float) config.get(IQEditController.CONFIG_KEY_CUTVALUE);
+		Float cutValue = null;
+		
+		ModuleConfiguration config = getModuleConfiguration();
+		// for onyx and QTI 1.2
+		if (IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI))
+				|| IQEditController.CONFIG_VALUE_QTI1.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI))) {
+			cutValue = (Float) config.get(IQEditController.CONFIG_KEY_CUTVALUE);
+		} else {
+			RepositoryEntry testEntry = getReferencedRepositoryEntry();
+			AssessmentTest assessmentTest = loadAssessmentTest(testEntry);
+			if(assessmentTest != null) {
+				Double cut = QtiNodesExtractor.extractCutValue(assessmentTest);
+				if(cut != null) {
+					cutValue = Float.valueOf(cut.floatValue());
+				}
+			}
+		}
+		return cutValue;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
-	 */
 	@Override
 	public Float getMaxScoreConfiguration() {
-		ModuleConfiguration config = this.getModuleConfiguration();
-		return (Float) config.get(IQEditController.CONFIG_KEY_MAXSCORE);
+		Float maxScore = null;
+
+		ModuleConfiguration config = getModuleConfiguration();
+		// for onyx and QTI 1.2
+		if (IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI))
+				|| IQEditController.CONFIG_VALUE_QTI1.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI))) {
+			maxScore = (Float) config.get(IQEditController.CONFIG_KEY_MAXSCORE);
+		} else {
+			RepositoryEntry testEntry = getReferencedRepositoryEntry();
+			AssessmentTest assessmentTest = loadAssessmentTest(testEntry);
+			if(assessmentTest != null) {
+				Double max = QtiNodesExtractor.extractMaxScore(assessmentTest);
+				if(max != null) {
+					maxScore = Float.valueOf(max.floatValue());
+				}
+			}
+		}
+		
+		return maxScore;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
-	 */
 	@Override
 	public Float getMinScoreConfiguration() {
-		ModuleConfiguration config = this.getModuleConfiguration();
-		return (Float) config.get(IQEditController.CONFIG_KEY_MINSCORE);
+		Float minScore = null;
+		ModuleConfiguration config = getModuleConfiguration();
+		// for onyx and QTI 1.2
+		if (IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI))
+				|| IQEditController.CONFIG_VALUE_QTI1.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI))) {
+			minScore = (Float) config.get(IQEditController.CONFIG_KEY_MINSCORE);
+		} else {
+			RepositoryEntry testEntry = getReferencedRepositoryEntry();
+			AssessmentTest assessmentTest = loadAssessmentTest(testEntry);
+			if(assessmentTest != null) {
+				Double min = QtiNodesExtractor.extractMinScore(assessmentTest);
+				if(min != null) {
+					minScore = Float.valueOf(min.floatValue());
+				}
+			}
+		}
+		return minScore;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#hasCommentConfigured()
-	 */
 	@Override
 	public boolean hasCommentConfigured() {
 		// coach should be able to add comments here, visible to users
@@ -721,7 +765,7 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
 			File file = rie.importGetExportedFile();
@@ -730,13 +774,13 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 			RepositoryEntry re;
 			if(handlerQTI21.acceptImport(file, "repo.zip").isValid()) {
 				re = handlerQTI21.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-						rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+						rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 
 				getModuleConfiguration().set(IQEditController.CONFIG_KEY_TYPE_QTI, IQEditController.CONFIG_VALUE_QTI21);
 			} else {
 				RepositoryHandler handlerQTI = RepositoryHandlerFactory.getInstance().getRepositoryHandler(TestFileResource.TYPE_NAME);
 				re = handlerQTI.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-						rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+						rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			}
 			IQEditController.setIQReference(re, getModuleConfiguration());
 		} else {
@@ -744,9 +788,6 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 		}
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserAttempts(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public Integer getUserAttempts(UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
@@ -754,19 +795,11 @@ public class IQTESTCourseNode extends AbstractAccessableCourseNode implements Pe
 		return am.getNodeAttempts(this, mySelf);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#hasAttemptsConfigured()
-	 */
 	@Override
 	public boolean hasAttemptsConfigured() {
 		return true;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#updateUserAttempts(java.lang.Integer,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.core.id.Identity)
-	 */
 	@Override
 	public void updateUserAttempts(Integer userAttempts, UserCourseEnvironment userCourseEnvironment, Identity coachingIdentity, Role by) {
 		if (userAttempts != null) {
diff --git a/src/main/java/org/olat/course/nodes/PodcastCourseNode.java b/src/main/java/org/olat/course/nodes/PodcastCourseNode.java
index 2b4c8000e96be1e396e295d2c42986ad43d753c0..88237f18e7dfbdb8dea665a7f5499c834ef0f671 100644
--- a/src/main/java/org/olat/course/nodes/PodcastCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/PodcastCourseNode.java
@@ -30,6 +30,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.context.BusinessControlFactory;
 import org.olat.core.id.context.ContextEntry;
 import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
@@ -79,11 +80,6 @@ public class PodcastCourseNode extends AbstractFeedCourseNode {
 		updateModuleConfigDefaults(true);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AbstractAccessableCourseNode#createEditController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl, org.olat.course.ICourse,
-	 *      org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public TabbableController createEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, ICourse course, UserCourseEnvironment euce) {
 		CourseNode chosenNode = course.getEditorTreeModel().getCourseNode(euce.getCourseEditorEnv().getCurrentCourseNodeId());
@@ -91,19 +87,10 @@ public class PodcastCourseNode extends AbstractFeedCourseNode {
 		return new NodeEditController(ureq, wControl, course.getEditorTreeModel(), course, chosenNode, euce, podcastChildController);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AbstractAccessableCourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation, java.lang.String)
-	 */
 	@Override
 	public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl control,
 			UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
 		RepositoryEntry entry = getReferencedRepositoryEntry();
-		// create business path courseID:nodeID
-		// userCourseEnv.getCourseEnvironment().getCourseResourceableId();
-		// getIdent();
 		Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
 		String nodeId = this.getIdent();
 		boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
@@ -123,16 +110,9 @@ public class PodcastCourseNode extends AbstractFeedCourseNode {
 		List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType(nodecmd);
 		podcastCtr.activate(ureq, entries, null);
 		Controller wrapperCtrl = TitledWrapperHelper.getWrapper(ureq, control, podcastCtr, this, "o_podcast_icon");
-		NodeRunConstructionResult result = new NodeRunConstructionResult(wrapperCtrl);
-		return result;
+		return new NodeRunConstructionResult(wrapperCtrl);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#createPeekViewRunController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation)
-	 */
 	@Override
 	public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv,
 			NodeEvaluation ne) {
@@ -143,12 +123,10 @@ public class PodcastCourseNode extends AbstractFeedCourseNode {
 			String nodeId = this.getIdent();
 			boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
 			boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
-			//fxdiff BAKS-18
 			boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
 			FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
 			FeedUIFactory uiFactory = PodcastUIFactory.getInstance(ureq.getLocale());
-			Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_podcast_peekview");
-			return peekViewController;
+			return new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_podcast_peekview");
 		} else {
 			// use standard peekview
 			return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
@@ -159,10 +137,7 @@ public class PodcastCourseNode extends AbstractFeedCourseNode {
 	protected String getDefaultTitleOption() {
 		return CourseNode.DISPLAY_OPTS_CONTENT;
 	}
-	
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#isConfigValid(org.olat.course.editor.CourseEditorEnv)
-	 */
+
 	@Override
 	public StatusDescription[] isConfigValid(CourseEditorEnv cev) {
 		oneClickStatusCache = null;
@@ -192,10 +167,10 @@ public class PodcastCourseNode extends AbstractFeedCourseNode {
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		if(withReferences) {
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(PodcastFileResource.TYPE_NAME);
-			importFeed(handler, importDirectory, owner, locale);
+			importFeed(handler, importDirectory, owner, organisation, locale);
 		} else {
 			FeedNodeEditController.removeReference(getModuleConfiguration());
 		}
diff --git a/src/main/java/org/olat/course/nodes/PortfolioCourseNode.java b/src/main/java/org/olat/course/nodes/PortfolioCourseNode.java
index fb583f15ca300f70cf5da9fff06e00581906ecf6..c9cfe318c74179f5595907dfdae2350dcaede267 100644
--- a/src/main/java/org/olat/course/nodes/PortfolioCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/PortfolioCourseNode.java
@@ -36,6 +36,7 @@ import org.olat.core.gui.control.generic.messages.MessageUIFactory;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLATRuntimeException;
 import org.olat.core.logging.OLog;
@@ -577,13 +578,13 @@ public class PortfolioCourseNode extends AbstractAccessableCourseNode implements
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if (withReferences && rie.anyExportedPropertiesAvailable()) {
 
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(EPTemplateMapResource.TYPE_NAME);
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-					rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+					rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			if(re != null) {
 				EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
 				PortfolioStructure map = ePFMgr.loadPortfolioStructure(re.getOlatResource());
diff --git a/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java b/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java
index e5b322793564f8988f09bca31a1da784fee590b0..6d57fdb66d91879063c302226c5ab14110b53266 100644
--- a/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/ProjectBrokerCourseNode.java
@@ -56,6 +56,7 @@ import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.PackageTranslator;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.context.BusinessControl;
 import org.olat.core.id.context.BusinessControlFactory;
@@ -875,8 +876,8 @@ public class ProjectBrokerCourseNode extends GenericCourseNode implements Persis
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
-		super.importNode(importDirectory, course, owner, locale, withReferences);
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
+		super.importNode(importDirectory, course, owner, organisation, locale, withReferences);
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/course/nodes/ScormCourseNode.java b/src/main/java/org/olat/course/nodes/ScormCourseNode.java
index faea014f59001c83530842cad5d176747ffc4848..c8cabc336864b2d04769a4eaacd00102719e8c32 100644
--- a/src/main/java/org/olat/course/nodes/ScormCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/ScormCourseNode.java
@@ -43,6 +43,7 @@ import org.olat.core.gui.control.generic.iframe.DeliveryOptions;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLATRuntimeException;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -137,12 +138,6 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		return new NodeRunConstructionResult(ctrl);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#createPreviewController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation)
-	 */
 	@Override
 	public Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
 		updateModuleConfigDefaults(false);
@@ -158,9 +153,6 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 				courseEntry, group, this, coachCourseEnv, toolContainer, assessmentCallback);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#isConfigValid()
-	 */
 	@Override
 	public StatusDescription isConfigValid() {
 		/*
@@ -197,24 +189,17 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		return oneClickStatusCache;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#getReferencedRepositoryEntry()
-	 */
 	@Override
 	public RepositoryEntry getReferencedRepositoryEntry() {
 		// ",false" because we do not want to be strict, but just indicate whether
 		// the reference still exists or not
-		RepositoryEntry entry = CPEditController.getCPReference(getModuleConfiguration(), false);
-		return entry;
+		return CPEditController.getCPReference(getModuleConfiguration(), false);
 	}
 	
 	public String getReferencedRepositoryEntrySoftkey() {
 		return (String)getModuleConfiguration().get(CPEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#needsReferenceToARepositoryEntry()
-	 */
 	@Override
 	public boolean needsReferenceToARepositoryEntry() {
 		return true;
@@ -356,12 +341,12 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(ScormCPFileResource.TYPE_NAME);
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-				rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+				rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			ScormEditController.setScormCPReference(re, getModuleConfiguration());
 		} else {
 			CPEditController.removeCPReference(getModuleConfiguration());
@@ -378,7 +363,7 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		String results = ScormExportManager.getInstance().getResults(course.getCourseEnvironment(), this, trans);
 		try {
 			exportStream.putNextEntry(new ZipEntry(fileName));
-			IOUtils.write(results, exportStream);
+			IOUtils.write(results, exportStream, "UTF-8");
 			exportStream.closeEntry();
 		} catch (IOException e) {
 			log.error("", e);
@@ -408,32 +393,23 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		return false;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
-	 */
 	@Override
 	public Float getCutValueConfiguration() {
 		ModuleConfiguration config = this.getModuleConfiguration();
 		int cutValue = config.getIntegerSafe(ScormEditController.CONFIG_CUTVALUE, 0); 
-		return new Float(new Integer(cutValue).floatValue());
+		return Float.valueOf(cutValue);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
-	 */
 	@Override
 	public Float getMaxScoreConfiguration() {
 		// According to SCORM Standard, SCORE is between 0 and 100.
-		return new Float(100);
+		return Float.valueOf(100);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
-	 */
 	@Override
 	public Float getMinScoreConfiguration() {
 		// According to SCORM Standard, SCORE is between 0 and 100.
-		return new Float(0);
+		return Float.valueOf(0);
 	}
 
 	/**
@@ -544,20 +520,13 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		}
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserCoachComment(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getUserCoachComment(UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
 		Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
-		String coachCommentValue = am.getNodeCoachComment(this, mySelf);
-		return coachCommentValue;
+		return am.getNodeCoachComment(this, mySelf);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserUserComment(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getUserUserComment(UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
@@ -571,42 +540,25 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		return am.getIndividualAssessmentDocuments(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserLog(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getUserLog(UserCourseEnvironment userCourseEnvironment) {
 		UserNodeAuditManager am = userCourseEnvironment.getCourseEnvironment().getAuditManager();
 		Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
-		String logValue = am.getUserNodeLog(this, mySelf);
-		return logValue;
+		return am.getUserNodeLog(this, mySelf);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserAttempts(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public Integer getUserAttempts(UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
 		Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
-		Integer userAttemptsValue = am.getNodeAttempts(this, mySelf);
-		return userAttemptsValue;
-
+		return am.getNodeAttempts(this, mySelf);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#hasAttemptsConfigured()
-	 */
 	@Override
 	public boolean hasAttemptsConfigured() {
 		return getModuleConfiguration().getBooleanSafe(ScormEditController.CONFIG_ISASSESSABLE, true);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#updateUserAttempts(java.lang.Integer,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.core.id.Identity)
-	 */
 	@Override
 	public void updateUserAttempts(Integer userAttempts, UserCourseEnvironment userCourseEnvironment, Identity coachingIdentity, Role by) {
 		if (userAttempts != null) {
@@ -616,9 +568,6 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		}
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#incrementUserAttempts(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public void incrementUserAttempts(UserCourseEnvironment userCourseEnvironment, Role by) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
@@ -649,44 +598,27 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Per
 		am.updateLastModifications(this, assessedIdentity, userCourseEnvironment, by);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getDetailsEditController(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public Controller getDetailsEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel,
 			UserCourseEnvironment coachCourseEnv, UserCourseEnvironment assessedUserCourseEnv) {
 		return new ScormResultDetailsController(ureq, wControl, this, coachCourseEnv, assessedUserCourseEnv);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getDetailsListView(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getDetailsListView(UserCourseEnvironment userCourseEnvironment) {
 		return null;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getDetailsListViewHeaderKey()
-	 */
 	@Override
 	public String getDetailsListViewHeaderKey() {
 		return null;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#hasDetails()
-	 */
 	@Override
 	public boolean hasDetails() {
 		return getModuleConfiguration().getBooleanSafe(ScormEditController.CONFIG_ISASSESSABLE, true);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#cleanupOnDelete(org.olat.course.ICourse)
-	 */
 	@Override
 	public void cleanupOnDelete(ICourse course) {
 		super.cleanupOnDelete(course);
diff --git a/src/main/java/org/olat/course/nodes/TACourseNode.java b/src/main/java/org/olat/course/nodes/TACourseNode.java
index 7b1b79fc9efd4a19e1c6e89c81fee978dc4e7e78..768401bd7af4f99648b782605b5aa1b48345dccf 100644
--- a/src/main/java/org/olat/course/nodes/TACourseNode.java
+++ b/src/main/java/org/olat/course/nodes/TACourseNode.java
@@ -53,6 +53,7 @@ import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.gui.translator.PackageTranslator;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLATRuntimeException;
 import org.olat.core.logging.OLog;
@@ -570,60 +571,38 @@ public class TACourseNode extends GenericCourseNode implements PersistentAssessa
 		return false;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#hasStatusConfigured()
-	 */
 	@Override
 	public boolean hasStatusConfigured() {
 		return true; // Task Course node has always a status-field
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
-	 */
 	@Override
 	public Float getMaxScoreConfiguration() {
 		if (!hasScoreConfigured()) { throw new OLATRuntimeException(TACourseNode.class, "getMaxScore not defined when hasScore set to false", null); }
 		ModuleConfiguration config = getModuleConfiguration();
-		Float max = (Float) config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
-		return max;
+		return (Float) config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
-	 */
 	@Override
 	public Float getMinScoreConfiguration() {
 		if (!hasScoreConfigured()) { throw new OLATRuntimeException(TACourseNode.class, "getMinScore not defined when hasScore set to false", null); }
 		ModuleConfiguration config = getModuleConfiguration();
-		Float min = (Float) config.get(MSCourseNode.CONFIG_KEY_SCORE_MIN);
-		return min;
+		return (Float) config.get(MSCourseNode.CONFIG_KEY_SCORE_MIN);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
-	 */
 	@Override
 	public Float getCutValueConfiguration() {
 		if (!hasPassedConfigured()) { throw new OLATRuntimeException(TACourseNode.class, "getCutValue not defined when hasPassed set to false", null); }
 		ModuleConfiguration config = getModuleConfiguration();
-		Float cut = (Float) config.get(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE);
-		return cut;
+		return (Float) config.get(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserCoachComment(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getUserCoachComment(UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
-		String coachCommentValue = am.getNodeCoachComment(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
-		return coachCommentValue;
+		return am.getNodeCoachComment(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserUserComment(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getUserUserComment(UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
@@ -635,29 +614,18 @@ public class TACourseNode extends GenericCourseNode implements PersistentAssessa
 		return Collections.emptyList();
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#getUserLog(org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public String getUserLog(UserCourseEnvironment userCourseEnvironment) {
 		UserNodeAuditManager am = userCourseEnvironment.getCourseEnvironment().getAuditManager();
-		String logValue = am.getUserNodeLog(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
-		return logValue;
+		return am.getUserNodeLog(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#isEditableConfigured()
-	 */
 	@Override
 	public boolean isEditableConfigured() {
 		// always true
 		return true;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#updateUserCoachComment(java.lang.String,
-	 *      org.olat.course.run.userview.UserCourseEnvironment)
-	 */
 	@Override
 	public void updateUserCoachComment(String coachComment, UserCourseEnvironment userCourseEnvironment) {
 		AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
@@ -667,11 +635,6 @@ public class TACourseNode extends GenericCourseNode implements PersistentAssessa
 		}
 	}
 
-	/**
-	 * @see org.olat.course.nodes.AssessableCourseNode#updateUserScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.core.id.Identity)
-	 */
 	@Override
 	public void updateUserScoreEvaluation(ScoreEvaluation scoreEval, UserCourseEnvironment userCourseEnvironment,
 			Identity coachingIdentity, boolean incrementAttempts, Role by) {
@@ -856,13 +819,9 @@ public class TACourseNode extends GenericCourseNode implements PersistentAssessa
 		FileUtils.copyDirContentsToDir(fSolutionDir, fSolExportDir, false, "export task course node solutions");
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#importNode(java.io.File,
-	 *      org.olat.course.ICourse, org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl, boolean)
-	 */
+
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		//import tasks
 		File fNodeImportDir = new File(importDirectory, getIdent());
 		File fTaskfolderDir = new File(FolderConfig.getCanonicalRoot() + getTaskFolderPathRelToFolderRoot(course, this));
@@ -1044,17 +1003,14 @@ public class TACourseNode extends GenericCourseNode implements PersistentAssessa
 		return getDropBoxPathRelToFolderRoot(course.getCourseEnvironment(), cNode);
 	}
 
-	/**
-	 * @see org.olat.course.nodes.GenericCourseNode#getConditionExpressions()
-	 */
 	@Override
 	public List<ConditionExpression> getConditionExpressions() {
 		List<ConditionExpression> retVal;
 		List<ConditionExpression> parentsConditions = super.getConditionExpressions();
 		if (parentsConditions.size() > 0) {
-			retVal = new ArrayList<ConditionExpression>(parentsConditions);
+			retVal = new ArrayList<>(parentsConditions);
 		} else {
-			retVal = new ArrayList<ConditionExpression>();
+			retVal = new ArrayList<>();
 		}
 		//
 		String coS = getConditionDrop().getConditionExpression();
@@ -1094,17 +1050,10 @@ public class TACourseNode extends GenericCourseNode implements PersistentAssessa
 		return retVal;
 	}
 
-	/**
-	 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl,
-	 *      org.olat.course.run.userview.UserCourseEnvironment,
-	 *      org.olat.course.run.userview.NodeEvaluation)
-	 */
 	public static OlatNamedContainerImpl getNodeFolderContainer(TACourseNode node, CourseEnvironment courseEnvironment) {
 		String path = getFoldernodePathRelToFolderBase(courseEnvironment, node);
 		OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(path, null);
-		OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(TACourseNode.SOLUTION_FOLDER_NAME, rootFolder);
-		return namedFolder;
+		return new OlatNamedContainerImpl(TACourseNode.SOLUTION_FOLDER_NAME, rootFolder);
 	}
 
 	/**
diff --git a/src/main/java/org/olat/course/nodes/VideoCourseNode.java b/src/main/java/org/olat/course/nodes/VideoCourseNode.java
index 4fc9e538f639b14d281304a170793889fcc1a102..2381044205c48d45e4ca89e3912c2d7cc10faa6e 100644
--- a/src/main/java/org/olat/course/nodes/VideoCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/VideoCourseNode.java
@@ -30,6 +30,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.Util;
 import org.olat.course.ICourse;
 import org.olat.course.condition.ConditionEditController;
@@ -74,8 +75,7 @@ public class VideoCourseNode extends AbstractAccessableCourseNode {
 
 	@Override
 	public RepositoryEntry getReferencedRepositoryEntry() {
-		RepositoryEntry entry = VideoEditController.getVideoReference(getModuleConfiguration(), false);
-		return entry;
+		return VideoEditController.getVideoReference(getModuleConfiguration(), false);
 	}
 
 	@Override
@@ -88,11 +88,9 @@ public class VideoCourseNode extends AbstractAccessableCourseNode {
 			UserRequest ureq, WindowControl wControl,
 			UserCourseEnvironment userCourseEnv, NodeEvaluation ne,
 			String nodecmd) {
-		NodeRunConstructionResult ncr;
 		updateModuleConfigDefaults(false);
 		VideoRunController cprunC = new VideoRunController(getModuleConfiguration(), wControl, ureq, userCourseEnv, this);
-		ncr = cprunC.createNodeRunConstructionResult(ureq);
-		return ncr;
+		return cprunC.createNodeRunConstructionResult(ureq);
 	}
 
 	@Override
@@ -135,13 +133,12 @@ public class VideoCourseNode extends AbstractAccessableCourseNode {
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
-			//TODO: test
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(VideoFileResource.TYPE_NAME);
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-					rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+					rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			VideoEditController.setVideoReference(re, getModuleConfiguration());
 		} else {
 			VideoEditController.removeVideoReference(getModuleConfiguration());
@@ -151,10 +148,9 @@ public class VideoCourseNode extends AbstractAccessableCourseNode {
 	@Override
 	public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl,
 			UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
-		Controller controller = new VideoPeekviewController(ureq, wControl,
+		return new VideoPeekviewController(ureq, wControl,
 				getReferencedRepositoryEntry().getOlatResource(),
 				userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getKey(),
 				getIdent());
-		return controller;
 	}
 }
diff --git a/src/main/java/org/olat/course/nodes/ViteroCourseNode.java b/src/main/java/org/olat/course/nodes/ViteroCourseNode.java
index 43fbf075559827e29af995865a608dfa233442f8..dcd732e98107a22a245880a988fc8c1e08496068 100644
--- a/src/main/java/org/olat/course/nodes/ViteroCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/ViteroCourseNode.java
@@ -107,14 +107,14 @@ public class ViteroCourseNode extends AbstractAccessableCourseNode {
 			boolean moderator = roles.isOLATAdmin();
 			Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
 			if (!moderator) {
-				if(roles.isInstitutionalResourceManager() | roles.isAuthor()) {
+				if(roles.isLearnResourceManager() || roles.isAuthor()) {
 					RepositoryManager rm = RepositoryManager.getInstance();
 					ICourse course = CourseFactory.loadCourse(key);
 					RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 					if (re != null) {
 						moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
 						if(!moderator) {
-							moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
+							moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), roles, re);
 						}
 					}
 				}
diff --git a/src/main/java/org/olat/course/nodes/WikiCourseNode.java b/src/main/java/org/olat/course/nodes/WikiCourseNode.java
index 216e478953e589f91a1e8d924d9a80f3ad1a2bce..1d94c763b24ddb46a980db093b60393a16e08a4c 100644
--- a/src/main/java/org/olat/course/nodes/WikiCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/WikiCourseNode.java
@@ -43,6 +43,7 @@ import org.olat.core.gui.control.generic.messages.MessageUIFactory;
 import org.olat.core.gui.control.generic.tabbable.TabbableController;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.Formatter;
@@ -173,8 +174,7 @@ public class WikiCourseNode extends AbstractAccessableCourseNode {
 	public RepositoryEntry getReferencedRepositoryEntry() {
 		//"false" because we do not want to be strict, but just indicate whether
 		// the reference still exists or not
-		RepositoryEntry entry = WikiEditController.getWikiReference(getModuleConfiguration(), false);
-		return entry;
+		return WikiEditController.getWikiReference(getModuleConfiguration(), false);
 	}
 
 	@Override
@@ -194,12 +194,12 @@ public class WikiCourseNode extends AbstractAccessableCourseNode {
 	}
 
 	@Override
-	public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
+	public void importNode(File importDirectory, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
 		RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
 		if(withReferences && rie.anyExportedPropertiesAvailable()) {
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(WikiResource.TYPE_NAME);
 			RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(),
-				rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
+				rie.getDescription(), false, organisation, locale, rie.importGetExportedFile(), null);
 			WikiEditController.setWikiRepoReference(re, getModuleConfiguration());
 		} else {
 			WikiEditController.removeWikiReference(getModuleConfiguration());
diff --git a/src/main/java/org/olat/course/nodes/iq/IQConfigurationController.java b/src/main/java/org/olat/course/nodes/iq/IQConfigurationController.java
index 001f0ec7fc7aec9b013865aa19c1ea09a2e71a32..c5e9635ebf4e5a9366c2c7fbcae31198af89f164 100644
--- a/src/main/java/org/olat/course/nodes/iq/IQConfigurationController.java
+++ b/src/main/java/org/olat/course/nodes/iq/IQConfigurationController.java
@@ -111,7 +111,6 @@ public class IQConfigurationController extends BasicController {
 	
 	private String type;
 	private ICourse course;
-	private List<Identity> learners;
 	private ModuleConfiguration moduleConfiguration;
 	private AbstractAccessableCourseNode courseNode;
 
@@ -496,7 +495,7 @@ public class IQConfigurationController extends BasicController {
 			// it exists partly results for this test
 			List<Identity> identitiesWithQtiSerEntry = iqManager.getIdentitiesWithQtiSerEntry(course.getResourceableId(), courseNode.getIdent());
 			if(passed || !identitiesWithQtiSerEntry.isEmpty()) {
-				learners = new ArrayList<>();
+				List<Identity> learners = new ArrayList<>();
 				for(QTIResult result : results) {
 					Identity identity = result.getResultSet().getIdentity();
 					if(identity != null && !learners.contains(identity)){
diff --git a/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java b/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java
index bda45a853fa310af1e3d30dd6c863ae7b6cd2f5a..9ec929a82357fd1205091a6e87e50e138e3ab889 100644
--- a/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java
+++ b/src/main/java/org/olat/course/nodes/iq/IQIdentityListCourseNodeController.java
@@ -31,6 +31,7 @@ import java.util.Map;
 import org.olat.basesecurity.GroupRoles;
 import org.olat.basesecurity.IdentityRef;
 import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.form.flexible.FormItem;
 import org.olat.core.gui.components.form.flexible.elements.FormLink;
 import org.olat.core.gui.components.form.flexible.impl.FormEvent;
@@ -39,6 +40,7 @@ import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFle
 import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer;
 import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel;
 import org.olat.core.gui.components.link.Link;
+import org.olat.core.gui.components.stack.PopEvent;
 import org.olat.core.gui.components.stack.TooledStackedPanel;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
@@ -108,6 +110,8 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
 	private ConfirmExtraTimeController extraTimeCtrl;
 	private ValidationXmlSignatureController validationCtrl;
 	private CorrectionOverviewController correctionIdentitiesCtrl;
+	
+	private boolean modelDirty = false;
 
 	@Autowired
 	private QTI21Service qtiService;
@@ -119,6 +123,9 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
 			RepositoryEntry courseEntry, BusinessGroup group, IQTESTCourseNode courseNode, UserCourseEnvironment coachCourseEnv,
 			AssessmentToolContainer toolContainer, AssessmentToolSecurityCallback assessmentCallback) {
 		super(ureq, wControl, stackPanel, courseEntry, group, courseNode, coachCourseEnv, toolContainer, assessmentCallback);
+		if(stackPanel != null) {
+			stackPanel.addListener(this);
+		}
 	}
 	
 	@Override
@@ -241,6 +248,8 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
 			boolean enabled = isTestRunning();
 			pullButton.setEnabled(enabled);
 		}
+		
+		this.modelDirty = true;
 	}
 	
 	/**
@@ -268,7 +277,19 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
 		}
 		return identityToExtraTime;	
 	}
-	
+
+	@Override
+	public void event(UserRequest ureq, Component source, Event event) {
+		if(stackPanel == source) {
+			if(event instanceof PopEvent) {
+				PopEvent pe = (PopEvent)event;
+				if(modelDirty && pe.getController() == correctionIdentitiesCtrl) {
+					loadModel(ureq);
+				}
+			}
+		}
+		super.event(ureq, source, event);
+	}
 
 	@Override
 	public void event(UserRequest ureq, Controller source, Event event) {
@@ -290,7 +311,10 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
 				CompleteAssessmentTestSessionEvent catse = (CompleteAssessmentTestSessionEvent)event;
 				doUpdateCourseNode(catse.getTestSessions(), catse.getAssessmentTest(), catse.getStatus());
 				loadModel(ureq);	
-				stackPanel.popController(correctionIdentitiesCtrl);		
+				stackPanel.popController(correctionIdentitiesCtrl);
+				fireEvent(ureq, Event.CHANGED_EVENT);
+			} else if(event == Event.CHANGED_EVENT) {
+				modelDirty = true;
 				fireEvent(ureq, Event.CHANGED_EVENT);
 			}
 		} else if(source instanceof QTI21IdentityListCourseNodeToolsController) {
diff --git a/src/main/java/org/olat/course/nodes/iq/QTI21IdentityListCourseNodeToolsController.java b/src/main/java/org/olat/course/nodes/iq/QTI21IdentityListCourseNodeToolsController.java
index 4a77d86e5c879633b7d862644817e64beb31b242..097eec751478f6b8fe7905baf7040b3f1c37f16c 100644
--- a/src/main/java/org/olat/course/nodes/iq/QTI21IdentityListCourseNodeToolsController.java
+++ b/src/main/java/org/olat/course/nodes/iq/QTI21IdentityListCourseNodeToolsController.java
@@ -236,9 +236,9 @@ public class QTI21IdentityListCourseNodeToolsController extends AbstractToolsCon
 		lastSessionMap.put(assessedIdentity, lastSession);
 		Map<Identity, TestSessionState> testSessionStates = new HashMap<>();
 		testSessionStates.put(assessedIdentity, testSessionState);
-		CorrectionOverviewModel model = new CorrectionOverviewModel(courseEntry, testCourseNode.getIdent(), testEntry,
+		CorrectionOverviewModel model = new CorrectionOverviewModel(courseEntry, testCourseNode, testEntry,
 				resolvedAssessmentTest, manifestBuilder, lastSessionMap, testSessionStates);
-		correctionCtrl = new CorrectionIdentityAssessmentItemListController(ureq, getWindowControl(), stackPanel, model, lastSession, assessedIdentity);
+		correctionCtrl = new CorrectionIdentityAssessmentItemListController(ureq, getWindowControl(), stackPanel, model, assessedIdentity);
 		listenTo(correctionCtrl);
 		stackPanel.pushController(translate("tool.correction"), correctionCtrl);
 	}
diff --git a/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java b/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java
index 9a846d89d73490f3c3f1ec73720c5ff2924eeef3..071b3b69b8b9ec4f175c56d933d7759bc3a2080a 100644
--- a/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java
+++ b/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java
@@ -31,10 +31,10 @@ import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
 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.IntegerElement;
 import org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement;
 import org.olat.core.gui.components.form.flexible.elements.SelectionElement;
 import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
+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.link.Link;
@@ -210,7 +210,6 @@ public class ScormEditController extends ActivateableTabbableDefaultController i
 		boolean fullWindow = config.getBooleanSafe(CONFIG_FULLWINDOW, true);
 		boolean closeOnFinish = config.getBooleanSafe(CONFIG_CLOSE_ON_FINISH, false);
 		
-		//= conf.get(CONFIG_CUTVALUE);
 		scorevarform = new VarForm(ureq, wControl, showMenu, skipLaunchPage, showNavButtons,
 				assessableType, cutvalue, fullWindow,
 				closeOnFinish, maxAttempts, advanceScore, attemptsDependOnScore);
@@ -273,10 +272,7 @@ public class ScormEditController extends ActivateableTabbableDefaultController i
 		}
 	}
 
-	/**
-	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
-	 */
+	@Override
 	public void event(UserRequest urequest, Controller source, Event event) {
 		if (source == searchController) {			
 			cmc.deactivate();
@@ -424,7 +420,7 @@ class VarForm extends FormBasicController {
 	private SelectionElement closeOnFinishEl;
 	private SingleSelection isAssessableEl;
 	private SelectionElement skipLaunchPageEl;
-	private IntegerElement cutValueEl;
+	private TextElement cutValueEl;
 	private SingleSelection attemptsEl;
 	private MultipleSelectionElement advanceScoreEl;
 	private MultipleSelectionElement scoreAttemptsEl;
@@ -474,7 +470,11 @@ class VarForm extends FormBasicController {
 	 * @return
 	 */
 	public int getCutValue() {
-		return cutValueEl.getIntValue();
+		String val = cutValueEl.getValue();
+		if(StringHelper.containsNonWhitespace(val) && StringHelper.isLong(val)) {
+			return Integer.parseInt(val);
+		}
+		return 0;
 	}
 	
 	public boolean isFullWindow() {
@@ -527,19 +527,24 @@ class VarForm extends FormBasicController {
 
 	@Override
 	protected boolean validateFormLogic(UserRequest ureq) {
-		boolean allOk = true;
+		boolean allOk = super.validateFormLogic(ureq);
 		
 		cutValueEl.clearError();
-		if(cutValueEl.isVisible() && cutValueEl.isEnabled() && StringHelper.containsNonWhitespace(cutValueEl.getValue())) {
-			try {
-				Integer.parseInt(cutValueEl.getValue());
-			} catch (NumberFormatException e) {
+		if(cutValueEl.isVisible() && cutValueEl.isEnabled()) {
+			if(StringHelper.containsNonWhitespace(cutValueEl.getValue())) {
+				try {
+					Integer.parseInt(cutValueEl.getValue());
+				} catch (NumberFormatException e) {
+					cutValueEl.setErrorKey("cutvalue.validation", null);
+					allOk &= false;
+				}
+			} else {
 				cutValueEl.setErrorKey("cutvalue.validation", null);
 				allOk &= false;
 			}
 		}
 		
-		return allOk && super.validateFormLogic(ureq);
+		return allOk;
 	}
 
 	@Override
@@ -570,8 +575,8 @@ class VarForm extends FormBasicController {
 			isAssessableEl.select(assessableKeys[0], true);
 		}
 		
-		cutValueEl = uifactory.addIntegerElement("cutvalue", "cutvalue.label", 0, formLayout);
-		cutValueEl.setIntValue(cutValue);
+		String val = cutValue < 0 ? "" : Integer.toString(cutValue);
+		cutValueEl = uifactory.addTextElement("cutvalue", "cutvalue.label", 5, val, formLayout);
 		cutValueEl.setDisplaySize(3);
 
 		advanceScoreEl = uifactory.addCheckboxesHorizontal("advanceScore", "advance.score.label", formLayout, new String[]{ "ison" }, new String[]{ "" });
diff --git a/src/main/java/org/olat/course/nodes/sp/SPRunController.java b/src/main/java/org/olat/course/nodes/sp/SPRunController.java
index d408d23dc1c44b9ff24b6cd0a9f8fd8961753d74..f8c88cdb2f8be06749ef015581290dac5234073b 100644
--- a/src/main/java/org/olat/course/nodes/sp/SPRunController.java
+++ b/src/main/java/org/olat/course/nodes/sp/SPRunController.java
@@ -149,14 +149,13 @@ public class SPRunController extends BasicController implements Activateable2 {
 			}
 
 			CourseGroupManager cgm = userCourseEnv.getCourseEnvironment().getCourseGroupManager();
-			if(roles.isInstitutionalResourceManager() &&
+			if(roles.isLearnResourceManager() &&
 				repositoryManager.isInstitutionalRessourceManagerFor(getIdentity(), roles, cgm.getCourseEntry())) {
 				return true;
 			}
-			if(config.getBooleanSafe(SPEditController.CONFIG_KEY_ALLOW_COACH_EDIT, false)){
-				if(cgm.isIdentityCourseCoach(ureq.getIdentity())){
-					return true;
-				}
+			if(config.getBooleanSafe(SPEditController.CONFIG_KEY_ALLOW_COACH_EDIT, false)
+					&& cgm.isIdentityCourseCoach(ureq.getIdentity())) {
+				return true;
 			}
 			return cgm.isIdentityCourseAdministrator(getIdentity())
 					|| cgm.hasRight(getIdentity(), CourseRights.RIGHT_COURSEEDITOR);
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 31560dfa94b554af555cae0a3b05e52a9dda6f84..ef13fa6ab7fbd344a31b0505c570e6c722af5553 100644
--- a/src/main/java/org/olat/course/run/preview/PreviewCourseGroupManager.java
+++ b/src/main/java/org/olat/course/run/preview/PreviewCourseGroupManager.java
@@ -35,6 +35,7 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.basesecurity.OrganisationRoles;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.manager.BasicManager;
 import org.olat.course.export.CourseEnvironmentMapper;
@@ -178,6 +179,11 @@ final class PreviewCourseGroupManager extends BasicManager implements CourseGrou
 	public boolean isIdentityAnyCourseAdministrator(Identity identity) {
 		return isCourseAdmin;
 	}
+	
+	@Override
+	public boolean isIdentityCourseLearnResourceManager(Identity identity, Roles roles) {
+		return false;
+	}
 
 	@Override
 	public boolean isIdentityAnyCourseParticipant(Identity identity) {
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 ec0cbb02cf3fb94955b5b6fb00137272b8c4a96d..34dad58ad8fd0abbe1fb2d22bfaf67cbd7200a0a 100644
--- a/src/main/java/org/olat/course/run/userview/UserCourseEnvironmentImpl.java
+++ b/src/main/java/org/olat/course/run/userview/UserCourseEnvironmentImpl.java
@@ -190,7 +190,8 @@ public class UserCourseEnvironmentImpl implements UserCourseEnvironment {
 
 		CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
 		boolean adminLazy = identityEnvironment.getRoles().isOLATAdmin()
-				|| identityEnvironment.getRoles().isInstitutionalResourceManager()
+				|| (identityEnvironment.getRoles().isLearnResourceManager()
+						&& cgm.isIdentityCourseLearnResourceManager(identityEnvironment.getIdentity(), identityEnvironment.getRoles()))
 				|| cgm.isIdentityAnyCourseAdministrator(identityEnvironment.getIdentity());
 		adminAnyCourse = Boolean.valueOf(adminLazy);
 		return adminLazy;
diff --git a/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java b/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java
index ce2fae5ff3ce05b30d1b25ef5583e0a7ac1a9048..25d53ec66694a3365e80820c8baeeabb6a4f73eb 100644
--- a/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java
+++ b/src/main/java/org/olat/course/site/CourseSiteContextEntryControllerCreator.java
@@ -69,11 +69,6 @@ public class CourseSiteContextEntryControllerCreator extends DefaultContextEntry
 		return new CourseSiteContextEntryControllerCreator();
 	}
 
-	/**
-	 * @see org.olat.core.id.context.ContextEntryControllerCreator#createController(org.olat.core.id.context.ContextEntry,
-	 *      org.olat.core.gui.UserRequest,
-	 *      org.olat.core.gui.control.WindowControl)
-	 */
 	@Override
 	public Controller createController(List<ContextEntry> ces, UserRequest ureq, WindowControl wControl) {
 		RepositoryEntry re = getRepositoryEntry(ureq, ces.get(0));
@@ -97,7 +92,7 @@ public class CourseSiteContextEntryControllerCreator extends DefaultContextEntry
 		UserSession usess = ureq.getUserSession();
 		if(re.getAccess() == RepositoryEntry.DELETED) {
 			Roles roles = usess.getRoles();
-			if(!roles.isInstitutionalResourceManager() && !roles.isOLATAdmin()) {
+			if(!roles.isLearnResourceManager() && !roles.isOLATAdmin()) {
 				return messageController(ureq, wControl, "repositoryentry.deleted");
 			}
 		}
diff --git a/src/main/java/org/olat/course/site/CourseSiteDef.java b/src/main/java/org/olat/course/site/CourseSiteDef.java
index 602d5bdc0573f2f03ff07316f2a7051c0324cc7e..17e3f67db119aa3edc6800d15657499a1eaa9c4a 100644
--- a/src/main/java/org/olat/course/site/CourseSiteDef.java
+++ b/src/main/java/org/olat/course/site/CourseSiteDef.java
@@ -28,6 +28,7 @@ import org.olat.core.gui.control.navigation.SiteDefinition;
 import org.olat.core.gui.control.navigation.SiteDefinitions;
 import org.olat.core.gui.control.navigation.SiteInstance;
 import org.olat.core.gui.control.navigation.SiteSecurityCallback;
+import org.olat.core.id.Roles;
 import org.olat.core.util.StringHelper;
 import org.olat.core.util.UserSession;
 import org.olat.course.site.model.CourseSiteConfiguration;
@@ -80,8 +81,7 @@ public class CourseSiteDef extends AbstractSiteDefinition implements SiteDefinit
 	
 	protected CourseSiteConfiguration getCourseSiteconfiguration() {
 		SiteDefinitions siteModule = CoreSpringFactory.getImpl(SiteDefinitions.class);
-		CourseSiteConfiguration config = siteModule.getConfigurationCourseSite1();
-		return config;
+		return siteModule.getConfigurationCourseSite1();
 	}
 	
 	protected SiteInstance createSite(UserRequest ureq, CourseSiteConfiguration courseConfig, SiteConfiguration config) {
@@ -92,10 +92,12 @@ public class CourseSiteDef extends AbstractSiteDefinition implements SiteDefinit
 		
 		UserSession usess = ureq.getUserSession();
 		if(usess == null || usess.getRoles() == null) return null;
+		
+		Roles roles = usess.getRoles();
 
-		boolean canSeeToolController = usess.getRoles().isAuthor()
-				|| usess.getRoles().isOLATAdmin()
-				|| usess.getRoles().isInstitutionalResourceManager();
+		boolean canSeeToolController = roles.isAuthor()
+				|| roles.isOLATAdmin()
+				|| roles.isLearnResourceManager();
 		boolean showToolController = true;
 		if (!canSeeToolController && !courseConfig.isToolbar()) {
 			showToolController = false;
diff --git a/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java b/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java
index 88e888af716b3d993cbe77d8ba8626a276deac31..205283b828d903dcd5bae34678f0a8a57eefd526 100644
--- a/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java
+++ b/src/main/java/org/olat/group/ui/main/AbstractBusinessGroupListController.java
@@ -66,6 +66,7 @@ import org.olat.core.id.context.ContextEntry;
 import org.olat.core.id.context.StateEntry;
 import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
 import org.olat.core.util.StringHelper;
+import org.olat.core.util.UserSession;
 import org.olat.core.util.Util;
 import org.olat.core.util.mail.ContactList;
 import org.olat.core.util.mail.ContactMessage;
@@ -382,8 +383,6 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr
 						doLaunch(ureq, businessGroup);
 					} else if(TABLE_ACTION_DELETE.equals(cmd)) {
 						confirmDelete(ureq, Collections.singletonList(item));
-					} else if(TABLE_ACTION_LAUNCH.equals(cmd)) {
-						doLaunch(ureq, businessGroup);
 					} else if(TABLE_ACTION_EDIT.equals(cmd)) {
 						doEdit(ureq, businessGroup);
 					} else if(TABLE_ACTION_LEAVE.equals(cmd)) {
@@ -759,8 +758,8 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr
 			return;
 		} 
 		
-		boolean isAuthor = ureq.getUserSession().getRoles().isAuthor()
-				|| ureq.getUserSession().getRoles().isInstitutionalResourceManager();
+		UserSession usess = ureq.getUserSession();
+		boolean isAuthor = usess.getRoles().isAuthor() || usess.getRoles().isLearnResourceManager();
 
 		Step start = new BGConfigToolsStep(ureq, isAuthor);
 		StepRunnerCallback finish = new StepRunnerCallback() {
@@ -1057,16 +1056,14 @@ public abstract class AbstractBusinessGroupListController extends FormBasicContr
 	}
 	
 	protected final List<BusinessGroup> toBusinessGroups(UserRequest ureq, List<? extends BusinessGroupRef> items, boolean editableOnly) {
-		List<Long> groupKeys = new ArrayList<Long>();
+		List<Long> groupKeys = new ArrayList<>();
 		for(BusinessGroupRef item:items) {
 			groupKeys.add(item.getKey());
 		}
 		if(editableOnly) {
 			filterEditableGroupKeys(ureq, groupKeys);
 		}
-
-		List<BusinessGroup> groups = businessGroupService.loadBusinessGroups(groupKeys);
-		return groups;
+		return businessGroupService.loadBusinessGroups(groupKeys);
 	}
 	
 	protected boolean filterEditableGroupKeys(UserRequest ureq, List<Long> groupKeys) {
diff --git a/src/main/java/org/olat/group/ui/main/SelectBusinessGroupController.java b/src/main/java/org/olat/group/ui/main/SelectBusinessGroupController.java
index 9cea9a779aedcc7e7e0226d2e43b203a454420e3..ace53fdf759d0784ac329e9f1a5bdba97f541260 100644
--- a/src/main/java/org/olat/group/ui/main/SelectBusinessGroupController.java
+++ b/src/main/java/org/olat/group/ui/main/SelectBusinessGroupController.java
@@ -108,7 +108,7 @@ public class SelectBusinessGroupController extends BasicController {
 		Roles roles = ureq.getUserSession().getRoles();
 		return roles.isOLATAdmin() 
 				|| roles.isGroupManager() 
-				|| (roles.isInstitutionalResourceManager() && businessGroupModule.isResourceManagersAllowedToLinkGroups());
+				|| (roles.isLearnResourceManager() && businessGroupModule.isResourceManagersAllowedToLinkGroups());
 	}
 	
 	public Object getUserObject() {
diff --git a/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java b/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java
index 8f01282a7a839ac18bba9cba221026d611bcc5be..caf86ffcff35dd42ffcb42104099cfe202b64fa3 100644
--- a/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java
+++ b/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java
@@ -55,7 +55,8 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 public class CPRuntimeController extends RepositoryEntryRuntimeController {
 	
-	private Link quotaLink, deliveryOptionsLink;
+	private Link quotaLink;
+	private Link deliveryOptionsLink;
 	
 	@Autowired
 	private CPManager cpManager;
@@ -73,7 +74,7 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController {
 		if (reSecurity.isEntryAdmin()) {
 			settingsDropdown.addComponent(new Spacer(""));
 			
-			if (quotaManager.hasQuotaEditRights(getIdentity(), roles)) {
+			if (quotaManager.hasQuotaEditRights(getIdentity(), roles, getOrganisations())) {
 				quotaLink = LinkFactory.createToolLink("quota", translate("tab.quota.edit"), this, "o_sel_repo_quota");
 				quotaLink.setIconLeftCSS("o_icon o_icon-fw o_icon_quota");
 				settingsDropdown.addComponent(quotaLink);
@@ -88,7 +89,7 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController {
 	@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("Quota".equalsIgnoreCase(type)) {
 				doQuota(ureq);
@@ -123,12 +124,12 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController {
 	}
 
 	private void doQuota(UserRequest ureq) {
-		if (quotaManager.hasQuotaEditRights(ureq.getIdentity(), roles)) {
+		if (quotaManager.hasQuotaEditRights(ureq.getIdentity(), roles, getOrganisations())) {
 			RepositoryEntry entry = getRepositoryEntry();
 			OLATResource resource = entry.getOlatResource();
 			OlatRootFolderImpl cpRoot = FileResourceManager.getInstance().unzipContainerResource(resource);
 			WindowControl bwControl = getSubWindowControl("Quota");
-			Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), cpRoot.getRelPath());
+			Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), cpRoot.getRelPath(), getOrganisations());
 			pushController(ureq, translate("tab.quota.edit"), quotaCtrl);
 			setActiveTool(quotaLink);
 		}
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 9830b61a238d8475e789e16668a1d932a05526bf..7abe1704bd67f80c20e2b0e5c45a86a1af0a5d2a 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
@@ -36,10 +36,10 @@ import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.stack.TooledStackedPanel;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
-import org.olat.core.gui.control.generic.layout.MainLayoutController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.util.Util;
 import org.olat.core.util.ZipUtil;
@@ -55,7 +55,6 @@ import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.FileHandler;
-import org.olat.repository.model.RepositoryEntrySecurity;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
 import org.olat.resource.references.ReferenceManager;
@@ -81,10 +80,11 @@ public abstract class QTIHandler extends FileHandler {
 	}
 
 	protected RepositoryEntry createResource(String type, FileResource ores, Identity initialAuthor,
-			String displayname, String description, Object object, Locale locale) {
+			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);
+		RepositoryEntry re = repositoryService
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		
 		File fRepositoryQTI = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), "qti.zip");
@@ -99,7 +99,7 @@ public abstract class QTIHandler extends FileHandler {
 	}
 
 	protected RepositoryEntry importResource(Identity initialAuthor, String displayname, String description,
-			FileResource ores, File file, String filename) {
+			Organisation organisation, FileResource ores, File file, String filename) {
 		
 		OLATResource resource = OLATResourceManager.getInstance().createAndPersistOLATResourceInstance(ores);
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(resource).getBasefile();
@@ -107,7 +107,7 @@ public abstract class QTIHandler extends FileHandler {
 		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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		//zip it
 		return re;
@@ -138,9 +138,6 @@ public abstract class QTIHandler extends FileHandler {
 		}
 	}
 
-	@Override
-	public abstract MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl);
-
 	@Override
 	public Controller createAssessmentDetailsController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar, Identity assessedIdentity) {
 		return null;
diff --git a/src/main/java/org/olat/ims/qti/repository/handlers/QTISurveyHandler.java b/src/main/java/org/olat/ims/qti/repository/handlers/QTISurveyHandler.java
index 0dc4e5f730c042b7ea2dac6c475f4f4644286a9e..2a7d4a18b4ccacb39910562badac7fc53ba95494 100644
--- a/src/main/java/org/olat/ims/qti/repository/handlers/QTISurveyHandler.java
+++ b/src/main/java/org/olat/ims/qti/repository/handlers/QTISurveyHandler.java
@@ -41,6 +41,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.Util;
 import org.olat.course.assessment.AssessmentMode;
@@ -88,9 +89,10 @@ public class QTISurveyHandler extends QTIHandler {
 	}
 
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		SurveyFileResource ores = new SurveyFileResource();
-		return super.createResource(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY, ores, initialAuthor, displayname, description, createObject, locale);
+		return super.createResource(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY, ores, initialAuthor, displayname, description, createObject, organisation, locale);
 	}
 
 	@Override
@@ -100,8 +102,8 @@ public class QTISurveyHandler extends QTIHandler {
 
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
-		return super.importResource(initialAuthor, displayname, description, new SurveyFileResource(), file, filename);
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
+		return super.importResource(initialAuthor, displayname, description, organisation, new SurveyFileResource(), file, filename);
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/ims/qti/repository/handlers/QTITestHandler.java b/src/main/java/org/olat/ims/qti/repository/handlers/QTITestHandler.java
index c6fa0fe052eff1f080b6d6e9a4757b48380d4af2..2ffb2c1711b2e0f52d79c6ef68009c07626fb538 100644
--- a/src/main/java/org/olat/ims/qti/repository/handlers/QTITestHandler.java
+++ b/src/main/java/org/olat/ims/qti/repository/handlers/QTITestHandler.java
@@ -41,6 +41,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.Util;
 import org.olat.course.assessment.AssessmentMode;
@@ -90,9 +91,10 @@ public class QTITestHandler extends QTIHandler {
 	}
 
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		TestFileResource ores = new TestFileResource();
-		return super.createResource(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS, ores, initialAuthor, displayname, description, createObject, locale);
+		return super.createResource(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS, ores, initialAuthor, displayname, description, createObject, organisation, locale);
 	}
 
 	@Override
@@ -102,8 +104,8 @@ public class QTITestHandler extends QTIHandler {
 
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
-		return super.importResource(initialAuthor, displayname, description, new TestFileResource(), file, filename);
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
+		return super.importResource(initialAuthor, displayname, description, organisation, new TestFileResource(), file, filename);
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/ims/qti21/model/xml/TestFeedbackBuilder.java b/src/main/java/org/olat/ims/qti21/model/xml/TestFeedbackBuilder.java
index 53923f3b9d89c51f2d6872b5c9ad670d4de6485b..6d6d357f83b069e2b6cc3940c1e0bef9e95fab14 100644
--- a/src/main/java/org/olat/ims/qti21/model/xml/TestFeedbackBuilder.java
+++ b/src/main/java/org/olat/ims/qti21/model/xml/TestFeedbackBuilder.java
@@ -19,9 +19,18 @@
  */
 package org.olat.ims.qti21.model.xml;
 
+import java.io.StringReader;
 import java.util.List;
 
+import org.cyberneko.html.parsers.SAXParser;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
+import org.olat.core.util.StringHelper;
+import org.olat.core.util.filter.FilterFactory;
 import org.olat.ims.qti21.QTI21Constants;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
 
 import uk.ac.ed.ph.jqtiplus.node.expression.Expression;
 import uk.ac.ed.ph.jqtiplus.node.expression.general.BaseValue;
@@ -48,6 +57,8 @@ import uk.ac.ed.ph.jqtiplus.value.SingleValue;
  */
 public class TestFeedbackBuilder {
 	
+	private static final OLog log = Tracing.createLoggerFor(TestFeedbackBuilder.class);
+	
 	private final TestFeedback testFeedback;
 	private final AssessmentTest assessmentTest;
 	
@@ -74,8 +85,7 @@ public class TestFeedbackBuilder {
 	}
 	
 	public OutcomeRule getResponseRule() {
-		OutcomeRule feedbackRule = findFeedbackRule(testFeedback.getOutcomeValue());
-		return feedbackRule;
+		return findFeedbackRule(testFeedback.getOutcomeValue());
 	}
 	
 	public boolean isPassedRule() {
@@ -210,4 +220,51 @@ public class TestFeedbackBuilder {
 		}
 		return false;
 	}
+	
+	/**
+	 * 
+	 * @param value The content of the feedback.
+	 * @return
+	 */
+	public static boolean isEmpty(String value) {
+		if(!StringHelper.containsNonWhitespace(value)) {
+			return true;
+		}
+		if(StringHelper.containsNonWhitespace(FilterFactory.getHtmlTagsFilter().filter(value))) {
+			return false;
+		}
+		
+		try {
+			SAXParser parser = new SAXParser();
+			HTMLHandler contentHandler = new HTMLHandler();
+			parser.setContentHandler(contentHandler);
+			parser.parse(new InputSource(new StringReader(value)));
+			return !contentHandler.hasRelevantTags();
+		} catch (Exception e) {
+			log.error("", e);
+		}
+		return true;
+	}
+	
+	private static class HTMLHandler extends DefaultHandler {
+
+		private int count = 0;
+		
+		public boolean hasRelevantTags() {
+			return count > 0;
+		}
+
+		@Override
+		public void startElement(String uri, String localName, String qName, Attributes attributes) {
+			String elem = localName.toLowerCase();
+			if("img".equals(elem)) {
+				count++;
+			} else if("span".equals(elem) ) {
+				String cssClass = attributes.getValue("class");
+				if(cssClass != null && cssClass.contains("olatFlashMovieViewer")) {
+					count++;
+				}
+			}
+		}
+	}
 }
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 c669180e5208e47f780057de9001a2671fb251a7..428cb5a03f9a8abc8ba7097047539054692f10e2 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
@@ -43,6 +43,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -132,11 +133,12 @@ public class QTI21AssessmentTestHandler extends FileHandler {
 	}
 
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		ImsQTI21Resource ores = new ImsQTI21Resource();
 		
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		dbInstance.commit();
 		
 		File repositoryDir = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), FileResourceManager.ZIPDIR);
@@ -267,7 +269,7 @@ public class QTI21AssessmentTestHandler extends FileHandler {
 
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		ImsQTI21Resource ores = new ImsQTI21Resource();
 		OLATResource resource = OLATResourceManager.getInstance().createAndPersistOLATResourceInstance(ores);
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRoot(resource);
@@ -285,7 +287,7 @@ public class QTI21AssessmentTestHandler extends FileHandler {
 		} 
 
 		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -371,8 +373,7 @@ public class QTI21AssessmentTestHandler extends FileHandler {
 
 	@Override
 	public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
-		AssessmentTestComposerController editorCtrl = new AssessmentTestComposerController(ureq, wControl, toolbar, re);
-		return editorCtrl;
+		return new AssessmentTestComposerController(ureq, wControl, toolbar, re);
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/ims/qti21/ui/QTI21AssessmentDetailsController.java b/src/main/java/org/olat/ims/qti21/ui/QTI21AssessmentDetailsController.java
index cabf189f088c75e9d3121947df9eb4bde201e332..e20103834643436b01288cf6dd962998e76bcfe0 100644
--- a/src/main/java/org/olat/ims/qti21/ui/QTI21AssessmentDetailsController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/QTI21AssessmentDetailsController.java
@@ -81,6 +81,7 @@ import org.olat.modules.assessment.AssessmentEntry;
 import org.olat.modules.assessment.AssessmentService;
 import org.olat.modules.assessment.AssessmentToolOptions;
 import org.olat.modules.assessment.Role;
+import org.olat.modules.assessment.model.AssessmentEntryStatus;
 import org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
@@ -287,7 +288,7 @@ public class QTI21AssessmentDetailsController extends FormBasicController {
 			if(event instanceof CompleteAssessmentTestSessionEvent) {
 				CompleteAssessmentTestSessionEvent catse = (CompleteAssessmentTestSessionEvent)event;
 				if(courseNode != null) {
-					doUpdateCourseNode(correctionCtrl.getAssessmentTestSession(), catse.getAssessmentTest());
+					doUpdateCourseNode(correctionCtrl.getAssessmentTestSession(), catse.getAssessmentTest(), AssessmentEntryStatus.done);
 				} else {
 					doUpdateEntry(correctionCtrl.getAssessmentTestSession());
 				}
@@ -295,6 +296,9 @@ public class QTI21AssessmentDetailsController extends FormBasicController {
 				fireEvent(ureq, Event.CHANGED_EVENT);
 				stackPanel.popController(correctionCtrl);
 				cleanUp();
+			} else if(event == Event.CHANGED_EVENT) {
+				updateModel();
+				fireEvent(ureq, Event.CHANGED_EVENT);
 			} else if(event == Event.CANCELLED_EVENT) {
 				stackPanel.popController(correctionCtrl);
 				cleanUp();
@@ -367,14 +371,14 @@ public class QTI21AssessmentDetailsController extends FormBasicController {
 		lastSessions.put(assessedIdentity, session);
 		Map<Identity, TestSessionState> testSessionStates = new HashMap<>();
 		testSessionStates.put(assessedIdentity, testSessionState);
-		CorrectionOverviewModel model = new CorrectionOverviewModel(entry, subIdent, testEntry,
+		CorrectionOverviewModel model = new CorrectionOverviewModel(entry, courseNode, testEntry,
 				resolvedAssessmentTest, manifestBuilder, lastSessions, testSessionStates);
-		correctionCtrl = new CorrectionIdentityAssessmentItemListController(ureq, getWindowControl(), stackPanel, model, session, assessedIdentity);
+		correctionCtrl = new CorrectionIdentityAssessmentItemListController(ureq, getWindowControl(), stackPanel, model, assessedIdentity);
 		listenTo(correctionCtrl);
 		stackPanel.pushController(translate("correction"), correctionCtrl);
 	}
 	
-	private void doUpdateCourseNode(AssessmentTestSession session, AssessmentTest assessmentTest) {
+	private void doUpdateCourseNode(AssessmentTestSession session, AssessmentTest assessmentTest, AssessmentEntryStatus entryStatus) {
 		Double cutValue = QtiNodesExtractor.extractCutValue(assessmentTest);
 		
 		ScoreEvaluation scoreEval = courseNode.getUserScoreEvaluation(assessedUserCourseEnv);
@@ -385,8 +389,9 @@ public class QTI21AssessmentDetailsController extends FormBasicController {
 			boolean calculated = finalScore.compareTo(BigDecimal.valueOf(cutValue.doubleValue())) >= 0;
 			passed = Boolean.valueOf(calculated);
 		}
+		AssessmentEntryStatus finalStatus = entryStatus == null ? scoreEval.getAssessmentStatus() : entryStatus;
 		ScoreEvaluation manualScoreEval = new ScoreEvaluation(score, passed,
-				scoreEval.getAssessmentStatus(), null, scoreEval.getFullyAssessed(), 
+				finalStatus, null, scoreEval.getFullyAssessed(), 
 				scoreEval.getCurrentRunCompletion(), scoreEval.getCurrentRunStatus(), session.getKey());
 		courseNode.updateUserScoreEvaluation(manualScoreEval, assessedUserCourseEnv, getIdentity(), false, Role.coach);
 	}
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionAssessmentItemListController.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionAssessmentItemListController.java
index 5c6ea9622e110efa2a7a0dd0b2cb1c2a969e7d22..151037f62c62f6cf1e408481d3d753052e389f67 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionAssessmentItemListController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionAssessmentItemListController.java
@@ -165,6 +165,10 @@ public class CorrectionAssessmentItemListController extends FormBasicController
 		saveTestsButton.setElementCssClass("o_sel_correction_save_tests");
 	}
 	
+	public void reloadModel() {
+		loadModel(true, true);
+	}
+	
 	private void loadModel(boolean reset, boolean lastSessions) {
 		if(lastSessions) {
 			model.loadLastSessions();
@@ -284,6 +288,8 @@ public class CorrectionAssessmentItemListController extends FormBasicController
 				stackPanel.popController(identityItemCtrl);
 				SelectAssessmentItemEvent saie = (SelectAssessmentItemEvent)event;
 				doSelect(ureq, saie.getListEntry(), identityItemCtrl.getAssessmentEntryList());
+			} else if(event == Event.CHANGED_EVENT) {
+				fireEvent(ureq, Event.CHANGED_EVENT);
 			}
 		} else if(confirmSaveTestCtrl == source) {
 			if(event == Event.DONE_EVENT) {
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemController.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemController.java
index 4938950146751cf8d59de3ba9137ed0d90840fd5..ec5597a015b6bd3ddeeef0abdcb324208fe78aec 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemController.java
@@ -21,6 +21,7 @@ package org.olat.ims.qti21.ui.assessment;
 
 import java.io.File;
 import java.io.IOException;
+import java.math.BigDecimal;
 import java.net.URI;
 import java.util.HashMap;
 import java.util.List;
@@ -38,6 +39,11 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.util.StringHelper;
+import org.olat.course.assessment.AssessmentHelper;
+import org.olat.course.nodes.IQTESTCourseNode;
+import org.olat.course.run.environment.CourseEnvironment;
+import org.olat.course.run.scoring.ScoreEvaluation;
+import org.olat.course.run.userview.UserCourseEnvironment;
 import org.olat.fileresource.FileResourceManager;
 import org.olat.ims.qti21.AssessmentItemSession;
 import org.olat.ims.qti21.AssessmentSessionAuditLogger;
@@ -45,13 +51,16 @@ import org.olat.ims.qti21.AssessmentTestHelper;
 import org.olat.ims.qti21.AssessmentTestSession;
 import org.olat.ims.qti21.QTI21Service;
 import org.olat.ims.qti21.model.ParentPartItemRefs;
+import org.olat.ims.qti21.model.xml.QtiNodesExtractor;
 import org.olat.ims.qti21.ui.ResourcesMapper;
 import org.olat.ims.qti21.ui.assessment.event.NextAssessmentItemEvent;
 import org.olat.ims.qti21.ui.assessment.model.AssessmentItemCorrection;
 import org.olat.ims.qti21.ui.assessment.model.AssessmentItemListEntry;
+import org.olat.modules.assessment.Role;
 import org.olat.repository.RepositoryEntry;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest;
 import uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest;
 import uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey;
 import uk.ac.ed.ph.jqtiplus.state.TestSessionState;
@@ -65,6 +74,7 @@ import uk.ac.ed.ph.jqtiplus.state.TestSessionState;
 public class CorrectionIdentityAssessmentItemController extends FormBasicController {
 	
 	private FormLink saveNextQuestionButton;
+	private FormLink saveBackOverviewButton;
 
 	private final String mapperUri;
 	private final URI assessmentObjectUri;
@@ -137,10 +147,12 @@ public class CorrectionIdentityAssessmentItemController extends FormBasicControl
 		uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
 		uifactory.addFormSubmitButton("save", formLayout);
 		saveNextQuestionButton = uifactory.addFormLink("save.next", formLayout, Link.BUTTON);
+		saveBackOverviewButton = uifactory.addFormLink("save.back", formLayout, Link.BUTTON);
 	}
 	
 	protected void updateNext(boolean nextEnable) {
-		saveNextQuestionButton.setEnabled(nextEnable);
+		saveNextQuestionButton.setVisible(nextEnable);
+		saveBackOverviewButton.setVisible(!nextEnable);
 	}
 	
 	@Override
@@ -151,6 +163,7 @@ public class CorrectionIdentityAssessmentItemController extends FormBasicControl
 	@Override
 	protected void formOK(UserRequest ureq) {
 		doSave();
+		fireEvent(ureq, Event.CHANGED_EVENT);
 		identityInteractionsCtrl.updateStatus();
 	}
 
@@ -163,7 +176,12 @@ public class CorrectionIdentityAssessmentItemController extends FormBasicControl
 	protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
 		if(saveNextQuestionButton == source) {
 			doSave();
+			fireEvent(ureq, Event.CHANGED_EVENT);
 			fireEvent(ureq, new NextAssessmentItemEvent());
+		} else if(saveBackOverviewButton == source) {
+			doSave();
+			fireEvent(ureq, Event.CHANGED_EVENT);
+			fireEvent(ureq, Event.BACK_EVENT);
 		} else {
 			super.formInnerEvent(ureq, source, event);
 		}
@@ -193,8 +211,36 @@ public class CorrectionIdentityAssessmentItemController extends FormBasicControl
 			candidateSession = qtiService.recalculateAssessmentTestSessionScores(candidateSession.getKey());
 			itemCorrection.setTestSession(candidateSession);
 			model.updateLastSession(itemCorrection.getAssessedIdentity(), candidateSession);
+			
+			if(model.getCourseNode() != null && model.getCourseEnvironment() != null) {
+				doUpdateCourseNode(candidateSession, model.getCourseNode(), model.getCourseEnvironment());
+			}
 		} catch(IOException e) {
 			logError("", e);
 		}
 	}
+	
+	private void doUpdateCourseNode(AssessmentTestSession testSession, IQTESTCourseNode courseNode, CourseEnvironment courseEnv) {
+		if(testSession == null) return;
+		
+		AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
+		Double cutValue = QtiNodesExtractor.extractCutValue(assessmentTest);
+
+		UserCourseEnvironment assessedUserCourseEnv = AssessmentHelper
+				.createAndInitUserCourseEnvironment(testSession.getIdentity(), courseEnv);
+		ScoreEvaluation scoreEval = courseNode.getUserScoreEvaluation(assessedUserCourseEnv);
+		
+		BigDecimal finalScore = testSession.getFinalScore();
+		Float score = finalScore == null ? null : finalScore.floatValue();
+		Boolean passed = scoreEval.getPassed();
+		if(testSession.getManualScore() != null && finalScore != null && cutValue != null) {
+			boolean calculated = finalScore.compareTo(BigDecimal.valueOf(cutValue.doubleValue())) >= 0;
+			passed = Boolean.valueOf(calculated);
+		}
+		
+		ScoreEvaluation manualScoreEval = new ScoreEvaluation(score, passed,
+				scoreEval.getAssessmentStatus(), scoreEval.getUserVisible(), scoreEval.getFullyAssessed(),
+				scoreEval.getCurrentRunCompletion(), scoreEval.getCurrentRunStatus(), testSession.getKey());
+		courseNode.updateUserScoreEvaluation(manualScoreEval, assessedUserCourseEnv, getIdentity(), false, Role.coach);
+	}
 }
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemListController.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemListController.java
index 4ef2feccff14a8d8f68594b9813a82446ac234bf..5087e5b005b4b547c3e035b7ca6353c77bcd6604 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemListController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemListController.java
@@ -44,6 +44,7 @@ import org.olat.core.gui.components.stack.TooledStackedPanel;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
@@ -97,10 +98,14 @@ import uk.ac.ed.ph.jqtiplus.types.Identifier;
 public class CorrectionIdentityAssessmentItemListController extends FormBasicController {
 	
 	private FormLink saveButton;
+	private FormLink backLink;
+	private FormLink backOverviewButton;
 	private FlexiTableElement tableEl;
 	private final TooledStackedPanel stackPanel;
 	private CorrectionIdentityAssessmentItemTableModel tableModel;
-	
+
+	private CloseableModalController cmc;
+	private ConfirmSaveTestsController confirmSaveTestCtrl;
 	private CorrectionIdentityAssessmentItemNavigationController identityItemCtrl;
 
 	private final String title;
@@ -108,7 +113,6 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 	private final boolean saveEnabled;
 	private final Identity assessedIdentity;
 	private final CorrectionOverviewModel model;
-	private AssessmentTestSession candidateSession;
 
 	@Autowired
 	private QTI21Service qtiService;
@@ -116,13 +120,12 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 	private UserManager userManager;
 	
 	public CorrectionIdentityAssessmentItemListController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel,
-			CorrectionOverviewModel model, AssessmentTestSession candidateSession, Identity assessedIdentity) {
+			CorrectionOverviewModel model, Identity assessedIdentity) {
 		super(ureq, wControl, "correction_identity_assessment_item_list");
 		
 		this.stackPanel = stackPanel;
 		this.model = model;
 		this.assessedIdentity = assessedIdentity;
-		this.candidateSession = candidateSession;
 		saveEnabled = true;
 		title = userManager.getUserDisplayName(assessedIdentity);
 		
@@ -137,7 +140,6 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 		this.model = model;
 		this.title = title;
 		this.assessedIdentity = assessedIdentity;
-		candidateSession = model.getLastSessions().get(assessedIdentity);
 		saveEnabled = false;
 		
 		initForm(ureq);
@@ -145,7 +147,7 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 	}
 	
 	public AssessmentTestSession getAssessmentTestSession() {
-		return candidateSession;
+		return model.getLastSessions().get(assessedIdentity);
 	}
 
 	@Override
@@ -175,9 +177,11 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 		tableEl.setExportEnabled(true);
 		tableEl.setAndLoadPersistedPreferences(ureq, "corr-identity-assessment-item-list");
 		
+		backLink = uifactory.addFormLink("back", formLayout, Link.LINK_BACK);
 		if(saveEnabled) {
-			uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
-			saveButton = uifactory.addFormLink("save", formLayout, Link.BUTTON);
+			saveButton = uifactory.addFormLink("save.tests", formLayout, Link.BUTTON);
+		} else {
+			backOverviewButton = uifactory.addFormLink("back.overview", formLayout, Link.BUTTON);
 		}
 	}
 	
@@ -188,6 +192,7 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 			identifierToRefs.put(itemRef.getIdentifier(), itemRef);
 		}
 		
+		AssessmentTestSession candidateSession = getAssessmentTestSession();
 		List<AssessmentItemSession> allItemSessions = qtiService.getAssessmentItemSessions(candidateSession);
 		Map<String, AssessmentItemSession> identifierToItemSessions = new HashMap<>();
 		for(AssessmentItemSession itemSession:allItemSessions) {
@@ -258,10 +263,27 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 				stackPanel.popController(identityItemCtrl);
 				SelectAssessmentItemEvent saie = (SelectAssessmentItemEvent)event;
 				doSelect(ureq, (CorrectionIdentityAssessmentItemRow)saie.getListEntry());
+			} else if(event == Event.CHANGED_EVENT) {
+				fireEvent(ureq, event);
+			}
+		} else if(confirmSaveTestCtrl == source) {
+			if(event == Event.DONE_EVENT) {
+				doSaveTests(ureq);
 			}
+			cmc.deactivate();
+			cleanUp();
+		} else if(cmc == source) {
+			cleanUp();
 		}
 		super.event(ureq, source, event);
 	}
+	
+	private void cleanUp() {
+		removeAsListenerAndDispose(confirmSaveTestCtrl);
+		removeAsListenerAndDispose(cmc);
+		confirmSaveTestCtrl = null;
+		cmc = null;
+	}
 
 	@Override
 	protected void formOK(UserRequest ureq) {
@@ -285,18 +307,47 @@ public class CorrectionIdentityAssessmentItemListController extends FormBasicCon
 				}
 			}
 		} else if(saveButton == source) {
-			List<AssessmentTestSession> sessions = Collections.singletonList(candidateSession);
-			AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
-			fireEvent(ureq, new CompleteAssessmentTestSessionEvent(sessions, assessmentTest, AssessmentEntryStatus.done));
+			doConfirmSaveTests(ureq);
+		} else if(backLink == source || backOverviewButton == source) {
+			fireEvent(ureq, Event.BACK_EVENT);
 		}
 		super.formInnerEvent(ureq, source, event);
 	}
 	
+	
+	private void doConfirmSaveTests(UserRequest ureq) {
+		if(confirmSaveTestCtrl != null) return;
+		
+		int notCorrectedQuestions = 0;
+		List<CorrectionIdentityAssessmentItemRow> rows = tableModel.getObjects();
+		for(CorrectionIdentityAssessmentItemRow row:rows) {
+			if(!row.isCorrected()) {
+				notCorrectedQuestions += 1;
+			}
+		}
+		
+		confirmSaveTestCtrl = new ConfirmSaveTestsController(ureq, getWindowControl(), notCorrectedQuestions > 0);
+		listenTo(confirmSaveTestCtrl);
+		
+		cmc = new CloseableModalController(getWindowControl(), "close", confirmSaveTestCtrl.getInitialComponent(),
+				true, translate("save.tests"));
+		listenTo(cmc);
+		cmc.activate();
+	}
+	
+	private void doSaveTests(UserRequest ureq) {
+		AssessmentTestSession candidateSession = getAssessmentTestSession();
+		List<AssessmentTestSession> sessions = Collections.singletonList(candidateSession);
+		AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
+		fireEvent(ureq, new CompleteAssessmentTestSessionEvent(sessions, assessmentTest, AssessmentEntryStatus.done));
+	}
+	
 	private void doSelect(UserRequest ureq, CorrectionIdentityAssessmentItemRow row) {
 		removeAsListenerAndDispose(identityItemCtrl);
 		doUnlock();
 
 		AssessmentItemRef itemRef = row.getItemRef();
+		AssessmentTestSession candidateSession = getAssessmentTestSession();
 		TestSessionState testSessionState = qtiService.loadTestSessionState(candidateSession);
 		List<TestPlanNode> nodes = testSessionState.getTestPlan().getNodes(itemRef.getIdentifier());
 		
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemNavigationController.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemNavigationController.java
index 8cbae8498716835d1c9d9283b4de320b16353c36..83164aeaecfa37356c403466cca7683d836b6f48 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemNavigationController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityAssessmentItemNavigationController.java
@@ -52,6 +52,7 @@ import uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest;
 public class CorrectionIdentityAssessmentItemNavigationController extends BasicController {
 	
 	private final Link backLink;
+	private final Link backOverviewButton;
 	private final Link nextItemLink;
 	private final Link previousItemLink;
 	private final VelocityContainer mainVC;
@@ -74,6 +75,9 @@ public class CorrectionIdentityAssessmentItemNavigationController extends BasicC
 		backLink = LinkFactory.createLinkBack(mainVC, this);
 		backLink.setElementCssClass("o_correction_navigation_back");
 		mainVC.put("back", backLink);
+		backOverviewButton = LinkFactory.createButton("back.overview", mainVC, this);
+		backOverviewButton.setElementCssClass("o_correction_navigation_next");
+		mainVC.put("back.overview", backOverviewButton);
 		
 		previousItemLink = LinkFactory.createButton("previous.item", mainVC, this);
 		previousItemLink.setIconLeftCSS("o_icon o_icon_previous");
@@ -118,8 +122,8 @@ public class CorrectionIdentityAssessmentItemNavigationController extends BasicC
 		if(itemCtrl == source) {
 			if(event instanceof NextAssessmentItemEvent) {
 				doNext(ureq);
-			} else if(event == Event.CANCELLED_EVENT) {
-				fireEvent(ureq, Event.CANCELLED_EVENT);
+			} else if(event == Event.CHANGED_EVENT || event == Event.CANCELLED_EVENT || event == Event.BACK_EVENT) {
+				fireEvent(ureq, event);
 			}
 		}
 		super.event(ureq, source, event);
@@ -127,7 +131,7 @@ public class CorrectionIdentityAssessmentItemNavigationController extends BasicC
 
 	@Override
 	protected void event(UserRequest ureq, Component source, Event event) {
-		if(backLink == source) {
+		if(backLink == source || backOverviewButton == source) {
 			fireEvent(ureq, Event.BACK_EVENT);
 		} else if(previousItemLink == source) {
 			doPrevious(ureq);
@@ -152,8 +156,10 @@ public class CorrectionIdentityAssessmentItemNavigationController extends BasicC
 		previousItemLink.setCustomDisplayText(previousText);
 		previousItemLink.setEnabled(previousEnable);
 		nextItemLink.setCustomDisplayText(nextText);
-		nextItemLink.setEnabled(nextEnable);
+		nextItemLink.setVisible(nextEnable);
+		backOverviewButton.setVisible(!nextEnable);
 		itemCtrl.updateNext(nextEnable);
+		mainVC.setDirty(true);//update the whole navigation bar
 	}
 
 	private void doPrevious(UserRequest ureq) {
@@ -176,7 +182,9 @@ public class CorrectionIdentityAssessmentItemNavigationController extends BasicC
 			AssessmentItemListEntry nextEntry = assessmentEntryList.get(index);
 			fireEvent(ureq, new SelectAssessmentItemEvent(nextEntry));
 		} else {
-			nextItemLink.setEnabled(false);
+			nextItemLink.setVisible(false);
+			backOverviewButton.setVisible(true);
+			mainVC.setDirty(true);//update the whole navigation bar
 		}
 	}
 	
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityListController.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityListController.java
index 6025335391c5e2e6575b7e0f21d4ce4ca09f7a41..144e77122cbac95d5ada67f8558d7606e0d346ec 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityListController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionIdentityListController.java
@@ -176,6 +176,10 @@ public class CorrectionIdentityListController extends FormBasicController {
 		saveTestsButton = uifactory.addFormLink("save.tests", formLayout, Link.BUTTON);
 	}
 	
+	public void reloadModel() {
+		loadModel(true, true);
+	}
+	
 	private void loadModel(boolean reset, boolean lastSessions) {
 		if(lastSessions) {
 			model.loadLastSessions();
@@ -289,6 +293,8 @@ public class CorrectionIdentityListController extends FormBasicController {
 				doUnlock();
 				loadModel(false, true);
 				stackPanel.popController(identityItemListCtrl);
+			} else if(event == Event.CHANGED_EVENT) {
+				fireEvent(ureq, Event.CHANGED_EVENT);
 			}
 		} else if(confirmSaveTestCtrl == source) {
 			if(event == Event.DONE_EVENT) {
@@ -361,7 +367,6 @@ public class CorrectionIdentityListController extends FormBasicController {
 		
 		cmc = new CloseableModalController(getWindowControl(), "close", confirmSaveTestCtrl.getInitialComponent(),
 				true, translate("save.tests"));
-		cmc.activate();
 		listenTo(cmc);
 		cmc.activate();
 	}
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewController.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewController.java
index 00fc91ff44a41641e9cc2b8d29e022334c972d1f..e6f8d8aaf8fdc8349ab813330e0138924226ee4d 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewController.java
@@ -108,7 +108,7 @@ public class CorrectionOverviewController extends BasicController implements Too
 		}
 
 		List<Identity> assessedIdentities = getAssessedIdentities();
-		model = new CorrectionOverviewModel(courseEntry, courseNode.getIdent(), testEntry,
+		model = new CorrectionOverviewModel(courseEntry, courseNode, testEntry,
 				resolvedAssessmentTest, manifestBuilder, assessedIdentities);
 		
 		segmentButtonsCmp = new ButtonGroupComponent("segments");
@@ -155,6 +155,8 @@ public class CorrectionOverviewController extends BasicController implements Too
 		if(assessmentItemsCtrl == source || identityListCtrl == source) {
 			if(event instanceof CompleteAssessmentTestSessionEvent) {
 				fireEvent(ureq, event);
+			} else if(event == Event.CHANGED_EVENT) {
+				fireEvent(ureq, Event.CHANGED_EVENT);
 			}
 		}
 	}
@@ -174,6 +176,8 @@ public class CorrectionOverviewController extends BasicController implements Too
 		if(assessmentItemsCtrl == null) {
 			assessmentItemsCtrl = new CorrectionAssessmentItemListController(ureq, getWindowControl(), stackPanel, model);
 			listenTo(assessmentItemsCtrl);
+		} else {
+			assessmentItemsCtrl.reloadModel();
 		}
 		stackPanel.popUpToController(this);
 		mainPanel.setContent(assessmentItemsCtrl.getInitialComponent());
@@ -183,6 +187,8 @@ public class CorrectionOverviewController extends BasicController implements Too
 		if(identityListCtrl == null) {
 			identityListCtrl = new CorrectionIdentityListController(ureq, getWindowControl(), stackPanel, model);
 			listenTo(identityListCtrl);
+		} else {
+			identityListCtrl.reloadModel();
 		}
 		stackPanel.popUpToController(this);
 		mainPanel.setContent(identityListCtrl.getInitialComponent());
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewModel.java b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewModel.java
index d23bbe31248ce67908eea0d7f8f9630f03656d22..43283150b7eb271b6689f72765184f42fe82dd50 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewModel.java
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/CorrectionOverviewModel.java
@@ -30,6 +30,9 @@ import java.util.concurrent.ConcurrentHashMap;
 
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.id.Identity;
+import org.olat.course.CourseFactory;
+import org.olat.course.nodes.IQTESTCourseNode;
+import org.olat.course.run.environment.CourseEnvironment;
 import org.olat.ims.qti21.AssessmentTestSession;
 import org.olat.ims.qti21.QTI21Service;
 import org.olat.ims.qti21.model.xml.ManifestBuilder;
@@ -54,9 +57,11 @@ import uk.ac.ed.ph.jqtiplus.state.TestSessionState;
  */
 public class CorrectionOverviewModel {
 	
-	private final String subIdent;
+	private CourseEnvironment courseEnv;
+	
 	private final RepositoryEntry testEntry;
 	private final RepositoryEntry courseEntry;
+	private final IQTESTCourseNode courseNode;
 	private final List<Identity> assessedIdentities;
 	private final ManifestBuilder manifestBuilder;
 	private final ResolvedAssessmentTest resolvedAssessmentTest;
@@ -68,12 +73,12 @@ public class CorrectionOverviewModel {
 	
 	private final QTI21Service qtiService;
 	
-	public CorrectionOverviewModel(RepositoryEntry courseEntry, String subIdent, RepositoryEntry testEntry,
+	public CorrectionOverviewModel(RepositoryEntry courseEntry, IQTESTCourseNode courseNode, RepositoryEntry testEntry,
 			ResolvedAssessmentTest resolvedAssessmentTest, ManifestBuilder manifestBuilder,
 			Map<Identity,AssessmentTestSession> lastSessions, Map<Identity, TestSessionState> testSessionStates) {
 		qtiService = CoreSpringFactory.getImpl(QTI21Service.class);
 		this.courseEntry = courseEntry;
-		this.subIdent = subIdent;
+		this.courseNode = courseNode;
 		this.testEntry = testEntry;
 		this.manifestBuilder = manifestBuilder;
 		this.resolvedAssessmentTest = resolvedAssessmentTest;
@@ -86,12 +91,12 @@ public class CorrectionOverviewModel {
 		}
 	}
 	
-	public CorrectionOverviewModel(RepositoryEntry courseEntry, String subIdent, RepositoryEntry testEntry,
+	public CorrectionOverviewModel(RepositoryEntry courseEntry, IQTESTCourseNode courseNode, RepositoryEntry testEntry,
 			ResolvedAssessmentTest resolvedAssessmentTest, ManifestBuilder manifestBuilder,
 			List<Identity> assessedIdentities) {
 		qtiService = CoreSpringFactory.getImpl(QTI21Service.class);
 		this.courseEntry = courseEntry;
-		this.subIdent = subIdent;
+		this.courseNode = courseNode;
 		this.testEntry = testEntry;
 		this.manifestBuilder = manifestBuilder;
 		this.resolvedAssessmentTest = resolvedAssessmentTest;
@@ -101,7 +106,22 @@ public class CorrectionOverviewModel {
 	}
 
 	public String getSubIdent() {
-		return subIdent;
+		return courseNode == null ? null : courseNode.getIdent();
+	}
+	
+	public IQTESTCourseNode getCourseNode() {
+		return courseNode;
+	}
+	
+	public CourseEnvironment getCourseEnvironment() {
+		if(courseEnv != null) {
+			return courseEnv;
+		}
+		
+		if(courseEntry != null && "CourseModule".equals(courseEntry.getOlatResource().getResourceableTypeName())) {
+			courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
+		}
+		return courseEnv;
 	}
 
 	public RepositoryEntry getTestEntry() {
@@ -149,7 +169,7 @@ public class CorrectionOverviewModel {
 	public Map<Identity,AssessmentTestSession> loadLastSessions() {
 		Set<Identity> identitiesSet = new HashSet<>(assessedIdentities);
 		List<AssessmentTestSession> sessions = CoreSpringFactory.getImpl(QTI21Service.class)
-				.getAssessmentTestSessions(courseEntry, subIdent, testEntry);
+				.getAssessmentTestSessions(courseEntry, getSubIdent(), testEntry);
 		Map<Identity,AssessmentTestSession> identityToSessions = new HashMap<>();
 		for(AssessmentTestSession session:sessions) {
 			//filter last session / user
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item.html b/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item.html
index ede8b8599207ec92b0798842acfd306b031cdbd5..6c67f673f6a88cf8da33824905bd1d7fb818e5da 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item.html
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item.html
@@ -5,5 +5,6 @@
 		$r.render("cancel")
 		$r.render("save")
 		$r.render("save.next")
+		$r.render("save.back")
 	</div>
 </div>
\ No newline at end of file
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item_list.html b/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item_list.html
index 4d317642c9c12dbc2c5434b5b15b77e413c72214..1a732b8053f5b09ccaf7cbd55add2428ef48f4d3 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item_list.html
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/_content/correction_identity_assessment_item_list.html
@@ -1,12 +1,16 @@
+<div class="clearfix">
+	$r.render("back")
+</div>
+
 <h4><i class="o_icon o_icon-fw o_icon_user"> </i> $r.escapeHtml($title)</h4>
 $r.render("table")
-#if($r.visible("cancel") || $r.visible("save"))
+#if($r.visible("save.tests") || $r.visible("back.overview"))
 <div class="o_button_group">
-	#if($r.visible("cancel"))
-		$r.render("cancel")
+	#if($r.visible("save.tests"))
+		$r.render("save.tests")
 	#end
-	#if($r.visible("save"))
-		$r.render("save")
+	#if($r.visible("back.overview"))
+		$r.render("back.overview")
 	#end
 </div>
 #end
\ No newline at end of file
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/_content/corrections_navigation.html b/src/main/java/org/olat/ims/qti21/ui/assessment/_content/corrections_navigation.html
index 135415c1edc6087132254278907c22065de57d40..5448565c3def5ab82a069637f754dc32c8bf437a 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/_content/corrections_navigation.html
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/_content/corrections_navigation.html
@@ -12,6 +12,7 @@
 		</select>
 	</div>
 	$r.render("next.item")
+	$r.render("back.overview")
 </div>
 $r.render("items")
 
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_de.properties
index 92f8d5277f0e32c26c932ce3277246417008ae2b..bf3579a36e2d535d8e74f97c88eb0543c9ff3679 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_de.properties
@@ -1,5 +1,6 @@
 #Tue Nov 15 16:25:36 CET 2016
 assessed.identity=Benutzer
+back.overview=Zur\u00FCck zur \u00DCbersicht
 number.assessed.identity={0}. Benutzer
 comment=Kommentar
 comment.help=Dieser Kommentar ist sichbar f\u00FCr den Benutzer in der Testzusammenfassung sowie f\u00FCr andere Betreuer.
@@ -21,6 +22,7 @@ not.responded=Die Frage wurde nicht beantwortet
 overview.tests=\u00DCbersicht und abschliessen
 previous.item=Vorherige Frage
 previous.user=Vorheriger Benutzer
+save.back=Speichern und zur \u00DCbersicht
 save.next=Speichern und n\u00E4chste Frage
 save.tests=Als endg\u00FCltiges Resultat speichern
 score=Punkte
diff --git a/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_en.properties
index 928c78e7c2d8d5e87c3ea60a91ef4c536ccfe676..45e2507241db0e086f7a6870a3646017fc4f255c 100644
--- a/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/ims/qti21/ui/assessment/_i18n/LocalStrings_en.properties
@@ -1,5 +1,6 @@
 #Tue Mar 13 18:56:55 CET 2018
 assessed.identity=assessed user
+back.overview=Back to overview
 comment=Comment
 comment.help=Comments are visible to user as to other coaches.
 comment.test=Test comment
@@ -21,6 +22,7 @@ override.score=Override score
 overview.tests=Overview and closing
 previous.item=Previous question
 previous.user=Previous user
+save.back=Save and back to overview
 save.next=Save and next question
 save.tests=Save results as completed
 score=Score
diff --git a/src/main/java/org/olat/ims/qti21/ui/editor/FeedbacksEditorController.java b/src/main/java/org/olat/ims/qti21/ui/editor/FeedbacksEditorController.java
index dc15839d99cb918d8c058d684de02f47f419133a..3ec419a9340dbf098b3e60e08c71f2730b2c0802 100644
--- a/src/main/java/org/olat/ims/qti21/ui/editor/FeedbacksEditorController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/editor/FeedbacksEditorController.java
@@ -43,8 +43,6 @@ import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.util.CodeHelper;
-import org.olat.core.util.StringHelper;
-import org.olat.core.util.filter.FilterFactory;
 import org.olat.core.util.vfs.VFSContainer;
 import org.olat.ims.qti21.model.xml.AssessmentItemBuilder;
 import org.olat.ims.qti21.model.xml.ModalFeedbackBuilder;
@@ -52,6 +50,7 @@ import org.olat.ims.qti21.model.xml.ModalFeedbackBuilder.ModalFeedbackType;
 import org.olat.ims.qti21.model.xml.ModalFeedbackCondition;
 import org.olat.ims.qti21.model.xml.ResponseIdentifierForFeedback;
 import org.olat.ims.qti21.model.xml.ResponseIdentifierForFeedback.Answer;
+import org.olat.ims.qti21.model.xml.TestFeedbackBuilder;
 import org.olat.ims.qti21.ui.ResourcesMapper;
 import org.olat.ims.qti21.ui.components.FlowFormItem;
 import org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent;
@@ -287,13 +286,13 @@ public class FeedbacksEditorController extends FormBasicController implements Sy
 	
 	@Override
 	protected boolean validateFormLogic(UserRequest ureq) {
-		boolean allOk = true;
+		boolean allOk = super.validateFormLogic(ureq);
 		
 		for(RuledFeedbackForm additionalForm:additionalForms) {
 			allOk &= additionalForm.validateFormLogic();
 		}
 		
-		return allOk & super.validateFormLogic(ureq);
+		return allOk;
 	}
 
 	@Override
@@ -353,8 +352,7 @@ public class FeedbacksEditorController extends FormBasicController implements Sy
 		}
 
 		public boolean isEmpty() {
-			String val = textEl.getValue();
-			return !StringHelper.containsNonWhitespace(FilterFactory.getHtmlTagsFilter().filter(val));
+			return TestFeedbackBuilder.isEmpty(textEl.getValue());
 		}
 		
 		public boolean isVisible() {
@@ -368,7 +366,7 @@ public class FeedbacksEditorController extends FormBasicController implements Sy
 		public void commit() {
 			String title = titleEl.getValue();
 			String text = textEl.getRawValue();
-			if(StringHelper.containsNonWhitespace(FilterFactory.getHtmlTagsFilter().filter(text))) {
+			if(!TestFeedbackBuilder.isEmpty(text) ) {
 				feedbackBuilder = itemBuilder.getFeedbackBuilder(feedbackType);
 				if(feedbackBuilder == null) {
 					feedbackBuilder = itemBuilder.createFeedbackBuilder(feedbackType);
@@ -496,7 +494,7 @@ public class FeedbacksEditorController extends FormBasicController implements Sy
 				feedbackConditions.add(condition.commit());
 			}
 			
-			if(StringHelper.containsNonWhitespace(FilterFactory.getHtmlTagsFilter().filter(text)) && feedbackConditions.size() > 0) {
+			if(!TestFeedbackBuilder.isEmpty(text) && !feedbackConditions.isEmpty()) {
 				if(feedbackBuilder == null) {
 					feedbackBuilder = itemBuilder.createFeedbackBuilder(feedbackType);
 				}
@@ -735,13 +733,11 @@ public class FeedbacksEditorController extends FormBasicController implements Sy
 				textValueEl.setVisible(!responseVar);
 				dropDownValueEl.setVisible(responseVar);
 				
-				String[] answerKeys = new String[] {};
-				String[] answerValues = new String[] {};
 				if(itemBuilder instanceof ResponseIdentifierForFeedback) {
 					ResponseIdentifierForFeedback responseFeedback = (ResponseIdentifierForFeedback)itemBuilder;
 					List<Answer> answers = responseFeedback.getAnswers();
-					answerKeys = new String[answers.size()];
-					answerValues = new String[answers.size()];
+					String[] answerKeys = new String[answers.size()];
+					String[] answerValues = new String[answers.size()];
 					
 					for(int i=0; i<answers.size(); i++) {
 						Answer answer = answers.get(i);
diff --git a/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java b/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java
index ed1934cbf14f076482b927d942b9aa6a7cb6e1eb..0bb1140b23f11a58bb8168ca48633beda147d488 100644
--- a/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java
+++ b/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java
@@ -1071,34 +1071,39 @@ public class LDAPLoginManagerImpl implements LDAPLoginManager, GenericEventListe
 			Identity identity = securityManager.loadIdentityByKey(identityRef.getKey());
 			Roles roles = securityManager.getRoles(identity);
 			switch(role) {
-				case author:
+				case coach:
 					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), roles.isUserManager(), roles.isGroupManager(), true,
-									false, roles.isInstitutionalResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), false);
+									false, roles.isLearnResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), roles.isCoach(), false);
+					securityManager.updateRoles(null, identity, organisation, roles);
+					break;
+				case author:
+					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), roles.isUserManager(), roles.isGroupManager(), roles.isAuthor(),
+									false, roles.isLearnResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), true, false);
 					securityManager.updateRoles(null, identity, organisation, roles);
 					break;
 				case usermanager:
 					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), true, roles.isGroupManager(), roles.isAuthor(),
-							false, roles.isInstitutionalResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), false);
+							false, roles.isLearnResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), roles.isCoach(), false);
 					securityManager.updateRoles(null, identity, organisation, roles);
 					break;
 				case groupmanager:
 					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), roles.isUserManager(), true, roles.isAuthor(),
-							false, roles.isInstitutionalResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), false);
+							false, roles.isLearnResourceManager(), roles.isPoolAdmin(), roles.isCurriculumManager(), roles.isCoach(), false);
 					securityManager.updateRoles(null, identity, organisation, roles);
 					break;
 				case poolmanager:
 					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), roles.isUserManager(), roles.isGroupManager(), roles.isAuthor(),
-							false, roles.isInstitutionalResourceManager(), true, roles.isCurriculumManager(), false);
+							false, roles.isLearnResourceManager(), true, roles.isCurriculumManager(), roles.isCoach(), false);
 					securityManager.updateRoles(null, identity, organisation, roles);
 					break;
 				case curriculummanager:
 					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), roles.isUserManager(), roles.isGroupManager(), roles.isAuthor(),
-							false, roles.isInstitutionalResourceManager(), roles.isPoolAdmin(), true, false);
+							false, roles.isLearnResourceManager(), roles.isPoolAdmin(), true, roles.isCoach(), false);
 					securityManager.updateRoles(null, identity, organisation, roles);
 					break;	
 				case learnresourcemanager:
 					roles = new Roles(roles.isSystemAdmin(), roles.isOLATAdmin(), roles.isUserManager(), roles.isGroupManager(), roles.isAuthor(),
-							false, true, roles.isPoolAdmin(), roles.isCurriculumManager(), false);
+							false, true, roles.isPoolAdmin(), roles.isCurriculumManager(), roles.isCoach(), false);
 					securityManager.updateRoles(null, identity, organisation, roles);
 					break;
 			}
diff --git a/src/main/java/org/olat/login/LoginModule.java b/src/main/java/org/olat/login/LoginModule.java
index 28299fe8bd91105661345208e55e75a1be640112..fe84b96288f7ad44b4ad6f609f9fea36b607e615 100644
--- a/src/main/java/org/olat/login/LoginModule.java
+++ b/src/main/java/org/olat/login/LoginModule.java
@@ -445,7 +445,7 @@ public class LoginModule extends AbstractSpringModule {
 		if(roles.isUserManager()) {
 			age = getMaxAgeOrDefault(age, passwordMaxAgeUserManager);
 		}
-		if(roles.isInstitutionalResourceManager()) {
+		if(roles.isLearnResourceManager()) {
 			age = getMaxAgeOrDefault(age, passwordMaxAgeLearnResourceManager);
 		}
 		if(roles.isPoolAdmin()) {
diff --git a/src/main/java/org/olat/modules/coach/site/CoachSiteDef.java b/src/main/java/org/olat/modules/coach/site/CoachSiteDef.java
index 327d422ce77ec7919f91e20d835d4a1e79a16d6a..54ab5e8aedf744b48e443026fca1a739d27bd63a 100644
--- a/src/main/java/org/olat/modules/coach/site/CoachSiteDef.java
+++ b/src/main/java/org/olat/modules/coach/site/CoachSiteDef.java
@@ -27,6 +27,7 @@ import org.olat.core.gui.control.navigation.SiteConfiguration;
 import org.olat.core.gui.control.navigation.SiteDefinition;
 import org.olat.core.gui.control.navigation.SiteInstance;
 import org.olat.core.util.StringHelper;
+import org.olat.core.util.UserSession;
 import org.olat.modules.coach.CoachingModule;
 import org.olat.modules.coach.CoachingService;
 
@@ -43,12 +44,12 @@ public class CoachSiteDef extends AbstractSiteDefinition implements SiteDefiniti
 
 	@Override
 	protected SiteInstance createSite(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
+		UserSession usess = ureq.getUserSession();
 		if(StringHelper.containsNonWhitespace(config.getSecurityCallbackBeanId())
-				|| (!ureq.getUserSession().getRoles().isGuestOnly()
-				&& !ureq.getUserSession().getRoles().isInvitee())) {
+				|| (!usess.getRoles().isGuestOnly() && !usess.getRoles().isInvitee())) {
 			CoachingService coachingService = CoreSpringFactory.getImpl(CoachingService.class);
-			if(ureq.getUserSession().getRoles().isOLATAdmin() 
-					|| ureq.getUserSession().getRoles().isUserManager()
+			if(usess.getRoles().isOLATAdmin() 
+					|| usess.getRoles().isUserManager()
 					|| coachingService.isCoach(ureq.getIdentity())) {
 				return new CoachSite(this, ureq.getLocale());
 			}
diff --git a/src/main/java/org/olat/modules/curriculum/site/CurriculumAdminSiteDef.java b/src/main/java/org/olat/modules/curriculum/site/CurriculumAdminSiteDef.java
index f801fbd5e3776d35bbaf7348fd402d8d9c8032fc..76857bbca1ed68703f4f936a58e4ff2f72324a28 100644
--- a/src/main/java/org/olat/modules/curriculum/site/CurriculumAdminSiteDef.java
+++ b/src/main/java/org/olat/modules/curriculum/site/CurriculumAdminSiteDef.java
@@ -42,7 +42,7 @@ public class CurriculumAdminSiteDef extends AbstractSiteDefinition implements Si
 		if(StringHelper.containsNonWhitespace(config.getSecurityCallbackBeanId())) {
 			return new CurriculumAdminSite(this, ureq.getLocale());
 		}
-		if(ureq.getUserSession().getRoles().isInstitutionalResourceManager()) {
+		if(ureq.getUserSession().getRoles().isLearnResourceManager()) {
 			// only for admins
 			return new CurriculumAdminSite(this, ureq.getLocale());
 		}
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 39b16076c7b270664e3d86b3b469e4d151befc50..955768dc2cece3c7fdf250a19830e7473259ec85 100644
--- a/src/main/java/org/olat/modules/forms/handler/EvaluationFormHandler.java
+++ b/src/main/java/org/olat/modules/forms/handler/EvaluationFormHandler.java
@@ -45,6 +45,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLog;
@@ -119,10 +120,11 @@ public class EvaluationFormHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			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);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		dbInstance.commit();
 		
 		File repositoryDir = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), FileResourceManager.ZIPDIR);
@@ -156,7 +158,7 @@ public class EvaluationFormHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		
 		EvaluationFormResource ores = new EvaluationFormResource();
 		OLATResource resource = olatResourceManager.createAndPersistOLATResourceInstance(ores);
@@ -164,7 +166,7 @@ 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);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		dbInstance.commit();
 		return re;
 	}
@@ -249,8 +251,7 @@ public class EvaluationFormHandler implements RepositoryHandler {
 			toolbar.setMessage(translator.translate("evaluation.form.in.use"));
 			toolbar.setMessageCssClass("o_warning");
 		}
-		EvaluationFormEditorController editorCtrl = new EvaluationFormEditorController(ureq, control, formFile, restrictedEdit);
-		return editorCtrl;
+		return new EvaluationFormEditorController(ureq, control, formFile, restrictedEdit);
 	}
 	
 	public File getFormFile(RepositoryEntry re) {
@@ -323,7 +324,7 @@ public class EvaluationFormHandler implements RepositoryHandler {
 			Path relativeFile = source.relativize(file);
 	        final Path destFile = Paths.get(destDir.toString(), relativeFile.toString());
 	        if(filter.matches(file)) {
-	        	Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING);
+	        		Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING);
 	        }
 	        return FileVisitResult.CONTINUE;
 		}
@@ -334,7 +335,7 @@ public class EvaluationFormHandler implements RepositoryHandler {
 			Path relativeDir = source.relativize(dir);
 	        final Path dirToCreate = Paths.get(destDir.toString(), relativeDir.toString());
 	        if(Files.notExists(dirToCreate)){
-	        	Files.createDirectory(dirToCreate);
+	        		Files.createDirectory(dirToCreate);
 	        }
 	        return FileVisitResult.CONTINUE;
 		}
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 76e989a96ee60d63db8235d44d41cc431573e1ed..ca2aa934a11bb12333bf0cbf8dc52e7cd4ddf936 100644
--- a/src/main/java/org/olat/modules/portfolio/handler/BinderTemplateHandler.java
+++ b/src/main/java/org/olat/modules/portfolio/handler/BinderTemplateHandler.java
@@ -36,6 +36,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLog;
@@ -98,11 +99,11 @@ public class BinderTemplateHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Organisation organisation, Locale locale) {
 		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);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		portfolioService.createAndPersistBinderTemplate(initialAuthor, re, locale);
 		DBFactory.getInstance().commit();
 		return re;
@@ -120,7 +121,7 @@ public class BinderTemplateHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
@@ -133,7 +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);
+			RepositoryEntry re = repositoryService
+					.create(initialAuthor, initialAuthorAlt, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 			
 			//import binder
 			File binderFile = new File(zipRoot, BinderTemplateResource.BINDER_XML);
@@ -189,15 +191,6 @@ public class BinderTemplateHandler implements RepositoryHandler {
 
 	@Override
 	public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
-		/*PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
-		Binder template = portfolioService.getBinderByResource(entry.getOlatResource());
-		if(portfolioService.isTemplateInUse(template, null, null)) {
-			Translator translator = Util.createPackageTranslator(PortfolioHomeController.class, locale);
-			errors.setError(translator.translate("warning.template.in.use",
-					new String[] { template.getTitle(), entry.getDisplayname() }));
-			return false;
-		}*/
-		
 		String referencesSummary = CoreSpringFactory.getImpl(ReferenceManager.class)
 				.getReferencesToSummary(entry.getOlatResource(), locale);
 		if (referencesSummary != null) {
diff --git a/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java b/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java
index 08c3bb114f81ab2310fe3c81d872223f13a99cda..6ce1ddd2aec7cff7091ca8289451056cc75e4d53 100644
--- a/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java
+++ b/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java
@@ -63,20 +63,19 @@ public class FeedRuntimeController extends RepositoryEntryRuntimeController {
 	@Override
 	protected void initSettingsTools(Dropdown settingsDropdown) {
 		super.initSettingsTools(settingsDropdown);
-		if (reSecurity.isEntryAdmin()) {
-			if (quotaManager.hasQuotaEditRights(getIdentity(), roles)) {
-				settingsDropdown.addComponent(new Spacer(""));
-				quotaLink = LinkFactory.createToolLink("quota", translate("tab.quota.edit"), this, "o_sel_repo_quota");
-				quotaLink.setIconLeftCSS("o_icon o_icon-fw o_icon_quota");
-				settingsDropdown.addComponent(quotaLink);
-			}
+		if (reSecurity.isEntryAdmin()
+				&& quotaManager.hasQuotaEditRights(getIdentity(), roles, getOrganisations())) {
+			settingsDropdown.addComponent(new Spacer(""));
+			quotaLink = LinkFactory.createToolLink("quota", translate("tab.quota.edit"), this, "o_sel_repo_quota");
+			quotaLink.setIconLeftCSS("o_icon o_icon-fw o_icon_quota");
+			settingsDropdown.addComponent(quotaLink);
 		}
 	}
 	
 	@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("Quota".equalsIgnoreCase(type)) {
 				doQuota(ureq);
@@ -95,11 +94,11 @@ public class FeedRuntimeController extends RepositoryEntryRuntimeController {
 	}
 	
 	private void doQuota(UserRequest ureq) {
-		if (quotaManager.hasQuotaEditRights(ureq.getIdentity(), roles)) {
+		if (quotaManager.hasQuotaEditRights(ureq.getIdentity(), roles, getOrganisations())) {
 			RepositoryEntry entry = getRepositoryEntry();
 			OlatRootFolderImpl feedRoot = FileResourceManager.getInstance().getFileResourceRootImpl(entry.getOlatResource());
 			WindowControl bwControl = getSubWindowControl("Quota");
-			Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), feedRoot.getRelPath());
+			Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), feedRoot.getRelPath(), getOrganisations());
 			pushController(ureq, translate("tab.quota.edit"), quotaCtrl);
 			setActiveTool(quotaLink);
 		}
diff --git a/src/main/java/org/olat/portfolio/manager/EPStructureManager.java b/src/main/java/org/olat/portfolio/manager/EPStructureManager.java
index 0edaf4b91706971f3e6307608f42c06bf13f2a44..4e8c1a9867e5bd91096313147763a69aa103abde 100755
--- a/src/main/java/org/olat/portfolio/manager/EPStructureManager.java
+++ b/src/main/java/org/olat/portfolio/manager/EPStructureManager.java
@@ -1706,7 +1706,7 @@ public class EPStructureManager {
 		return el;
 	}
 	
-	private EPStructureElement fillStructureElement(EPStructureElement el, String title, String description) {
+	protected EPStructureElement fillStructureElement(EPStructureElement el, String title, String description) {
 		el.setTitle(title);
 		el.setDescription(description);
 		OLATResource resource = resourceManager.createOLATResourceInstance(el.getClass());
@@ -1725,32 +1725,6 @@ public class EPStructureManager {
 		return el;
 	}
 	
-/**
- * Create a map template, create an OLAT resource and a repository entry with a security group
- * of type owner to the repository and add the identity has an owner.
- * @param identity
- * @param title
- * @param description
- * @return The structure element
- */
-	public PortfolioStructureMap createPortfolioMapTemplate(Identity identity, String title, String description) {
-		EPStructuredMapTemplate el = new EPStructuredMapTemplate();
-		
-		fillStructureElement(el, title, description);
-
-		//create a repository entry with default security settings
-		RepositoryEntry re = createRepositoryEntry(identity, el.getOlatResource(), title);
-		dbInstance.commit();
-		
-		Group ownerGroup = repositoryService.getDefaultGroup(re);
-		
-		EPStructureElementToGroupRelation relation = createBaseRelation(el, ownerGroup);
-		Set<EPStructureElementToGroupRelation> relations = new HashSet<>();
-		relations.add(relation);
-		el.setGroups(relations);
-		return el;
-	}
-	
 	/**
 	 * Import the structure.
 	 * @param root
@@ -1861,13 +1835,6 @@ public class EPStructureManager {
 		}
 	}
 	
-	private RepositoryEntry createRepositoryEntry(Identity identity, OLATResource oresable, String title) {
-		// create a repository entry
-		RepositoryEntry addedEntry = repositoryService.create(identity, null, "-", title, null, oresable, RepositoryEntry.ACC_OWNERS);
-
-		return addedEntry;
-	}
-	
 	private EPStructureElementToGroupRelation createBaseGroup(EPStructureElement element, Identity author) {
 		//create security group
 		Group ownerGroup = groupDao.createGroup();
@@ -1880,7 +1847,7 @@ public class EPStructureManager {
 		return relation;
 	}
 	
-	private EPStructureElementToGroupRelation createBaseRelation(EPStructureElement element, Group ownerGroup) {
+	protected EPStructureElementToGroupRelation createBaseRelation(EPStructureElement element, Group ownerGroup) {
 		//create security group
 		EPStructureElementToGroupRelation relation = new EPStructureElementToGroupRelation();
 		relation.setDefaultGroup(true);
diff --git a/src/main/java/org/olat/portfolio/manager/InvitationDAO.java b/src/main/java/org/olat/portfolio/manager/InvitationDAO.java
index a6c47da1f804e0037a4fa074e9fde46d9afd4ed9..fcc1cf8434262089b57bdeec7167c1727e340d5d 100644
--- a/src/main/java/org/olat/portfolio/manager/InvitationDAO.java
+++ b/src/main/java/org/olat/portfolio/manager/InvitationDAO.java
@@ -333,7 +333,7 @@ public class InvitationDAO {
 			for(Identity identity:identities) {
 				if(identity.getStatus().compareTo(Identity.STATUS_VISIBLE_LIMIT) >= 0) {
 					//already deleted
-				} else if(organisationDao.hasRole(identity, null, OrganisationRoles.user.name())) {//TODO roles perhaps an other role
+				} else if(organisationDao.hasAnyRole(identity, OrganisationRoles.invitee.name())) {
 					//out of scope
 				} else {
 					//delete user
diff --git a/src/main/java/org/olat/registration/RegistrationManager.java b/src/main/java/org/olat/registration/RegistrationManager.java
index 59b5d03f620dc9972afb98348c9d4a8e32632f16..49a03e643f6c26b84ebc144d260d3fcb31faa237 100644
--- a/src/main/java/org/olat/registration/RegistrationManager.java
+++ b/src/main/java/org/olat/registration/RegistrationManager.java
@@ -162,8 +162,10 @@ public class RegistrationManager {
 	 * @return the newly created subject or null
 	 */
 	public Identity createNewUserAndIdentityFromTemporaryKey(String login, String pwd, User myUser, TemporaryKey tk) {
-		Identity identity = securityManager.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(login, null, pwd, myUser);
-		if (identity == null) return null;
+		Identity identity = securityManager.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(login, null, pwd, myUser, null);
+		if (identity == null) {
+			return null;
+		}
 		deleteTemporaryKey(tk);
 		return identity;
 	}
@@ -399,7 +401,7 @@ public class RegistrationManager {
 			// don't use the discrete method to be more robust in case that more than one
 			// property is found
 			List<Property> disclaimerProperties = propertyManager.listProperties(identity, null, null, "user", "dislaimer_accepted");
-			needsToConfirm = ( disclaimerProperties.size() == 0);
+			needsToConfirm = disclaimerProperties.isEmpty();
 		}
 		return needsToConfirm;
 	}
diff --git a/src/main/java/org/olat/repository/RepositoryManager.java b/src/main/java/org/olat/repository/RepositoryManager.java
index 74576e4d58b04f031aaa2b80ebfa15c925863d86..fef92df4b3db146d8022b7c71dcb3deaaee5e172 100644
--- a/src/main/java/org/olat/repository/RepositoryManager.java
+++ b/src/main/java/org/olat/repository/RepositoryManager.java
@@ -36,6 +36,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.persistence.TypedQuery;
 
@@ -43,6 +44,8 @@ import org.olat.admin.securitygroup.gui.IdentitiesAddEvent;
 import org.olat.basesecurity.GroupRoles;
 import org.olat.basesecurity.IdentityImpl;
 import org.olat.basesecurity.IdentityRef;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.modules.bc.FolderConfig;
 import org.olat.core.commons.modules.bc.meta.MetaInfo;
@@ -56,8 +59,8 @@ import org.olat.core.gui.UserRequest;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
-import org.olat.core.id.UserConstants;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -133,6 +136,8 @@ public class RepositoryManager {
 	private LifeFullIndexer lifeIndexer;
 	@Autowired
 	private AutoAccessManager autoAccessManager;
+	@Autowired
+	private OrganisationService organisationService;
 
 	/**
 	 * @return Singleton.
@@ -232,8 +237,7 @@ public class RepositoryManager {
 		if(targetExtension.equals(".png") || targetExtension.equals(".jpg")) {
 			Size newImageSize = imageHelper.getSize(newImageFile, extension);
 			if(newImageSize != null && newImageSize.getWidth() <= PICTURE_WIDTH && newImageSize.getHeight() <= PICTURE_HEIGHT) {
-				boolean success = VFSManager.copyContent(newImageFile, repoImage);
-				return success;
+				return VFSManager.copyContent(newImageFile, repoImage);
 			}
 		}
 
@@ -959,30 +963,31 @@ public class RepositoryManager {
 	 * @return
 	 */
 	public List<RepositoryEntry> queryByTypeLimitAccess(Identity identity, Roles roles, List<String> restrictedType) {
-		if(restrictedType == null | restrictedType.isEmpty()) return Collections.emptyList();
-
-		String institution = identity.getUser().getProperty(UserConstants.INSTITUTIONALNAME, null);
-		List<RepositoryEntry> results = new ArrayList<RepositoryEntry>();
-		if(!roles.isOLATAdmin() && institution != null && institution.length() > 0 && roles.isInstitutionalResourceManager()) {
-			StringBuilder sb = new StringBuilder(400);
-			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")
-			  .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(" inner join membership.identity as identity")
-			  .append(" inner join identity.user as user")
-			  .append(" where user.institutionalName=:institutionCourseManager")
-			  .append(" and res.resName in (:restrictedType) and v.access = 1");
-
-			List<RepositoryEntry> institutionalResults = dbInstance.getCurrentEntityManager()
-					.createQuery(sb.toString(), RepositoryEntry.class)
-					.setParameter("restrictedType", restrictedType)
-					.setParameter("institutionCourseManager", institution)
-					.getResultList();
-			results.addAll(institutionalResults);
+		if(restrictedType == null || restrictedType.isEmpty()) return Collections.emptyList();
+
+		List<RepositoryEntry> results = new ArrayList<>();
+		if(!roles.isOLATAdmin() && roles.isLearnResourceManager()) {
+			List<Organisation> managedOrganisations = organisationService.getManageableOrganisations(identity, roles, OrganisationRoles.learnresourcemanager);
+			if(!managedOrganisations.isEmpty()) {
+				StringBuilder sb = new StringBuilder(400);
+				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")
+				  .append(" left join fetch v.lifecycle as lifecycle")
+				  .append(" inner join v.organisations as relToOrg")
+				  .append(" where relToOrg.organisation.key in (:managedOrganisationsKey)")
+				  .append(" and res.resName in (:restrictedType) and v.access = 1");
+				
+				List<Long> managedOrganisationsKey = managedOrganisations
+						.stream().map(Organisation::getKey).collect(Collectors.toList());
+	
+				List<RepositoryEntry> institutionalResults = dbInstance.getCurrentEntityManager()
+						.createQuery(sb.toString(), RepositoryEntry.class)
+						.setParameter("restrictedType", restrictedType)
+						.setParameter("managedOrganisationsKey", managedOrganisationsKey)
+						.getResultList();
+				results.addAll(institutionalResults);
+			}
 		}
 
 		long start = System.currentTimeMillis();
@@ -1131,7 +1136,7 @@ public class RepositoryManager {
 		}
 		if (!roles.isAuthor()) {
 			// if user has no author right he can not reference to any resource at all
-			return new ArrayList<RepositoryEntry>();
+			return new ArrayList<>();
 		}
 		return queryResourcesLimitType(identity, resourceTypes, displayName, author, desc, true, false);
 	}
@@ -1154,9 +1159,9 @@ public class RepositoryManager {
 		if (identity == null) {
 			throw new AssertException("identity can not be null!");
 		}
-		if (!roles.isAuthor()) {
+		if (!roles.isAuthor() && !roles.isOLATAdmin()) {
 			// if user has no author right he can not reference to any resource at all
-			return new ArrayList<RepositoryEntry>();
+			return new ArrayList<>();
 		}
 		return queryResourcesLimitType(identity, resourceTypes, displayName, author, desc, false, true);
 	}
@@ -1274,12 +1279,11 @@ public class RepositoryManager {
 		}
 		sb.append(")");
 
-		List<RepositoryEntry> entries = dbInstance.getCurrentEntityManager()
+		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), RepositoryEntry.class)
 				.setParameter("identityKey", identity.getKey())
 				.setParameter("limitAccess", limitAccess)
 				.getResultList();
-		return entries;
 	}
 
 	/**
@@ -1335,14 +1339,12 @@ public class RepositoryManager {
 	}
 
 	public List<RepositoryEntry> genericANDQueryWithRolesRestriction(SearchRepositoryEntryParameters params, int firstResult, int maxResults, boolean orderBy) {
-
 		TypedQuery<RepositoryEntry> dbQuery = createGenericANDQueryWithRolesRestriction(params, orderBy, RepositoryEntry.class);
 		dbQuery.setFirstResult(firstResult);
 		if(maxResults > 0) {
 			dbQuery.setMaxResults(maxResults);
 		}
-		List<RepositoryEntry> res = dbQuery.getResultList();
-		return res;
+		return dbQuery.getResultList();
 	}
 
 	private <T> TypedQuery<T> createGenericANDQueryWithRolesRestriction(SearchRepositoryEntryParameters params, boolean orderBy, Class<T> type) {
@@ -1352,9 +1354,8 @@ public class RepositoryManager {
 		final List<String> resourceTypes = params.getResourceTypes();
 		final Identity identity = params.getIdentity();
 		final Roles roles = params.getRoles();
-		final String institution = params.getInstitution();
 
-		boolean institut = (!roles.isOLATAdmin() && institution != null && institution.length() > 0 && roles.isInstitutionalResourceManager());
+		boolean isLearnResourceManager = (!roles.isOLATAdmin() && roles.isLearnResourceManager());
 		boolean var_author = StringHelper.containsNonWhitespace(author);
 		boolean var_displayname = StringHelper.containsNonWhitespace(displayName);
 		boolean var_desc = StringHelper.containsNonWhitespace(desc);
@@ -1382,11 +1383,12 @@ public class RepositoryManager {
 		}
 
 		boolean setIdentity = false;
+		List<Long> managedOrganisationKeys = null;
 
 		//access rules
 		if(roles.isOLATAdmin()) {
 			query.append(" where v.access!=0 ");
-		} else if(institut) {
+		} else if(isLearnResourceManager) {
 			query.append(" where (v.access >=");
 			if (roles.isAuthor()) {
 				query.append(RepositoryEntry.ACC_OWNERS_AUTHORS);
@@ -1396,12 +1398,12 @@ public class RepositoryManager {
 				query.append(RepositoryEntry.ACC_USERS);
 			}
 			query.append(" or (");
-			query.append("v.access=1 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 user.institutionalName=:institution and membership.role='").append(GroupRoles.owner.name()).append("'")
+			query.append("v.access=1 and exists (select relToOrg.key from repoentrytoorganisation as relToOrg")
+	             .append("    where relToOrg.entry.key=v.key and relToOrg.organisation.key in (:managedOrganisationKeys)")
 	             .append(")))");
-
+			
+			List<Organisation> organisations = organisationService.getManageableOrganisations(identity, roles, OrganisationRoles.learnresourcemanager);
+			managedOrganisationKeys = organisations.stream().map(Organisation::getKey).collect(Collectors.toList());
 		} else if (params.isOnlyOwnedResources()) {
 			query.append(" where (v.access>0 and 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")
@@ -1445,16 +1447,12 @@ public class RepositoryManager {
 		}
 
 		if (var_displayname) {
-			//displayName = '%' + displayName.replace('*', '%') + '%';
-			//query.append(" and v.displayname like :displayname");
 			displayName = PersistenceHelper.makeFuzzyQueryString(displayName);
 			query.append(" and ");
 			PersistenceHelper.appendFuzzyLike(query, "v.displayname", "displayname", dbInstance.getDbVendor());
 		}
 
 		if (var_desc) {
-			//desc = '%' + desc.replace('*', '%') + '%';
-			//query.append(" and v.description like :desc");
 			desc = PersistenceHelper.makeFuzzyQueryString(desc);
 			query.append(" and ");
 			PersistenceHelper.appendFuzzyLike(query, "v.description", "desc", dbInstance.getDbVendor());
@@ -1497,8 +1495,8 @@ public class RepositoryManager {
 		}
 
 		TypedQuery<T> dbQuery = dbInstance.getCurrentEntityManager().createQuery(query.toString(), type);
-		if(institut) {
-			dbQuery.setParameter("institution", institution);
+		if(managedOrganisationKeys != null) {
+			dbQuery.setParameter("managedOrganisationKeys", managedOrganisationKeys);
 		}
 		if(params.getParentEntry() != null) {
 			dbQuery.setParameter("parentCeiKey", params.getParentEntry().getKey());
@@ -1912,30 +1910,20 @@ public class RepositoryManager {
 			return false;
 		}
 
-		String currentUserInstitutionalName = identity.getUser().getProperty(UserConstants.INSTITUTIONALNAME, null);
-		if(!StringHelper.containsNonWhitespace(currentUserInstitutionalName)) {
+		if(!roles.isLearnResourceManager()) {
 			return false;
 		}
-
-		if(!roles.isInstitutionalResourceManager()) {
-			return false;
+		
+		List<OrganisationRef> learnResourceManagerOrganisations = roles.getOrganisationsWithRoles(OrganisationRoles.learnresourcemanager);
+		List<OrganisationRef> repositoryOrganisations = repositoryEntryToOrganisationDao.getOrganisationReferences(repositoryEntry);
+		for(OrganisationRef learnResourceManagerOrganisation:learnResourceManagerOrganisations) {
+			for(OrganisationRef repositoryOrganisation:repositoryOrganisations) {
+				if(learnResourceManagerOrganisation.getKey().equals(repositoryOrganisation.getKey())) {
+					return true;
+				}
+			}
 		}
-
-		StringBuilder sb = new StringBuilder();
-		sb.append("select count(v) from ").append(RepositoryEntry.class.getName()).append(" v")
-		  .append(" inner join v.groups as relGroup")
-		  .append(" inner join relGroup.group as baseGroup")
-		  .append(" inner join baseGroup.members as membership")
-		  .append(" inner join membership.identity as identity")
-		  .append(" inner join identity.user as user")
-		  .append(" where v.key=:repoKey and user.institutionalName=:institutionCourseManager");
-
-		Number count = dbInstance.getCurrentEntityManager()
-				.createQuery(sb.toString(), Number.class)
-				.setParameter("repoKey", repositoryEntry.getKey())
-				.setParameter("institutionCourseManager", currentUserInstitutionalName)
-				.getSingleResult();
-		return count == null ? false : count.intValue() > 0;
+		return false;
 	}
 
 	public int countLearningResourcesAsStudent(IdentityRef identity) {
diff --git a/src/main/java/org/olat/repository/RepositoryService.java b/src/main/java/org/olat/repository/RepositoryService.java
index 8a6761654759b38b9dd0b772fc68f77e001ec80b..48f3df6e1952d0078b59d3725ad66250c44900b8 100644
--- a/src/main/java/org/olat/repository/RepositoryService.java
+++ b/src/main/java/org/olat/repository/RepositoryService.java
@@ -30,6 +30,7 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.core.util.vfs.VFSLeaf;
@@ -53,10 +54,8 @@ public interface RepositoryService {
 
 
 	public RepositoryEntry create(Identity initialAuthor, String initialAuthorAlt,
-			String resourceName, String displayname, String description, OLATResource resource, int access);
-
-	public RepositoryEntry create(String initialAuthor, String resourceName,
-			String displayname, String description, OLATResource resource);
+			String resourceName, String displayname, String description,
+			OLATResource resource, int access, Organisation organisation);
 
 	public RepositoryEntry copy(RepositoryEntry sourceEntry, Identity author, String displayname);
 
@@ -306,6 +305,13 @@ public interface RepositoryService {
 	 */
 	public RepositoryEntry addOrganisation(RepositoryEntry entry, Organisation organisation, boolean master);
 	
+	/**
+	 * 
+	 * @param entry
+	 * @return
+	 */
+	public List<OrganisationRef> getOrganisationReferences(RepositoryEntryRef entry);
+	
 	
 	
 	
diff --git a/src/main/java/org/olat/repository/controllers/ReferencableEntriesSearchController.java b/src/main/java/org/olat/repository/controllers/ReferencableEntriesSearchController.java
index 72c1c9e2cbb626071618800279002dc1621b4682..7e9ce32d45532a1ba3247a17d4526e55244d8ada 100644
--- a/src/main/java/org/olat/repository/controllers/ReferencableEntriesSearchController.java
+++ b/src/main/java/org/olat/repository/controllers/ReferencableEntriesSearchController.java
@@ -30,7 +30,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.olat.core.CoreSpringFactory;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.dropdown.Dropdown;
@@ -107,6 +106,8 @@ public class ReferencableEntriesSearchController extends BasicController {
 	
 	private Object userObject;
 	
+	@Autowired
+	private BusinessGroupModule businessGroupModule;
 	@Autowired
 	private RepositoryHandlerFactory repositoryHandlerFactory;
 
@@ -221,9 +222,8 @@ public class ReferencableEntriesSearchController extends BasicController {
 		Roles roles = ureq.getUserSession().getRoles();
 		return limitingTypes != null && limitingTypes.length == 1 && "CourseModule".equals(limitingTypes[0])
 				&& (roles.isOLATAdmin() ||
-						(roles.isInstitutionalResourceManager() && roles.isGroupManager()) ||
-						(roles.isGroupManager()
-								&& CoreSpringFactory.getImpl(BusinessGroupModule.class).isGroupManagersAllowedToLinkCourses()));
+						(roles.isLearnResourceManager() && roles.isGroupManager()) ||
+						(roles.isGroupManager() && businessGroupModule.isGroupManagersAllowedToLinkCourses()));
 	}
 	
 	/**
@@ -342,7 +342,6 @@ public class ReferencableEntriesSearchController extends BasicController {
 				selectedRepositoryEntries = searchCtr.getSelectedEntries();
 				fireEvent(ureq, EVENT_REPOSITORY_ENTRIES_SELECTED);
 			}
-			//initLinks();
 		} else if (source == createController) { 
 			if (event.equals(Event.DONE_EVENT)) {
 				cmc.deactivate();
@@ -374,10 +373,7 @@ public class ReferencableEntriesSearchController extends BasicController {
 		}
 	}
 	
-
-	/**
-	 * @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
-	 */
+	@Override
 	protected void doDispose() {
 		//
 	}
diff --git a/src/main/java/org/olat/repository/controllers/RepositorySearchController.java b/src/main/java/org/olat/repository/controllers/RepositorySearchController.java
index d211b49b7de703dfa438932a669e32a8cf10014c..e17cad77190ac4e8d46c58b166bde71727562e8e 100644
--- a/src/main/java/org/olat/repository/controllers/RepositorySearchController.java
+++ b/src/main/java/org/olat/repository/controllers/RepositorySearchController.java
@@ -256,7 +256,7 @@ public class RepositorySearchController extends BasicController implements Activ
 			restrictedTypes = Collections.singletonList(limitType);
 		} else {
 			Collection<String> s = searchForm.getRestrictedTypes();
-			restrictedTypes = (s == null) ? null : new ArrayList<String>(s);
+			restrictedTypes = (s == null) ? null : new ArrayList<>(s);
 		}
 		Roles roles = ureq.getUserSession().getRoles();
 		Identity ident = ureq.getIdentity();
@@ -272,7 +272,7 @@ public class RepositorySearchController extends BasicController implements Activ
 		} else if(enableSearchforAllInSearchForm == Can.copyable){
 			entries = rm.queryCopyableResourcesLimitType(ident, roles, restrictedTypes, name, author, desc);
 		} else {
-			entries = new ArrayList<RepositoryEntry>();
+			entries = new ArrayList<>();
 		}
 		filterRepositoryEntries(entries);
 		repoTableModel.setObjects(entries);
@@ -308,7 +308,7 @@ public class RepositorySearchController extends BasicController implements Activ
 	 */
 	public void doSearchForReferencableResourcesLimitType(Identity owner, String[] limitTypes, Roles roles) {
 		RepositoryManager rm = RepositoryManager.getInstance();
-		List<String> restrictedTypes = new ArrayList<String>();
+		List<String> restrictedTypes = new ArrayList<>();
 		if(limitTypes == null) {
 			restrictedTypes = null;
 		}
diff --git a/src/main/java/org/olat/repository/handlers/BlogHandler.java b/src/main/java/org/olat/repository/handlers/BlogHandler.java
index da468173d2eb041d1120bfcf36c86c68266e76d1..9c7e4ce100bbf0aa81e7ffb99ac725f9f00fa570 100644
--- a/src/main/java/org/olat/repository/handlers/BlogHandler.java
+++ b/src/main/java/org/olat/repository/handlers/BlogHandler.java
@@ -35,6 +35,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.Util;
@@ -87,11 +88,12 @@ public class BlogHandler implements RepositoryHandler {
 	}
 
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -108,7 +110,7 @@ public class BlogHandler implements RepositoryHandler {
 
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname,
-			String description, boolean withReferences, Locale locale, File file, String filename) {
+			String description, boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 
 		OLATResource resource = OLATResourceManager.getInstance().createAndPersistOLATResourceInstance(new BlogFileResource());
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(resource).getBasefile();
@@ -116,7 +118,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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, 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 49cb4054e562652ea62cb091fbc1756f0897377e..d111561f3ef22db3b44ad946b271c971ed17e58c 100644
--- a/src/main/java/org/olat/repository/handlers/CourseHandler.java
+++ b/src/main/java/org/olat/repository/handlers/CourseHandler.java
@@ -50,13 +50,13 @@ import org.olat.core.gui.control.generic.layout.MainLayoutController;
 import org.olat.core.gui.control.generic.wizard.Step;
 import org.olat.core.gui.control.generic.wizard.StepRunnerCallback;
 import org.olat.core.gui.control.generic.wizard.StepsMainRunController;
-import org.olat.core.gui.control.generic.wizard.StepsRunContext;
 import org.olat.core.gui.media.CleanupAfterDeliveryFileMediaResource;
 import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.helpers.Settings;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -141,10 +141,12 @@ public class CourseHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			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);
+		RepositoryEntry re = repositoryService
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 
 		String shortDisplayname = Formatter.truncateOnly(displayname, 25);
@@ -219,18 +221,17 @@ public class CourseHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname,
-			String description, boolean withReferences, Locale locale, File file, String filename) {
+			String description, boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 
 		OLATResource newCourseResource = OLATResourceManager.getInstance().createOLATResourceInstance(CourseModule.class);
 		ICourse course = CourseFactory.importCourseFromZip(newCourseResource, file);
-		// cfc.release();
 		if (course == null) {
 			return null;
 		}
 
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		RepositoryEntry re = repositoryService
-				.create(initialAuthor, null, "", displayname, description, newCourseResource, RepositoryEntry.ACC_OWNERS);
+				.create(initialAuthor, null, "", displayname, description, newCourseResource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 
 		// create empty run structure
@@ -241,12 +242,12 @@ public class CourseHandler implements RepositoryHandler {
 		
 		//import references
 		CourseEditorTreeNode rootNode = (CourseEditorTreeNode)course.getEditorTreeModel().getRootNode();
-		importReferences(rootNode, course, initialAuthor, locale, withReferences);
+		importReferences(rootNode, course, initialAuthor, organisation, locale, withReferences);
 		if(withReferences && course.getCourseConfig().hasCustomSharedFolder()) {
-			importSharedFolder(course, initialAuthor);
+			importSharedFolder(course, initialAuthor, organisation);
 		}
 		if(withReferences && course.getCourseConfig().hasGlossary()) {
-			importGlossary(course, initialAuthor);
+			importGlossary(course, initialAuthor, organisation);
 		}
 
 		// create group management / import groups
@@ -281,7 +282,7 @@ public class CourseHandler implements RepositoryHandler {
 			course.getRunStructure().getRootNode().setShortTitle(Formatter.truncateOnly(displayname, 25)); //do not use truncate!
 			course.getRunStructure().getRootNode().setLongTitle(displayname);
 		}
-		//course.saveRunStructure();
+		
 		CourseEditorTreeNode editorRootNode = ((CourseEditorTreeNode)course.getEditorTreeModel().getRootNode());
 		editorRootNode.getCourseNode().setShortTitle(Formatter.truncateOnly(displayname, 25)); //do not use truncate!
 		editorRootNode.getCourseNode().setLongTitle(displayname);
@@ -318,7 +319,7 @@ public class CourseHandler implements RepositoryHandler {
 		}
 	}
 	
-	private void importSharedFolder(ICourse course, Identity owner) {
+	private void importSharedFolder(ICourse course, Identity owner, Organisation organisation) {
 		SharedFolderManager sfm = SharedFolderManager.getInstance();
 		RepositoryEntryImportExport importExport = sfm.getRepositoryImportExport(course.getCourseExportDataDir().getBasefile());
 		
@@ -339,7 +340,7 @@ 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, 0);
+				importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores, 0, organisation);
 
 		// set the new shared folder reference
 		CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
@@ -350,7 +351,7 @@ public class CourseHandler implements RepositoryHandler {
 		CourseFactory.setCourseConfig(course.getResourceableId(), courseConfig);
 	}
 	
-	private void importGlossary(ICourse course, Identity owner) {
+	private void importGlossary(ICourse course, Identity owner, Organisation organisation) {
 		GlossaryManager gm = GlossaryManager.getInstance();
 		RepositoryEntryImportExport importExport = gm.getRepositoryImportExport(course.getCourseExportDataDir().getBasefile());
 		GlossaryResource resource = gm.createGlossary();
@@ -373,7 +374,7 @@ public class CourseHandler implements RepositoryHandler {
 		OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(resource);
 		
 		RepositoryEntry importedRepositoryEntry = repositoryService.create(owner,
-				null, importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores, 0);
+				null, importExport.getResourceName(), importExport.getDisplayName(), importExport.getDescription(), ores, 0, organisation);
 
 			// set the new glossary reference
 		CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
@@ -382,13 +383,13 @@ public class CourseHandler implements RepositoryHandler {
 		CourseFactory.setCourseConfig(course.getResourceableId(), courseConfig);
 	}
 	
-	private void importReferences(CourseEditorTreeNode node, ICourse course, Identity owner, Locale locale, boolean withReferences) {
-		node.getCourseNode().importNode(course.getCourseExportDataDir().getBasefile(), course, owner, locale, withReferences);
+	private void importReferences(CourseEditorTreeNode node, ICourse course, Identity owner, Organisation organisation, Locale locale, boolean withReferences) {
+		node.getCourseNode().importNode(course.getCourseExportDataDir().getBasefile(), course, owner, organisation, locale, withReferences);
 
 		for (int i = 0; i<node.getChildCount(); i++) {
 			INode child = node.getChildAt(i);
 			if(child instanceof CourseEditorTreeNode) {
-				importReferences((CourseEditorTreeNode)child, course, owner, locale, withReferences);
+				importReferences((CourseEditorTreeNode)child, course, owner, organisation, locale, withReferences);
 			}
 		}
 	}
@@ -568,8 +569,7 @@ public class CourseHandler implements RepositoryHandler {
 		final CourseCreationConfiguration courseConfig = new CourseCreationConfiguration(course.getCourseTitle(), Settings.getServerContextPathURI() + "/url/RepositoryEntry/" + repoEntry.getKey());
 		// wizard finish callback called after "finish" is called
 		final CourseCreationHelper ccHelper = new CourseCreationHelper(ureq.getLocale(), repoEntry, courseConfig , course);
-		StepRunnerCallback finishCallback = new StepRunnerCallback() {
-			public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
+		StepRunnerCallback finishCallback = (uureq, control, runContext) -> {
 				// retrieve access and properties
 				CourseAccessAndProperties accessAndProps = (CourseAccessAndProperties) runContext.get("accessAndProperties");
 				courseConfig.setAccessAndProperties(accessAndProps);
@@ -581,11 +581,10 @@ public class CourseHandler implements RepositoryHandler {
 				final MailerResult mr = CourseCreationMailHelper.sentNotificationMail(uureq, ccHelper.getConfiguration());
 				MailHelper.printErrorsAndWarnings(mr, control, uureq.getUserSession().getRoles().isOLATAdmin(), uureq.getLocale());
 				return StepsMainRunController.DONE_MODIFIED;
-			}
-		};
+			};
+
 		Step start  = new CcStep00(ureq, courseConfig, repoEntry);
-		StepsMainRunController ccSMRC = new StepsMainRunController(ureq, wControl, start, finishCallback, null, cceTranslator.translate("coursecreation.title"), "o_sel_course_create_wizard");
-		return ccSMRC;
+		return new StepsMainRunController(ureq, wControl, start, finishCallback, null, cceTranslator.translate("coursecreation.title"), "o_sel_course_create_wizard");
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/handlers/GlossaryHandler.java b/src/main/java/org/olat/repository/handlers/GlossaryHandler.java
index 4dd84090d84ddf4a62c6b17ab2b6298e57c17551..ce03178557fed10b567abc3785cd983fc80f4111 100644
--- a/src/main/java/org/olat/repository/handlers/GlossaryHandler.java
+++ b/src/main/java/org/olat/repository/handlers/GlossaryHandler.java
@@ -47,6 +47,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.FileUtils;
@@ -92,11 +93,12 @@ public class GlossaryHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		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);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -118,14 +120,14 @@ public class GlossaryHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		GlossaryResource glossaryResource = GlossaryManager.getInstance().createGlossary();
 		OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(glossaryResource);
 		//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);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, 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 cbf5676a25d5d9d1b18af0d10d27f1fdc7f95ddd..272c02b3c5d38da94b48701add1095d9f52622fc 100644
--- a/src/main/java/org/olat/repository/handlers/ImsCPHandler.java
+++ b/src/main/java/org/olat/repository/handlers/ImsCPHandler.java
@@ -45,6 +45,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.Util;
@@ -93,10 +94,11 @@ public class ImsCPHandler extends FileHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 
 		Translator translator = Util.createPackageTranslator(CPContentController.class, locale);
@@ -122,12 +124,12 @@ public class ImsCPHandler extends FileHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 
 		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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, 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 682d0f7e9171eb8383e82ec9506cfb0a82f90763..406acecf580b90cd33fbf2ad4c5a7d6ab94b8501 100644
--- a/src/main/java/org/olat/repository/handlers/PodcastHandler.java
+++ b/src/main/java/org/olat/repository/handlers/PodcastHandler.java
@@ -35,6 +35,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.Util;
@@ -42,7 +43,6 @@ import org.olat.core.util.coordinate.CoordinatorManager;
 import org.olat.core.util.coordinate.LockResult;
 import org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent;
 import org.olat.core.util.vfs.VFSContainer;
-import org.olat.course.assessment.AssessmentMode;
 import org.olat.course.assessment.manager.UserCourseInformationsManager;
 import org.olat.fileresource.FileResourceManager;
 import org.olat.fileresource.types.FileResource;
@@ -61,7 +61,6 @@ import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.RepositoryEntrySecurity;
-import org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator;
 import org.olat.resource.OLATResource;
 import org.olat.resource.OLATResourceManager;
 import org.olat.resource.references.ReferenceManager;
@@ -87,11 +86,12 @@ public class PodcastHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		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);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -108,7 +108,7 @@ public class PodcastHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		
 		OLATResource resource = OLATResourceManager.getInstance().createAndPersistOLATResourceInstance(new PodcastFileResource());
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(resource).getBasefile();
@@ -116,7 +116,7 @@ public class PodcastHandler 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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -137,9 +137,6 @@ public class PodcastHandler implements RepositoryHandler {
 	@Override
 	public boolean cleanupOnDelete(RepositoryEntry entry, OLATResourceable res) {
 		CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res);
-		// For now, notifications are not implemented since a podcast feed is meant
-		// to be subscriped to anyway.
-		// NotificationsManager.getInstance().deletePublishersOf(res);
 		FeedManager.getInstance().deleteFeed(res);
 		return true;
 	}
@@ -169,16 +166,12 @@ public class PodcastHandler implements RepositoryHandler {
 		SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
 		callback.setSubscriptionContext(subsContext);
 		return new FeedRuntimeController(ureq, wControl, re, reSecurity,
-			new RuntimeControllerCreator() {
-				@Override
-				public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel,
-						RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
+				(uureq, wwControl, toolbarPanel, entry, security, assessmentMode) -> {
 					CoreSpringFactory.getImpl(UserCourseInformationsManager.class)
 						.updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
 					return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null,
 						PodcastUIFactory.getInstance(uureq.getLocale()), callback, null);
-				}
-		});
+				});
 	}
 	
 	@Override
diff --git a/src/main/java/org/olat/repository/handlers/PortfolioHandler.java b/src/main/java/org/olat/repository/handlers/PortfolioHandler.java
index 476291909c52edff0b007cb7dc4c7b9a7037c4d1..4b3a7bcb6460ac9d474d9eb62b011773459b8702 100644
--- a/src/main/java/org/olat/repository/handlers/PortfolioHandler.java
+++ b/src/main/java/org/olat/repository/handlers/PortfolioHandler.java
@@ -37,6 +37,7 @@ import org.olat.core.gui.media.StreamedMediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLog;
@@ -94,13 +95,14 @@ public class PortfolioHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
 		EPStructureManager eSTMgr = CoreSpringFactory.getImpl(EPStructureManager.class);
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		
 		OLATResource resource = eSTMgr.createPortfolioMapTemplateResource();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 
 		PortfolioStructureMap mapTemp = eSTMgr.createAndPersistPortfolioMapTemplateFromEntry(initialAuthor, re);
 		// add a page, as each map should have at least one per default!
@@ -126,7 +128,7 @@ public class PortfolioHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
 		EPStructureManager eSTMgr = CoreSpringFactory.getImpl(EPStructureManager.class);
 		
@@ -135,7 +137,7 @@ public class PortfolioHandler implements RepositoryHandler {
 		if(structure != null) {
 			OLATResource resource = eSTMgr.createPortfolioMapTemplateResource();
 			re = CoreSpringFactory.getImpl(RepositoryService.class)
-					.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
+					.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 			ePFMgr.importPortfolioMapTemplate(structure, resource);
 		}
 		return re;
diff --git a/src/main/java/org/olat/repository/handlers/RepositoryHandler.java b/src/main/java/org/olat/repository/handlers/RepositoryHandler.java
index d4a52561448afd16ac358f845d7db1fc659e4493..319890e081023986c9a48dbe9deb65b531d11a09 100644
--- a/src/main/java/org/olat/repository/handlers/RepositoryHandler.java
+++ b/src/main/java/org/olat/repository/handlers/RepositoryHandler.java
@@ -37,6 +37,7 @@ import org.olat.core.gui.control.generic.wizard.StepsMainRunController;
 import org.olat.core.gui.media.MediaResource;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.util.coordinate.LockResult;
 import org.olat.core.util.vfs.VFSContainer;
@@ -71,7 +72,7 @@ public interface RepositoryHandler {
 	
 	public String getCreateLabelI18nKey();
 	
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale);
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Organisation organisation, Locale locale);
 	
 	/**
 	 * Typically for course wizard
@@ -100,7 +101,7 @@ public interface RepositoryHandler {
 	 * @return
 	 */
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname,
-			String description, boolean withReferences, Locale locale, File file, String filename);	
+			String description, boolean withReferences, Organisation organisation, Locale locale, File file, String filename);	
 
 	/**
 	 * 
diff --git a/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java b/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java
index aade598ba553b4d1eb041b7b683f7ee1ea2e3ca5..bce58c051eec054450bd02ee1410598d04604602 100644
--- a/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java
+++ b/src/main/java/org/olat/repository/handlers/SCORMCPHandler.java
@@ -39,6 +39,7 @@ import org.olat.core.gui.control.generic.wizard.StepsMainRunController;
 import org.olat.core.gui.media.MediaResource;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
 import org.olat.core.util.FileUtils;
@@ -83,7 +84,8 @@ public class SCORMCPHandler extends FileHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		return null;
 	}
 	
@@ -99,12 +101,12 @@ public class SCORMCPHandler extends FileHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		
 		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);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		
 		File fResourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(resource).getBasefile();
 		File zipRoot = new File(fResourceFileroot, FileResourceManager.ZIPDIR);
@@ -182,9 +184,8 @@ public class SCORMCPHandler extends FileHandler {
 					CoreSpringFactory.getImpl(UserCourseInformationsManager.class)
 						.updateUserCourseInformations(res, uureq.getIdentity());
 					File cpRoot = FileResourceManager.getInstance().unzipFileResource(res);
-					MainLayoutController realController = ScormMainManager.getInstance().createScormAPIandDisplayController(uureq, wwControl, true, null, cpRoot,
+					return ScormMainManager.getInstance().createScormAPIandDisplayController(uureq, wwControl, true, null, cpRoot,
 							res.getResourceableId(), null, ScormConstants.SCORM_MODE_BROWSE, ScormConstants.SCORM_MODE_NOCREDIT, false, null, false, false, false, null);
-					return realController;
 				}
 			});
 	}
diff --git a/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java b/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java
index d9ada15d8dcc3187651b379f3c2131c969eef9b9..0e7096fd2b712ef4c3a7551d763e48a00f233ebf 100644
--- a/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java
+++ b/src/main/java/org/olat/repository/handlers/SharedFolderHandler.java
@@ -41,6 +41,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.FileUtils;
@@ -71,9 +72,6 @@ import org.olat.resource.references.ReferenceManager;
 
 
 /**
- * Description:<br>
- * TODO: as Class Description for SharedFolderHandler
- * 
  * <P>
  * Initial Date: Apr 6 <br>
  * @author gnaegi
@@ -91,12 +89,13 @@ public class SharedFolderHandler implements RepositoryHandler {
 	}
 
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		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);
+				SharedFolderFileResource.RESOURCE_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -113,7 +112,7 @@ public class SharedFolderHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		return null;
 	}
 	
diff --git a/src/main/java/org/olat/repository/handlers/VideoHandler.java b/src/main/java/org/olat/repository/handlers/VideoHandler.java
index cda54006af7e6758c438e0341e39600deb43b3fb..35cfc863bd8e3be557c78edc406eac32a3ddb7d5 100644
--- a/src/main/java/org/olat/repository/handlers/VideoHandler.java
+++ b/src/main/java/org/olat/repository/handlers/VideoHandler.java
@@ -40,6 +40,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.media.NotFoundMediaResource;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.StringHelper;
@@ -51,7 +52,6 @@ import org.olat.fileresource.types.FileResource;
 import org.olat.fileresource.types.ResourceEvaluation;
 import org.olat.fileresource.types.VideoFileResource;
 import org.olat.modules.video.VideoManager;
-import org.olat.modules.video.manager.VideoExportMediaResource;
 import org.olat.modules.video.ui.VideoDisplayController;
 import org.olat.modules.video.ui.VideoRuntimeController;
 import org.olat.repository.RepositoryEntry;
@@ -84,7 +84,8 @@ public class VideoHandler extends FileHandler {
 	}
 
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		return null;
 	}
 
@@ -109,13 +110,13 @@ public class VideoHandler extends FileHandler {
 
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String fileName) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String fileName) {
 
 		// 1) Create resource and repository entry
 		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);
+				displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		
 		if(fileName == null) {
 			fileName = file.getName();
@@ -151,8 +152,7 @@ public class VideoHandler extends FileHandler {
 			return new NotFoundMediaResource();
 		}
 		VideoManager videoManager = CoreSpringFactory.getImpl(VideoManager.class);		
-		VideoExportMediaResource exportResource = videoManager.getVideoExportMediaResource(repoEntry);
-		return exportResource;
+		return videoManager.getVideoExportMediaResource(repoEntry);
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java b/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java
index b56744eceda8acf870dfc8c824e5c52202a7c5cd..300de8b2157a3f70517817d5ba1255ff312e93fd 100644
--- a/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java
+++ b/src/main/java/org/olat/repository/handlers/WebDocumentHandler.java
@@ -42,6 +42,7 @@ import org.olat.core.gui.control.generic.wizard.StepsMainRunController;
 import org.olat.core.gui.media.MediaResource;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -76,8 +77,6 @@ import org.olat.resource.OLATResourceManager;
  *
  * @author Mike Stock
  * 
- * Comment:  
- * 
  */
 public class WebDocumentHandler extends FileHandler {
 	
@@ -99,7 +98,8 @@ public class WebDocumentHandler extends FileHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		return null;
 	}
 	
@@ -140,7 +140,7 @@ public class WebDocumentHandler extends FileHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		
 		FileResource ores;
 		if (DocFileResource.TYPE_NAME.equals(supportedType) && DocFileResource.validate(filename)) {
@@ -174,7 +174,7 @@ public class WebDocumentHandler extends FileHandler {
 		}
 
 		RepositoryEntry re = CoreSpringFactory.getImpl(RepositoryService.class)
-				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
+				.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS, 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 b847b1606b5b649cffd2405c439150850a32fe7d..102320aba6dde5399e449f1834cfb6bd9f31fc76 100644
--- a/src/main/java/org/olat/repository/handlers/WikiHandler.java
+++ b/src/main/java/org/olat/repository/handlers/WikiHandler.java
@@ -43,6 +43,7 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.context.BusinessControl;
 import org.olat.core.id.context.ContextEntry;
@@ -99,12 +100,13 @@ public class WikiHandler implements RepositoryHandler {
 	}
 	
 	@Override
-	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
+	public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description,
+			Object createObject, Organisation organisation, Locale locale) {
 		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);
+				WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -121,13 +123,13 @@ public class WikiHandler implements RepositoryHandler {
 	
 	@Override
 	public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description,
-			boolean withReferences, Locale locale, File file, String filename) {
+			boolean withReferences, Organisation organisation, Locale locale, File file, String filename) {
 		WikiResource wikiResource = new WikiResource();
 		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);
+			.create(initialAuthor, null, WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS, organisation);
 		DBFactory.getInstance().commit();
 		return re;
 	}
@@ -198,7 +200,7 @@ public class WikiHandler implements RepositoryHandler {
 		SubscriptionContext subsContext = new SubscriptionContext(res, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
 		final WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isOLatAdmin, isGuestOnly, false, isResourceOwner, subsContext);
 
-		RepositoryEntryRuntimeController runtime = new RepositoryEntryRuntimeController(ureq, wControl, re, reSecurity,
+		return new RepositoryEntryRuntimeController(ureq, wControl, re, reSecurity,
 			new RuntimeControllerCreator() {
 				@Override
 				public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel,
@@ -217,8 +219,6 @@ public class WikiHandler implements RepositoryHandler {
 					return new OLATResourceableListeningWrapperController(uureq, wwControl, entry.getOlatResource(), controller, null, uureq.getIdentity());
 				}
 			});
-
-		return runtime;
 	}
 
 	@Override
diff --git a/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java b/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java
index b93240379bcec262e88d9f5bba1d89c830bedcc4..97f54c08ecd0a9bbe33fdebfffb5d86977bc0902 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryEntryAuthorQueries.java
@@ -22,6 +22,7 @@ package org.olat.repository.manager;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import javax.persistence.TypedQuery;
 
@@ -32,6 +33,7 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.PersistenceHelper;
 import org.olat.core.commons.services.mark.impl.MarkImpl;
 import org.olat.core.id.Identity;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -121,7 +123,8 @@ public class RepositoryEntryAuthorQueries {
 		Roles roles = params.getRoles();
 		List<String> resourceTypes = params.getResourceTypes();
 		boolean oracle = "oracle".equals(dbInstance.getDbVendor());
-		boolean admin = (roles != null && (roles.isInstitutionalResourceManager() || roles.isOLATAdmin()));
+		boolean admin = (roles != null && (roles.isLearnResourceManager() || roles.isOLATAdmin()));
+		boolean learnResourceOrgs = false;
 
 		boolean count = Number.class.equals(type);
 		boolean needIdentity = false;
@@ -175,6 +178,13 @@ public class RepositoryEntryAuthorQueries {
 			} else {
 				sb.append(" v.access>=").append(RepositoryEntry.ACC_OWNERS);
 			}
+			
+			if(params.getLearnResourceManagerOrganisations() != null && !params.getLearnResourceManagerOrganisations().isEmpty()) {
+				sb.append(" and v.key in (select relToOrg.entry.key from repoentrytoorganisation as relToOrg")
+				  .append("  where relToOrg.organisation.key in (:learnResourceManagerOrganisationKeys)")
+				  .append(")");
+				learnResourceOrgs = true;
+			}
 		} else {
 			needIdentity = true;
 			sb.append(" (v.access>=").append(RepositoryEntry.ACC_OWNERS_AUTHORS)
@@ -241,8 +251,6 @@ public class RepositoryEntryAuthorQueries {
 
 		String displayname = params.getDisplayname();
 		if (StringHelper.containsNonWhitespace(displayname)) {
-			//displayName = '%' + displayName.replace('*', '%') + '%';
-			//query.append(" and v.displayname like :displayname");
 			displayname = PersistenceHelper.makeFuzzyQueryString(displayname);
 			sb.append(" and ");
 			PersistenceHelper.appendFuzzyLike(sb, "v.displayname", "displayname", dbInstance.getDbVendor());
@@ -250,8 +258,6 @@ public class RepositoryEntryAuthorQueries {
 		
 		String desc = params.getDescription();
 		if (StringHelper.containsNonWhitespace(desc)) {
-			//desc = '%' + desc.replace('*', '%') + '%';
-			//query.append(" and v.description like :desc");
 			desc = PersistenceHelper.makeFuzzyQueryString(desc);
 			sb.append(" and ");
 			PersistenceHelper.appendFuzzyLike(sb, "v.description", "desc", dbInstance.getDbVendor());
@@ -340,6 +346,11 @@ public class RepositoryEntryAuthorQueries {
 		if (StringHelper.containsNonWhitespace(desc)) {
 			dbQuery.setParameter("desc", desc);
 		}
+		if(learnResourceOrgs && params.getLearnResourceManagerOrganisations() != null && !params.getLearnResourceManagerOrganisations().isEmpty()) {
+			List<Long> learnResourceManagerOrganisationKeys = params.getLearnResourceManagerOrganisations()
+					.stream().map(OrganisationRef::getKey).collect(Collectors.toList());
+			dbQuery.setParameter("learnResourceManagerOrganisationKeys", learnResourceManagerOrganisationKeys);
+		}
 
 		if(needIdentity) {
 			dbQuery.setParameter("identityKey", identity.getKey());
diff --git a/src/main/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAO.java b/src/main/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAO.java
index 9a3905c6b58ab5a141d0793b8af4889da0a89e20..089a3cc219fd747633f031a3d8e1f4753bd6540a 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAO.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAO.java
@@ -20,10 +20,15 @@
 package org.olat.repository.manager;
 
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
+import org.olat.basesecurity.model.OrganisationRefImpl;
 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.RepositoryEntryRef;
 import org.olat.repository.RepositoryEntryToOrganisation;
 import org.olat.repository.model.RepositoryEntryToOrganisationImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,8 +57,30 @@ public class RepositoryEntryToOrganisationDAO {
 		return relation;
 	}
 	
+	public List<OrganisationRef> getOrganisationReferences(RepositoryEntryRef re) {
+		StringBuilder sb = new StringBuilder(255);
+		sb.append("select org.key from repoentrytoorganisation as reToOrganisation")
+		  .append(" inner join reToOrganisation.organisation org")
+		  .append(" where reToOrganisation.entry.key=:entryKey");
+		
+		List<Long> keys = dbInstance.getCurrentEntityManager()
+				.createQuery(sb.toString(), Long.class)
+				.setParameter("entryKey", re.getKey())
+				.getResultList();
+		return keys.stream().map(OrganisationRefImpl::new)
+				.collect(Collectors.toList());
+	}
+	
 	public void delete(RepositoryEntryToOrganisation relation) {
 		dbInstance.getCurrentEntityManager().remove(relation);
 	}
+	
+	public int delete(RepositoryEntryRef entry) {
+		String query = "delete from repoentrytoorganisation as reToOrganisation where reToOrganisation.entry.key=:entryKey";
+		return dbInstance.getCurrentEntityManager()
+				.createQuery(query)
+				.setParameter("entryKey", entry.getKey())
+				.executeUpdate();
+	}
 
 }
diff --git a/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java b/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java
index d483800cc1583c7e60dac738d4f476211f0f7b22..640e0fa907823aaf8d54df643f3417876fde1847 100644
--- a/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java
+++ b/src/main/java/org/olat/repository/manager/RepositoryServiceImpl.java
@@ -42,6 +42,7 @@ import org.olat.core.commons.services.taskexecutor.manager.PersistentTaskDAO;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -72,6 +73,7 @@ import org.olat.repository.RepositoryEntryMyView;
 import org.olat.repository.RepositoryEntryRef;
 import org.olat.repository.RepositoryEntryRelationType;
 import org.olat.repository.RepositoryEntryStatus;
+import org.olat.repository.RepositoryEntryToOrganisation;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryModule;
 import org.olat.repository.RepositoryService;
@@ -155,19 +157,13 @@ public class RepositoryServiceImpl implements RepositoryService {
 	private LifeFullIndexer lifeIndexer;
 
 	@Override
-	public RepositoryEntry create(String initialAuthor, String resourceName,
-			String displayname, String description, OLATResource resource) {
-		return create(initialAuthor, null, resourceName, displayname, description, resource, 0);
-	}
-
-	@Override
-	public RepositoryEntry create(Identity initialAuthor, String initialAuthorAlt,
-			String resourceName, String displayname, String description, OLATResource resource, int access) {
-		return create(initialAuthorAlt, initialAuthor, resourceName, displayname, description, resource, access);
+	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);
 	}
 
 	private RepositoryEntry create(String initialAuthorName, Identity initialAuthor, String resourceName,
-			String displayname, String description, OLATResource resource, int access) {
+			String displayname, String description, OLATResource resource, int access, Organisation organisation) {
 		Date now = new Date();
 
 		RepositoryEntry re = new RepositoryEntry();
@@ -223,8 +219,12 @@ public class RepositoryServiceImpl implements RepositoryService {
 		if(initialAuthor != null) {
 			groupDao.addMembershipTwoWay(group, initialAuthor, GroupRoles.owner.name());
 		}
-
 		dbInstance.getCurrentEntityManager().persist(re);
+		
+		if(organisation != null) {
+			RepositoryEntryToOrganisation toOrganisation = repositoryEntryToOrganisationDao.createRelation(organisation, re, false);
+			re.getOrganisations().add(toOrganisation);
+		}
 
 		autoAccessManager.grantAccess(re);
 		return re;
@@ -235,7 +235,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);
+				sourceEntry.getDescription(), copyResource, RepositoryEntry.ACC_OWNERS, null);
 
 		//copy all fields
 		copyEntry.setAuthors(sourceEntry.getAuthors());
@@ -447,6 +447,7 @@ public class RepositoryServiceImpl implements RepositoryService {
 		//nullify the reference
 		assessmentEntryDao.removeEntryForReferenceEntry(entry);
 		assessmentEntryDao.deleteEntryForRepositoryEntry(entry);
+		repositoryEntryToOrganisationDao.delete(entry);
 		dbInstance.commit();
 
 		if(debug) log.debug("deleteRepositoryEntry after reload entry=" + entry);
@@ -672,6 +673,11 @@ public class RepositoryServiceImpl implements RepositoryService {
 		}
 	}
 
+	@Override
+	public List<OrganisationRef> getOrganisationReferences(RepositoryEntryRef entry) {
+		return repositoryEntryToOrganisationDao.getOrganisationReferences(entry);
+	}
+
 	@Override
 	public RepositoryEntry addOrganisation(RepositoryEntry entry, Organisation organisation, boolean master) {
 		repositoryEntryToOrganisationDao.createRelation(organisation, entry, master);
diff --git a/src/main/java/org/olat/repository/model/SearchAuthorRepositoryEntryViewParams.java b/src/main/java/org/olat/repository/model/SearchAuthorRepositoryEntryViewParams.java
index e00b49d5ad563e5a1a8db461da23b5ddee77d126..c5eb3f32968b91dc05a884876408d92b609fe78a 100644
--- a/src/main/java/org/olat/repository/model/SearchAuthorRepositoryEntryViewParams.java
+++ b/src/main/java/org/olat/repository/model/SearchAuthorRepositoryEntryViewParams.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.olat.basesecurity.IdentityRef;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 
 /**
@@ -42,6 +43,8 @@ public class SearchAuthorRepositoryEntryViewParams {
 	private boolean ownedResourcesOnly;
 	private ResourceUsage resourceUsage = ResourceUsage.all;
 	
+	private List<OrganisationRef> learnResourceManagerOrganisations;
+	
 	private String idAndRefs;
 	private String idRefsAndTitle;
 	private String author;
@@ -145,7 +148,7 @@ public class SearchAuthorRepositoryEntryViewParams {
 	
 	public void addResourceTypes(String... types) {
 		if(this.resourceTypes == null) {
-			this.resourceTypes = new ArrayList<String>();
+			this.resourceTypes = new ArrayList<>();
 		}
 		if(types != null) {
 			for(String resourceType:types) {
@@ -202,8 +205,16 @@ public class SearchAuthorRepositoryEntryViewParams {
 		return licenseTypeKeys;
 	}
 
-	public void setLicneseTypeKeys(Set<Long> licneseTypeKeys) {
-		this.licenseTypeKeys = licneseTypeKeys;
+	public void setLicenseTypeKeys(Set<Long> licenseTypeKeys) {
+		this.licenseTypeKeys = licenseTypeKeys;
+	}
+
+	public List<OrganisationRef> getLearnResourceManagerOrganisations() {
+		return learnResourceManagerOrganisations;
+	}
+
+	public void setLearnResourceManagerOrganisations(List<OrganisationRef> learnResourceManagerOrganisations) {
+		this.learnResourceManagerOrganisations = learnResourceManagerOrganisations;
 	}
 
 	public enum OrderBy {
diff --git a/src/main/java/org/olat/repository/site/CatalogAdminSiteDef.java b/src/main/java/org/olat/repository/site/CatalogAdminSiteDef.java
index 8b24e43c378e1770b016e4980b4f05d6c8e56d06..6700c8b3bd3c4d9246d72f30921e09121970a27f 100644
--- a/src/main/java/org/olat/repository/site/CatalogAdminSiteDef.java
+++ b/src/main/java/org/olat/repository/site/CatalogAdminSiteDef.java
@@ -41,7 +41,7 @@ public class CatalogAdminSiteDef extends AbstractSiteDefinition implements SiteD
 	public SiteInstance createSite(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
 		if(StringHelper.containsNonWhitespace(config.getSecurityCallbackBeanId())) {
 			return new CatalogAdminSite(this, ureq.getLocale());
-		} else if(ureq.getUserSession().getRoles().isInstitutionalResourceManager()) {
+		} else if(ureq.getUserSession().getRoles().isLearnResourceManager()) {
 			// only for admins
 			return new CatalogAdminSite(this, ureq.getLocale());
 		}
diff --git a/src/main/java/org/olat/repository/site/CatalogManagerSecurityCallback.java b/src/main/java/org/olat/repository/site/CatalogManagerSecurityCallback.java
index 794fa9999f8edd6d1c6227c9f156f62000a3c083..f4fe6788ce38ffa57063b190e7f511f254bc78d1 100644
--- a/src/main/java/org/olat/repository/site/CatalogManagerSecurityCallback.java
+++ b/src/main/java/org/olat/repository/site/CatalogManagerSecurityCallback.java
@@ -22,6 +22,7 @@ package org.olat.repository.site;
 
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.navigation.SiteSecurityCallback;
+import org.olat.core.util.UserSession;
 import org.olat.repository.manager.CatalogManager;
 
 /**
@@ -44,17 +45,18 @@ public class CatalogManagerSecurityCallback implements SiteSecurityCallback {
 		this.catalogManager = catalogManager;
 	}
 
-	/**
-	 * @see com.frentix.olat.coursesite.SiteSecurityCallback#isAllowedToLaunchSite(org.olat.core.gui.UserRequest)
-	 */
 	@Override
 	public boolean isAllowedToLaunchSite(UserRequest ureq) {
-		if (ureq == null || ureq.getUserSession() == null || ureq.getUserSession().getRoles() == null
-				|| ureq.getIdentity() == null
-				|| ureq.getUserSession().getRoles().isInvitee() || ureq.getUserSession().getRoles().isGuestOnly()) {
+		if(ureq == null) {
+			return false;
+		}
+		
+		UserSession usess = ureq.getUserSession();
+		if(usess == null || usess.getRoles() == null || ureq.getIdentity() == null
+				|| usess.getRoles().isInvitee() || usess.getRoles().isGuestOnly()) {
 			return false;
 		}
-		if (ureq.getUserSession().getRoles().isOLATAdmin() || ureq.getUserSession().getRoles().isInstitutionalResourceManager()) {
+		if (usess.getRoles().isOLATAdmin() || usess.getRoles().isLearnResourceManager()) {
 			return true;
 		}
 		return catalogManager.isOwner(ureq.getIdentity());
diff --git a/src/main/java/org/olat/repository/site/RepositorySiteDef.java b/src/main/java/org/olat/repository/site/RepositorySiteDef.java
index 99d43eb1e7c3fdc2218dcf0a90305269a8924ac4..b4c4a4867f18778cec4d44de9ffa597a792ecd8a 100644
--- a/src/main/java/org/olat/repository/site/RepositorySiteDef.java
+++ b/src/main/java/org/olat/repository/site/RepositorySiteDef.java
@@ -32,10 +32,11 @@ import org.olat.core.gui.control.navigation.SiteConfiguration;
 import org.olat.core.gui.control.navigation.SiteDefinition;
 import org.olat.core.gui.control.navigation.SiteInstance;
 import org.olat.core.util.StringHelper;
+import org.olat.core.util.UserSession;
 
 /**
  * Description:<br>
- * Site fot the learn ressources
+ * Site for the learn resources
  * 
  * <P>
  * Initial Date:  12.07.2005 <br>
@@ -44,10 +45,6 @@ import org.olat.core.util.StringHelper;
  */
 public class RepositorySiteDef extends AbstractSiteDefinition implements SiteDefinition {
 
-	public RepositorySiteDef() {
-		// for classloader
-	}
-
 	/**
 	 * Site is normally only open to authors. Configured via security callback
 	 */
@@ -55,7 +52,11 @@ public class RepositorySiteDef extends AbstractSiteDefinition implements SiteDef
 	public SiteInstance createSite(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
 		if(StringHelper.containsNonWhitespace(config.getSecurityCallbackBeanId())) {
 			return new RepositorySite(this, ureq.getLocale());
-		} else if(ureq.getUserSession().getRoles().isAuthor() || ureq.getUserSession().getRoles().isInstitutionalResourceManager()) {
+		} 
+		
+		UserSession usess = ureq.getUserSession();
+		
+		if(usess.getRoles().isAuthor() || usess.getRoles().isLearnResourceManager()) {
 			// only for authors and institutional resource managers
 			return new RepositorySite(this, ureq.getLocale());
 		}
diff --git a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java
index da5bdf079f1f884495de2602953e4ae487436942..ab4c5eb3a3b2871ee7b84d46e4ef354152295dff 100644
--- a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java
+++ b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java
@@ -45,6 +45,7 @@ import org.olat.core.gui.control.generic.dtabs.Activateable2;
 import org.olat.core.gui.control.generic.layout.MainLayoutController;
 import org.olat.core.gui.media.MediaResource;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.id.context.BusinessControlFactory;
 import org.olat.core.id.context.ContextEntry;
@@ -142,6 +143,7 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 	protected boolean corrupted;
 	protected boolean overrideReadOnly = false;
 	private RepositoryEntry re;
+	private List<OrganisationRef> organisations;
 	private LockResult lockResult;
 	private boolean assessmentLock;// by Assessment mode
 	private AssessmentMode assessmentMode;
@@ -197,6 +199,7 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 		this.showInfos = showInfos;
 		this.allowBookmark = allowBookmark;
 		this.runtimeControllerCreator = runtimeControllerCreator;
+		organisations = repositoryService.getOrganisationReferences(re);
 		
 		if(assessmentLock) {
 			TransientAssessmentMode mode = session.getLockMode();
@@ -208,7 +211,7 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 			List<HistoryPoint> stack = session.getHistoryStack();
 			for(int i=stack.size() - 2; i-->0; ) {
 				HistoryPoint point = stack.get(stack.size() - 2);
-				if(point.getEntries().size() > 0) {
+				if(!point.getEntries().isEmpty()) {
 					OLATResourceable ores = point.getEntries().get(0).getOLATResourceable();
 					if(!OresHelper.equals(re, ores) && !OresHelper.equals(re.getOlatResource(), ores)) {
 						launchedFromPoint = point;
@@ -269,6 +272,7 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 	
 	protected RepositoryEntry loadRepositoryEntry() {
 		re = repositoryService.loadByKey(re.getKey());
+		organisations = repositoryService.getOrganisationReferences(re);
 		return re;
 	}
 	
@@ -277,6 +281,10 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 		return re;
 	}
 	
+	protected List<OrganisationRef> getOrganisations() {
+		return organisations;
+	}
+	
 	protected OLATResourceable getOlatResourceable() {
 		return OresHelper.clone(re.getOlatResource());
 	}
@@ -574,7 +582,7 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
 			}
 		} else if(descriptionCtrl == source) {
 			if(event == Event.CHANGED_EVENT) {
-				RepositoryEntry entry = descriptionCtrl.getEntry();
+				RepositoryEntry entry = descriptionCtrl.getRepositoryEntry();
 				refreshRepositoryEntry(entry);
 				handler.onDescriptionChanged(entry);
 				// update name of root bread crumb and opened tabs in top nav in case the title has been modified
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 02f947880069a018f8d54216df97d0f48be2882e..5035041cf082b7bd486c74c84f46f0ad9f92aefe 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthorListController.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthorListController.java
@@ -28,6 +28,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.olat.NewControllerFactory;
 import org.olat.admin.user.UserSearchController;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.events.MultiIdentityChosenEvent;
 import org.olat.basesecurity.events.SingleIdentityChosenEvent;
 import org.olat.core.commons.persistence.DB;
@@ -81,6 +83,8 @@ import org.olat.core.gui.media.MediaResource;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.Roles;
 import org.olat.core.id.context.ContextEntry;
 import org.olat.core.id.context.StateEntry;
@@ -177,6 +181,8 @@ public class AuthorListController extends FormBasicController implements Activat
 	@Autowired
 	protected RepositoryHandlerFactory repositoryHandlerFactory;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private LicenseModule licenseModule;
 	@Autowired
 	private RepositoryEntryLicenseHandler licenseHandler;
@@ -195,8 +201,19 @@ public class AuthorListController extends FormBasicController implements Activat
 		ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
 		
 		Roles roles = ureq.getUserSession().getRoles();
-		isOlatAdmin = roles.isOLATAdmin() || roles.isInstitutionalResourceManager();
-		hasAuthorRight = roles.isAuthor() || roles.isInstitutionalResourceManager() || roles.isOLATAdmin();
+		boolean learnResourceManager = roles.isLearnResourceManager();
+		isOlatAdmin = roles.isOLATAdmin() || learnResourceManager;
+		hasAuthorRight = roles.isAuthor() || learnResourceManager || roles.isOLATAdmin();
+		if(!roles.isOLATAdmin()) {
+			if(learnResourceManager) {
+				List<Organisation> orgs = organisationService
+						.getManageableOrganisations(getIdentity(), roles, OrganisationRoles.learnresourcemanager);
+				searchParams.setLearnResourceManagerOrganisations(new ArrayList<OrganisationRef>(orgs));
+			}
+			if(roles.isAuthor()) {
+				
+			}
+		}
 
 		dataSource = new AuthoringEntryDataSource(searchParams, this, !withSearch);
 		initForm(ureq);
@@ -503,7 +520,7 @@ public class AuthorListController extends FormBasicController implements Activat
 				searchParams.setDescription(null);
 				searchParams.setOwnedResourcesOnly(false);
 				searchParams.setResourceUsage(ResourceUsage.all);
-				searchParams.setLicneseTypeKeys(null);
+				searchParams.setLicenseTypeKeys(null);
 			}
 		} else if(userSearchCtr == source) {
 			@SuppressWarnings("unchecked")
@@ -791,7 +808,7 @@ public class AuthorListController extends FormBasicController implements Activat
 		searchParams.setClosed(se.getClosed());
 		searchParams.setDisplayname(se.getDisplayname());
 		searchParams.setDescription(se.getDescription());
-		searchParams.setLicneseTypeKeys(se.getLicenseTypeKeys());
+		searchParams.setLicenseTypeKeys(se.getLicenseTypeKeys());
 		tableEl.reset(true, true, true);
 		
 		AuthorListState stateEntry = new AuthorListState();
diff --git a/src/main/java/org/olat/repository/ui/author/AuthorSearchController.java b/src/main/java/org/olat/repository/ui/author/AuthorSearchController.java
index 916a88c9311eb905c3cdbab91ab85c22bbf5f792..f18cc9c2120c9efac1c705135e0a66a7c99420fe 100644
--- a/src/main/java/org/olat/repository/ui/author/AuthorSearchController.java
+++ b/src/main/java/org/olat/repository/ui/author/AuthorSearchController.java
@@ -257,8 +257,7 @@ public class AuthorSearchController extends FormBasicController implements Exten
 	 */
 	public Set<String> getRestrictedTypes() {
 		if(types.isAtLeastSelected(1)) {
-			Set<String> selectedTypes = new HashSet<>(types.getSelectedKeys());
-			return selectedTypes;
+			return new HashSet<>(types.getSelectedKeys());
 		}
 		return null;
 	}
diff --git a/src/main/java/org/olat/repository/ui/author/CreateRepositoryEntryController.java b/src/main/java/org/olat/repository/ui/author/CreateRepositoryEntryController.java
index f8e036b2c082e5780bd5f68b63e265578a324494..ff9f2f4df32135812a7c4055a18e238e5265923b 100644
--- a/src/main/java/org/olat/repository/ui/author/CreateRepositoryEntryController.java
+++ b/src/main/java/org/olat/repository/ui/author/CreateRepositoryEntryController.java
@@ -19,13 +19,20 @@
  */
 package org.olat.repository.ui.author;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.olat.NewControllerFactory;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
+import org.olat.basesecurity.model.OrganisationRefImpl;
 import org.olat.core.commons.services.license.LicenseModule;
 import org.olat.core.commons.services.license.LicenseService;
 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.FormLink;
+import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
 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;
@@ -36,6 +43,7 @@ import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.activity.LearningResourceLoggingAction;
 import org.olat.core.logging.activity.OlatResourceableType;
 import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
@@ -62,10 +70,12 @@ public class CreateRepositoryEntryController extends FormBasicController impleme
 	
 	private FormLink wizardButton;
 	private TextElement displaynameEl;
+	private SingleSelection organisationEl;
 	private FormLayoutContainer exampleHelpEl;
 	
 	private RepositoryEntry addedEntry;
 	private final RepositoryHandler handler;
+	private final List<Organisation> manageableOrganisations;
 	
 	private Object userObject;
 	
@@ -76,12 +86,16 @@ public class CreateRepositoryEntryController extends FormBasicController impleme
 	@Autowired
 	private LicenseModule licenseModule;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryLicenseHandler licenseHandler;
 	
 	public CreateRepositoryEntryController(UserRequest ureq, WindowControl wControl, RepositoryHandler handler) {
 		super(ureq, wControl);
 		setTranslator(Util.createPackageTranslator(RepositoryManager.class, getLocale(), getTranslator()));
 		this.handler = handler;
+		manageableOrganisations = organisationService
+				.getManageableOrganisations(getIdentity(), ureq.getUserSession().getRoles(), OrganisationRoles.learnresourcemanager);
 		initForm(ureq);
 	}
 
@@ -136,13 +150,26 @@ public class CreateRepositoryEntryController extends FormBasicController impleme
 		formLayout.add(exampleHelpEl);
 		exampleHelpEl.setVisible(false);
 		
+		List<String> organisationKeys = new ArrayList<>();
+		List<String> organisationValues = new ArrayList<>();
+		for(Organisation organisation:manageableOrganisations) {
+			organisationKeys.add(organisation.getKey().toString());
+			organisationValues.add(organisation.getDisplayName());
+		}
+		organisationEl = uifactory.addDropdownSingleselect("cif.organisations", "cif.organisations",
+				formLayout, organisationKeys.toArray(new String[organisationKeys.size()]), organisationValues.toArray(new String[organisationValues.size()]));
+		if(!organisationKeys.isEmpty()) {
+			organisationEl.select(organisationKeys.get(0), true);
+		}
+		organisationEl.setVisible(organisationKeys.size() > 1);
+		
 		FormLayoutContainer buttonContainer = FormLayoutContainer.createButtonLayout("buttonContainer", getTranslator());
 		formLayout.add("buttonContainer", buttonContainer);
 		buttonContainer.setElementCssClass("o_sel_repo_save_details");
 		FormSubmit submit = uifactory.addFormSubmitButton("cmd.create.ressource", buttonContainer);
 		submit.setElementCssClass("o_sel_author_create_submit");
 		
-		if(handler.isPostCreateWizardAvailable()) {
+		if(handler != null && handler.isPostCreateWizardAvailable()) {
 			wizardButton = uifactory.addFormLink("csc.startwizard", buttonContainer, Link.BUTTON);
 			wizardButton.setElementCssClass("o_sel_author_create_wizard");
 		}
@@ -157,7 +184,13 @@ public class CreateRepositoryEntryController extends FormBasicController impleme
 
 	@Override
 	protected boolean validateFormLogic(UserRequest ureq) {
-		boolean allOk = true;
+		boolean allOk = super.validateFormLogic(ureq);
+		
+		organisationEl.clearError();
+		if(organisationEl.isVisible() && !organisationEl.isOneSelected()) {
+			organisationEl.setErrorKey("form.legende.mandatory", null);
+			allOk &= false;
+		}
 		
 		displaynameEl.clearError();
 		if (!StringHelper.containsNonWhitespace(displaynameEl.getValue())) {
@@ -167,7 +200,7 @@ public class CreateRepositoryEntryController extends FormBasicController impleme
 			allOk &= false;
 		}
 		
-		return allOk & super.validateFormLogic(ureq);
+		return allOk;
 	}
 
 	@Override
@@ -196,7 +229,15 @@ public class CreateRepositoryEntryController extends FormBasicController impleme
 	private void doCreate() {
 		String displayname = displaynameEl.getValue();
 		
-		addedEntry = handler.createResource(getIdentity(), displayname, "", getCreateObject(), getLocale());
+		Organisation organisation;
+		if(organisationEl.isOneSelected()) {
+			Long organisationKey = Long.valueOf(organisationEl.getSelectedKey());
+			organisation = organisationService.getOrganisation(new OrganisationRefImpl(organisationKey));
+		} else {
+			organisation = organisationService.getDefaultOrganisation();
+		}
+		
+		addedEntry = handler.createResource(getIdentity(), displayname, "", getCreateObject(), organisation, getLocale());
 		if (licenseModule.isEnabled(licenseHandler)) {
 			licenseService.createDefaultLicense(addedEntry.getOlatResource(), licenseHandler, getIdentity());
 		}
diff --git a/src/main/java/org/olat/repository/ui/author/ImportRepositoryEntryController.java b/src/main/java/org/olat/repository/ui/author/ImportRepositoryEntryController.java
index 5d064b8105c1900859f695bf82631b23a8eb63e4..3ff88835145ee9c6229a984523f6613a12f41047 100644
--- a/src/main/java/org/olat/repository/ui/author/ImportRepositoryEntryController.java
+++ b/src/main/java/org/olat/repository/ui/author/ImportRepositoryEntryController.java
@@ -25,6 +25,9 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.olat.NewControllerFactory;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
+import org.olat.basesecurity.model.OrganisationRefImpl;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.form.flexible.FormItem;
 import org.olat.core.gui.components.form.flexible.FormItemContainer;
@@ -41,6 +44,7 @@ import org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.activity.LearningResourceLoggingAction;
 import org.olat.core.logging.activity.OlatResourceableType;
 import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
@@ -62,28 +66,33 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 public class ImportRepositoryEntryController extends FormBasicController {
 	
+	private static final String[] refKeys = new String[]{ "checked" };
+	
 	private String[] limitTypes;
 	private RepositoryEntry importedEntry;
+	private final List<Organisation> manageableOrganisations;
 	private List<ResourceHandler> handlerForUploadedResources;
 	
-	private SpacerElement spacerEl;
 	private FormSubmit importButton;
 	private SingleSelection selectType;
 	private FileElement uploadFileEl;
 	private StaticTextElement typeEl;
 	private TextElement displaynameEl;
+	private SingleSelection organisationEl;
 	private MultipleSelectionElement referencesEl;
 	
-	private final static String[] refKeys = new String[]{ "checked" };
-
 	@Autowired
 	private RepositoryManager repositoryManager;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryHandlerFactory repositoryHandlerFactory;
 	
 	public ImportRepositoryEntryController(UserRequest ureq, WindowControl wControl) {
 		super(ureq, wControl);
 		setTranslator(Util.createPackageTranslator(RepositoryManager.class, getLocale(), getTranslator()));
+		manageableOrganisations = organisationService
+				.getManageableOrganisations(getIdentity(), ureq.getUserSession().getRoles(), OrganisationRoles.learnresourcemanager);
 		
 		initForm(ureq);
 	}
@@ -92,6 +101,8 @@ public class ImportRepositoryEntryController extends FormBasicController {
 		super(ureq, wControl);
 		setTranslator(Util.createPackageTranslator(RepositoryManager.class, getLocale(), getTranslator()));
 		this.limitTypes = limitTypes;
+		manageableOrganisations = organisationService
+				.getManageableOrganisations(getIdentity(), ureq.getUserSession().getRoles(), OrganisationRoles.learnresourcemanager);
 		
 		initForm(ureq);
 	}
@@ -103,7 +114,7 @@ public class ImportRepositoryEntryController extends FormBasicController {
 		uploadFileEl = uifactory.addFileElement(getWindowControl(), "upload", "import.file", formLayout);
 		uploadFileEl.addActionListener(FormEvent.ONCHANGE);
 		
-		spacerEl = uifactory.addSpacerElement("spacer1", formLayout, false);
+		SpacerElement spacerEl = uifactory.addSpacerElement("spacer1", formLayout, false);
 		spacerEl.setVisible(false);
 		
 		typeEl = uifactory.addStaticTextElement("cif.type", "cif.type", "", formLayout);
@@ -119,6 +130,19 @@ public class ImportRepositoryEntryController extends FormBasicController {
 		displaynameEl.setMandatory(true);
 		displaynameEl.setVisible(false);
 		displaynameEl.setElementCssClass("o_sel_author_imported_name");
+		
+		List<String> organisationKeys = new ArrayList<>();
+		List<String> organisationValues = new ArrayList<>();
+		for(Organisation organisation:manageableOrganisations) {
+			organisationKeys.add(organisation.getKey().toString());
+			organisationValues.add(organisation.getDisplayName());
+		}
+		organisationEl = uifactory.addDropdownSingleselect("cif.organisations", "cif.organisations",
+				formLayout, organisationKeys.toArray(new String[organisationKeys.size()]), organisationValues.toArray(new String[organisationValues.size()]));
+		if(!organisationKeys.isEmpty()) {
+			organisationEl.select(organisationKeys.get(0), true);
+		}
+		organisationEl.setVisible(organisationKeys.size() > 1);
 
 		String[] refValues = new String[]{ translate("references.expl") };
 		referencesEl = uifactory.addCheckboxesHorizontal("references", "references", formLayout, refKeys, refValues);
@@ -178,7 +202,14 @@ public class ImportRepositoryEntryController extends FormBasicController {
 
 	@Override
 	protected boolean validateFormLogic(UserRequest ureq) {
-		boolean allOk = true;
+		boolean allOk = super.validateFormLogic(ureq);
+		
+
+		organisationEl.clearError();
+		if(organisationEl.isVisible() && !organisationEl.isOneSelected()) {
+			organisationEl.setErrorKey("form.legende.mandatory", null);
+			allOk &= false;
+		}
 		
 		if (!StringHelper.containsNonWhitespace(displaynameEl.getValue())) {
 			displaynameEl.setErrorKey("cif.error.displayname.empty", new String[] {});
@@ -190,8 +221,8 @@ public class ImportRepositoryEntryController extends FormBasicController {
 		}
 		
 		allOk &= validLimitationOnType(handlerForUploadedResources);
-		allOk &= handlerForUploadedResources != null && handlerForUploadedResources.size() > 0;
-		return allOk & super.validateFormLogic(ureq);
+		allOk &= handlerForUploadedResources != null && !handlerForUploadedResources.isEmpty();
+		return allOk;
 	}
 	
 	private boolean validLimitationOnType(List<ResourceHandler> handlers) {
@@ -233,13 +264,21 @@ public class ImportRepositoryEntryController extends FormBasicController {
 		}
 		
 		if(handler != null) {
+			Organisation organisation;
+			if(organisationEl.isOneSelected()) {
+				Long organisationKey = Long.valueOf(organisationEl.getSelectedKey());
+				organisation = organisationService.getOrganisation(new OrganisationRefImpl(organisationKey));
+			} else {
+				organisation = organisationService.getDefaultOrganisation();
+			}
+
 			String displayname = displaynameEl.getValue();
 			File uploadedFile = uploadFileEl.getUploadFile();
 			String uploadedFilename = uploadFileEl.getUploadFileName();
 			boolean withReferences = referencesEl.isAtLeastSelected(1);
 			
 			importedEntry = handler.importResource(getIdentity(), null, displayname,
-					"", withReferences, getLocale(), uploadedFile, uploadedFilename);
+					"", withReferences, organisation, getLocale(), uploadedFile, uploadedFilename);
 			
 			if(importedEntry == null) {
 				showWarning("error.import");
diff --git a/src/main/java/org/olat/repository/ui/author/RepositoryEditDescriptionController.java b/src/main/java/org/olat/repository/ui/author/RepositoryEditDescriptionController.java
index cfe9e5ac036e756f1ac270987d7dd13ceb01fe96..f5ba480167661b586bcb9e60a463461107339066 100644
--- a/src/main/java/org/olat/repository/ui/author/RepositoryEditDescriptionController.java
+++ b/src/main/java/org/olat/repository/ui/author/RepositoryEditDescriptionController.java
@@ -39,6 +39,7 @@ import java.util.UUID;
 
 import org.olat.NewControllerFactory;
 import org.olat.basesecurity.OrganisationModule;
+import org.olat.basesecurity.OrganisationRoles;
 import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.model.OrganisationRefImpl;
 import org.olat.core.commons.services.license.LicenseModule;
@@ -166,8 +167,11 @@ public class RepositoryEditDescriptionController extends FormBasicController {
 		repoEntryType = repositoryEntry.getOlatResource().getResourceableTypeName();
 		initForm(ureq);
 	}
-	
-	public RepositoryEntry getEntry() {
+
+	/**
+	 * @return Returns the repositoryEntry.
+	 */
+	public RepositoryEntry getRepositoryEntry() {
 		return repositoryEntry;
 	}
 
@@ -421,7 +425,8 @@ public class RepositoryEditDescriptionController extends FormBasicController {
 		if(roles.isOLATAdmin()) {
 			organisations = organisationService.getOrganisations();
 		} else {
-			organisations = organisationService.getSearchableOrganisations(getIdentity(), roles);
+			organisations = organisationService
+					.getManageableOrganisations(getIdentity(), roles, OrganisationRoles.learnresourcemanager);
 		}
 		
 		List<String> keyList = new ArrayList<>();
@@ -738,11 +743,4 @@ public class RepositoryEditDescriptionController extends FormBasicController {
 	protected void formCancelled(UserRequest ureq) {
 		fireEvent(ureq, Event.CANCELLED_EVENT);
 	}
-
-	/**
-	 * @return Returns the repositoryEntry.
-	 */
-	public RepositoryEntry getRepositoryEntry() {
-		return repositoryEntry;
-	}
 }
\ No newline at end of file
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 dbd2a3a84c3688f2d011b2ab00bee02f4705d8c3..fe42a798d988b1f051d1cd0698bc7190cb251132 100644
--- a/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java
+++ b/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java
@@ -215,11 +215,11 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 		if(formLayout instanceof FormLayoutContainer) {
 			FormLayoutContainer layoutCont = (FormLayoutContainer)formLayout;
 			layoutCont.contextPut("v", entry);
-			layoutCont.contextPut("guestOnly", new Boolean(guestOnly));
+			layoutCont.contextPut("guestOnly", Boolean.valueOf(guestOnly));
 			String cssClass = RepositoyUIFactory.getIconCssClass(entry);
 			layoutCont.contextPut("cssClass", cssClass);
 			boolean closed = entry.getRepositoryEntryStatus().isClosed() || entry.getRepositoryEntryStatus().isUnpublished();
-			layoutCont.contextPut("closed", new Boolean(closed));
+			layoutCont.contextPut("closed", Boolean.valueOf(closed));
 			
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(entry);
 			VFSContainer mediaContainer = handler.getMediaContainer(entry);
@@ -314,7 +314,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
             		|| memberRoles.contains(GroupRoles.participant.name());
 			if (isMember) {
 				isAuthor = authorKeys.contains(getIdentity().getKey());
-				layoutCont.contextPut("isEntryAuthor", new Boolean(isAuthor));
+				layoutCont.contextPut("isEntryAuthor", Boolean.valueOf(isAuthor));
 			}
 			// push roles to velocity as well
             Roles roles = ureq.getUserSession().getRoles();
@@ -329,7 +329,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 
 			//access control
 			String accessI18n = null;
-			List<PriceMethod> types = new ArrayList<PriceMethod>();
+			List<PriceMethod> types = new ArrayList<>();
 			if (entry.isMembersOnly()) {
 				// members only
 				if(isMember) {
@@ -374,7 +374,6 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 				} else {
 					String linkText = translate("start.with.type", translate(entry.getOlatResource().getResourceableTypeName()));
 					startLink = uifactory.addFormLink("start", "start", linkText, null, layoutCont, Link.BUTTON_LARGE + Link.NONTRANSLATED);
-					//startLink.setEnabled(false);
 					startLink.setElementCssClass("o_start btn-block");
 					startLink.setVisible(!guestOnly);
 				}
@@ -457,9 +456,9 @@ public class RepositoryEntryDetailsController extends FormBasicController {
             layoutCont.contextPut("numUsers", numUsers);
             
             // Where is it in use
-            if(isAuthor || roles.isOLATAdmin() || roles.isInstitutionalResourceManager()) {
+            if(isAuthor || roles.isOLATAdmin() || roles.isLearnResourceManager()) {
 				List<RepositoryEntry> refs = referenceManager.getRepositoryReferencesTo(entry.getOlatResource());
-				if(refs.size() > 0) {
+				if(!refs.isEmpty()) {
 					List<String> refLinks = new ArrayList<>(refs.size());
 					int count = 0;
 					for(RepositoryEntry ref:refs) {
@@ -470,7 +469,7 @@ public class RepositoryEntryDetailsController extends FormBasicController {
 						refLink.setIconLeftCSS("o_icon o_icon-fw " + RepositoyUIFactory.getIconCssClass(ref));
 						refLinks.add(name);
 					}
-	            	layoutCont.contextPut("referenceLinks", refLinks);
+	            		layoutCont.contextPut("referenceLinks", refLinks);
 				}
             }
             
diff --git a/src/main/java/org/olat/resource/OLATResourceManager.java b/src/main/java/org/olat/resource/OLATResourceManager.java
index 38d1db0c4db1c1ceb1cdb961712c91163f77ae0e..d8e8ee5e3c6df433908c6c11d32c858c5530ef9b 100644
--- a/src/main/java/org/olat/resource/OLATResourceManager.java
+++ b/src/main/java/org/olat/resource/OLATResourceManager.java
@@ -92,7 +92,7 @@ public class OLATResourceManager extends BasicManager {
 	 * @return OLATResource
 	 */
 	public OLATResource createOLATResourceInstance(String typeName) {
-		Long id = new Long(CodeHelper.getForeverUniqueID());
+		Long id = Long.valueOf(CodeHelper.getForeverUniqueID());
 		return new OLATResourceImpl(id, typeName);
 	}
 	
diff --git a/src/main/java/org/olat/resource/accesscontrol/model/AuthorACSecurityCallback.java b/src/main/java/org/olat/resource/accesscontrol/model/AuthorACSecurityCallback.java
index 8aed5940aa6f52e8c3db9790c2a3bbf6abc60194..91defe1a60f1ec168a66ba232481a3dd8a206c62 100644
--- a/src/main/java/org/olat/resource/accesscontrol/model/AuthorACSecurityCallback.java
+++ b/src/main/java/org/olat/resource/accesscontrol/model/AuthorACSecurityCallback.java
@@ -40,7 +40,7 @@ public class AuthorACSecurityCallback implements AccessMethodSecurityCallback {
 
 	@Override
 	public boolean canUse() {
-		return roles.isAuthor() || roles.isInstitutionalResourceManager() || roles.isOLATAdmin();
+		return roles.isAuthor() || roles.isLearnResourceManager() || roles.isOLATAdmin();
 	}
 
 }
diff --git a/src/main/java/org/olat/restapi/repository/RepositoryEntriesResource.java b/src/main/java/org/olat/restapi/repository/RepositoryEntriesResource.java
index f54af70c7af47042ab7e7eb4c7cd4e6b7450b3fc..37922c7ce8230133968fdd555df857f83247f381 100644
--- a/src/main/java/org/olat/restapi/repository/RepositoryEntriesResource.java
+++ b/src/main/java/org/olat/restapi/repository/RepositoryEntriesResource.java
@@ -56,8 +56,11 @@ import javax.ws.rs.core.UriInfo;
 
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityManager;
+import org.olat.basesecurity.OrganisationService;
+import org.olat.basesecurity.model.OrganisationRefImpl;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -233,7 +236,7 @@ public class RepositoryEntriesResource {
 			@Context HttpServletRequest httpRequest) {
 		RepositoryManager rm = RepositoryManager.getInstance();
 		try {
-			List<RepositoryEntry> reposFound = new ArrayList<RepositoryEntry>();
+			List<RepositoryEntry> reposFound = new ArrayList<>();
 			Identity identity = getIdentity(httpRequest);
 			boolean restrictedType = type != null && !type.isEmpty();
 			
@@ -248,14 +251,16 @@ public class RepositoryEntriesResource {
 					// filter by search conditions
 					for(RepositoryEntry re : lstRepos) {
 						boolean nameOk = restrictedName ? re.getDisplayname().toLowerCase().contains(name.toLowerCase()) : true;
-						boolean authorOk = restrictedAuthor ? re.getInitialAuthor().toLowerCase().equals(author.toLowerCase()) : true;
-						if(nameOk & authorOk) reposFound.add(re);
+						boolean authorOk = restrictedAuthor ? re.getInitialAuthor().equalsIgnoreCase(author) : true;
+						if(nameOk && authorOk) {
+							reposFound.add(re);
+						}
 					}
 				} else {
 					if(!lstRepos.isEmpty()) reposFound.addAll(lstRepos);
 				}
 			} else {
-				List<String> types = new ArrayList<String>(1);
+				List<String> types = new ArrayList<>(1);
 				if(restrictedType) types.add(type);
 
 				SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(name, author, null, restrictedType ? types : null, identity, roles, null);
@@ -311,7 +316,17 @@ public class RepositoryEntriesResource {
 				String softkey = partsReader.getValue("softkey");
 				String resourcename = partsReader.getValue("resourcename");
 				String displayname = partsReader.getValue("displayname");	
-				RepositoryEntry re = importFileResource(identity, tmpFile, resourcename, displayname, softkey, access);
+				String organisationKey = partsReader.getValue("organisationkey");
+				Organisation organisation = null;
+				if(StringHelper.containsNonWhitespace(organisationKey)) {
+					organisation = CoreSpringFactory.getImpl(OrganisationService.class)
+							.getOrganisation(new OrganisationRefImpl(Long.valueOf(organisationKey)));
+				} else {
+					organisation = CoreSpringFactory.getImpl(OrganisationService.class)
+							.getDefaultOrganisation();
+				}
+
+				RepositoryEntry re = importFileResource(identity, tmpFile, resourcename, displayname, softkey, access, organisation);
 				RepositoryEntryVO vo = ObjectFactory.get(re);
 				return Response.ok(vo).build();
 			}
@@ -325,7 +340,7 @@ public class RepositoryEntriesResource {
 	}
 	
 	private RepositoryEntry importFileResource(Identity identity, File fResource, String resourcename,
-			String displayname, String softkey, int access) {
+			String displayname, String softkey, int access, Organisation organisation) {
 
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
 		RepositoryHandlerFactory handlerFactory = CoreSpringFactory.getImpl(RepositoryHandlerFactory.class);
@@ -345,7 +360,7 @@ public class RepositoryEntriesResource {
 				Locale locale = I18nModule.getDefaultLocale();
 				
 				addedEntry = handler.importResource(identity, null, displayname,
-						"", true, locale, fResource, fResource.getName());
+						"", true, organisation, locale, fResource, fResource.getName());
 				
 				if(StringHelper.containsNonWhitespace(resourcename)) {
 					addedEntry.setResourcename(resourcename);
diff --git a/src/main/java/org/olat/restapi/repository/RepositoryEntryLifecycleWebService.java b/src/main/java/org/olat/restapi/repository/RepositoryEntryLifecycleWebService.java
index 0b557293e0a2bb979e3752f48a585d07f80e6641..d1adeab6c514cdd6c7e9a0a3a7bb51433540466e 100644
--- a/src/main/java/org/olat/restapi/repository/RepositoryEntryLifecycleWebService.java
+++ b/src/main/java/org/olat/restapi/repository/RepositoryEntryLifecycleWebService.java
@@ -62,13 +62,13 @@ public class RepositoryEntryLifecycleWebService {
 	@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 	public Response getPublicLifeCycles(@Context HttpServletRequest httpRequest) {
 		Roles roles = getRoles(httpRequest);
-		if(!roles.isInstitutionalResourceManager() && !roles.isOLATAdmin()) {
+		if(!roles.isLearnResourceManager() && !roles.isOLATAdmin()) {
 			return Response.serverError().status(Status.UNAUTHORIZED).build();
 		}
 		
 		RepositoryEntryLifecycleDAO lifeCycleDao = CoreSpringFactory.getImpl(RepositoryEntryLifecycleDAO.class);
 		List<RepositoryEntryLifecycle> publicLifeCycles = lifeCycleDao.loadPublicLifecycle();
-		List<RepositoryEntryLifecycleVO> voList = new ArrayList<RepositoryEntryLifecycleVO>(publicLifeCycles.size());
+		List<RepositoryEntryLifecycleVO> voList = new ArrayList<>(publicLifeCycles.size());
 		for(RepositoryEntryLifecycle lifeCycle: publicLifeCycles) {
 			voList.add(new RepositoryEntryLifecycleVO(lifeCycle));
 		}
diff --git a/src/main/java/org/olat/restapi/repository/RepositoryEntryResource.java b/src/main/java/org/olat/restapi/repository/RepositoryEntryResource.java
index c63f92bda5bcd6b90062ffe1fc6d2c9436c88d84..75faf966177962ff8363e04c310e284ae8ef4fb8 100644
--- a/src/main/java/org/olat/restapi/repository/RepositoryEntryResource.java
+++ b/src/main/java/org/olat/restapi/repository/RepositoryEntryResource.java
@@ -26,16 +26,19 @@ package org.olat.restapi.repository;
 
 import static org.olat.restapi.security.RestSecurityHelper.getIdentity;
 import static org.olat.restapi.security.RestSecurityHelper.getUserRequest;
+import static org.olat.restapi.security.RestSecurityHelper.isAdmin;
 import static org.olat.restapi.security.RestSecurityHelper.isAuthor;
 import static org.olat.restapi.security.RestSecurityHelper.isAuthorEditor;
 
 import java.io.File;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
 import javax.ws.rs.FormParam;
@@ -558,42 +561,65 @@ public class RepositoryEntryResource {
    * @param request The HTTP request
    * @return
    */
-  @GET
-  @Path("file")
-  @Produces({"application/zip", MediaType.APPLICATION_OCTET_STREAM})
-  public Response getRepoFileById(@PathParam("repoEntryKey")String repoEntryKey, @Context HttpServletRequest request) {
-    RepositoryEntry re = lookupRepositoryEntry(repoEntryKey);
-    if(re == null) return Response.serverError().status(Status.NOT_FOUND).build();
+	@GET
+	@Path("file")
+	@Produces({ "application/zip", MediaType.APPLICATION_OCTET_STREAM })
+	public Response getRepoFileById(@PathParam("repoEntryKey") String repoEntryKey,
+			@Context HttpServletRequest request, @Context HttpServletResponse response) {
+		RepositoryEntry re = lookupRepositoryEntry(repoEntryKey);
+		if (re == null) {
+			return Response.serverError().status(Status.NOT_FOUND).build();
+		}
 
-    RepositoryHandler typeToDownload = RepositoryHandlerFactory.getInstance().getRepositoryHandler(re);
-    if(typeToDownload == null) return Response.serverError().status(Status.NOT_FOUND).build();
-    
-    OLATResource ores = OLATResourceManager.getInstance().findResourceable(re.getOlatResource());
-    if(ores == null) return Response.serverError().status(Status.NOT_FOUND).build();
-
-    Identity identity = getIdentity(request);
-    boolean isAuthor = RestSecurityHelper.isAuthor(request);
-    boolean isOwner = repositoryManager.isOwnerOfRepositoryEntry(identity, re);
-    if(!(isAuthor | isOwner)) return Response.serverError().status(Status.UNAUTHORIZED).build();
-    boolean canDownload = re.getCanDownload() && typeToDownload.supportsDownload();
-    if(!canDownload) return Response.serverError().status(Status.NOT_ACCEPTABLE).build();
-
-    boolean isAlreadyLocked = typeToDownload.isLocked(ores);
-    LockResult lockResult = null;
-    try {
-      lockResult = typeToDownload.acquireLock(ores, identity);
-      if(lockResult == null || (lockResult != null && lockResult.isSuccess() && !isAlreadyLocked)) {
-        MediaResource mr = typeToDownload.getAsMediaResource(ores, false);
-        if(mr != null) {
-        	repositoryService.incrementDownloadCounter(re);
-          return Response.ok(mr.getInputStream()).cacheControl(cc).build(); // success
-        } else return Response.serverError().status(Status.NO_CONTENT).build();
-      } else return Response.serverError().status(Status.CONFLICT).build();
-    }
-    finally {
-      if((lockResult != null && lockResult.isSuccess() && !isAlreadyLocked)) typeToDownload.releaseLock(lockResult);
-    }
-  }
+		RepositoryHandler typeToDownload = RepositoryHandlerFactory.getInstance().getRepositoryHandler(re);
+		if (typeToDownload == null) {
+			return Response.serverError().status(Status.NOT_FOUND).build();
+		}
+
+		OLATResource ores = OLATResourceManager.getInstance().findResourceable(re.getOlatResource());
+		if (ores == null) {
+			return Response.serverError().status(Status.NOT_FOUND).build();
+		}
+
+		Identity identity = getIdentity(request);
+		boolean canDownload = re.getCanDownload() && typeToDownload.supportsDownload();
+		if (isAdmin(request) || RepositoryManager.getInstance().isOwnerOfRepositoryEntry(identity, re)) {
+			canDownload = true;
+		} else if(!isAuthor(request)) {
+			return Response.serverError().status(Status.UNAUTHORIZED).build();
+		}
+
+		if (!canDownload) {
+			return Response.serverError().status(Status.NOT_ACCEPTABLE).build();
+		}
+
+		boolean isAlreadyLocked = typeToDownload.isLocked(ores);
+		LockResult lockResult = null;
+		try {
+			lockResult = typeToDownload.acquireLock(ores, identity);
+			if (lockResult == null || (lockResult.isSuccess() && !isAlreadyLocked)) {
+				MediaResource mr = typeToDownload.getAsMediaResource(ores, false);
+				if (mr != null) {
+					repositoryService.incrementDownloadCounter(re);
+					InputStream in = mr.getInputStream();
+					if(in == null) {
+						mr.prepare(response);
+						return null;
+					} else {
+						return Response.ok(in).cacheControl(cc).build(); // success
+					}
+				} else {
+					return Response.serverError().status(Status.NO_CONTENT).build();
+				}
+			} else {
+				return Response.serverError().status(Status.CONFLICT).build();
+			}
+		} finally {
+			if ((lockResult != null && lockResult.isSuccess() && !isAlreadyLocked)) {
+				typeToDownload.releaseLock(lockResult);
+			}
+		}
+	}
   
   @POST
   @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
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 7ea56185326a8c046feddd945c9e773f8f25c0d3..d3577688c74e5c55a9f851da37f19a8ed92c8bce 100644
--- a/src/main/java/org/olat/restapi/repository/course/CoursesWebService.java
+++ b/src/main/java/org/olat/restapi/repository/course/CoursesWebService.java
@@ -49,11 +49,14 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
 import org.olat.basesecurity.BaseSecurityManager;
+import org.olat.basesecurity.OrganisationService;
+import org.olat.basesecurity.model.OrganisationRefImpl;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -232,7 +235,8 @@ public class CoursesWebService {
 			@QueryParam("authors") String authors, @QueryParam("location") String location,
 			@QueryParam("managedFlags") String managedFlags, @QueryParam("sharedFolderSoftKey") String sharedFolderSoftKey,
 			@QueryParam("copyFrom") Long copyFrom, @QueryParam("initialAuthor") Long initialAuthor,
-			@QueryParam("setAuthor")  @DefaultValue("true") Boolean setAuthor, @Context HttpServletRequest request) {
+			@QueryParam("setAuthor")  @DefaultValue("true") Boolean setAuthor,
+			@QueryParam("organisationKey") Long organisationKey, @Context HttpServletRequest request) {
 		if(!isAuthor(request)) {
 			return Response.serverError().status(Status.UNAUTHORIZED).build();
 		}
@@ -256,10 +260,14 @@ public class CoursesWebService {
 				id = ureq.getIdentity();
 			}
 		}
+
 		if(copyFrom != null) {
-			course = copyCourse(copyFrom, ureq, id, shortTitle, title, displayName, description, softKey, accessInt, membersOnlyBool, authors, location, externalId, externalRef, managedFlags, configVO);
+			course = copyCourse(copyFrom, ureq, id, shortTitle, title, displayName, description, softKey,
+					accessInt, membersOnlyBool, organisationKey,
+					authors, location, externalId, externalRef, managedFlags, configVO);
 		} else {
-			course = createEmptyCourse(id, shortTitle, title, displayName, description, softKey, accessInt, membersOnlyBool, authors, location, externalId, externalRef, managedFlags, configVO);
+			course = createEmptyCourse(id, shortTitle, title, displayName, description, softKey,
+					accessInt, membersOnlyBool, organisationKey, authors, location, externalId, externalRef, managedFlags, configVO);
 		}
 		if(course == null) {
 			return Response.serverError().status(Status.NOT_FOUND).build();
@@ -292,7 +300,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.getSoftKey(), RepositoryEntry.ACC_OWNERS, false, courseVo.getOrganisationKey(),
 				courseVo.getAuthors(), courseVo.getLocation(),
 				courseVo.getExternalId(), courseVo.getExternalRef(), courseVo.getManagedFlags(),
 				configVO);
@@ -344,7 +352,14 @@ public class CoursesWebService {
 				boolean membersonly = "true".equals(membersOnlyRaw);
 				String softKey = partsReader.getValue("softkey");
 				String displayName = partsReader.getValue("displayname");
-				ICourse course = importCourse(ureq, identity, tmpFile, displayName, softKey, access, membersonly);
+				String organisation = partsReader.getValue("organisationkey");
+				Long organisationKey = null;
+				if(StringHelper.isLong(organisation)) {
+					organisationKey = Long.valueOf(organisation);
+				}
+				
+				
+				ICourse course = importCourse(ureq, identity, tmpFile, displayName, softKey, access, membersonly, organisationKey);
 				CourseVO vo = ObjectFactory.get(course);
 				return Response.ok(vo).build();
 			}
@@ -368,32 +383,36 @@ public class CoursesWebService {
 		RepositoryEntry entry = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
 		ACService acManager = CoreSpringFactory.getImpl(ACService.class);
 		AccessResult result = acManager.isAccessible(entry, identity, false);
-		if(result.isAccessible()) {
-			return true;
-		}
-		return false;
+		return result.isAccessible();
 	}
 
 	public static ICourse loadCourse(Long courseId) {
 		try {
-			ICourse course = CourseFactory.loadCourse(courseId);
-			return course;
+			return CourseFactory.loadCourse(courseId);
 		} catch(Exception ex) {
 			log.error("cannot load course with id: " + courseId, ex);
 			return null;
 		}
 	}
 
-	public static ICourse importCourse(UserRequest ureq, Identity identity, File fCourseImportZIP,
-			String displayName, String softKey, int access, boolean membersOnly) {
+	private ICourse importCourse(UserRequest ureq, Identity identity, File fCourseImportZIP,
+			String displayName, String softKey, int access, boolean membersOnly, Long organisationKey) {
 
 		log.info("REST Import course " + displayName + " START");
 		if(!StringHelper.containsNonWhitespace(displayName)) {
 			displayName = "import-" + UUID.randomUUID().toString();
 		}
+		
+		OrganisationService organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
+		Organisation organisation;
+		if(organisationKey == null) {
+			organisation = organisationService.getDefaultOrganisation();
+		} else {
+			organisation = organisationService.getOrganisation(new OrganisationRefImpl(organisationKey));
+		}
 
 		RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(CourseModule.getCourseTypeName());
-		RepositoryEntry re = handler.importResource(identity, null, displayName, null, true, Locale.ENGLISH, fCourseImportZIP, null);
+		RepositoryEntry re = handler.importResource(identity, null, displayName, null, true, organisation, Locale.ENGLISH, fCourseImportZIP, null);
 
 		if(StringHelper.containsNonWhitespace(softKey)) {
 			re.setSoftkey(softKey);
@@ -416,8 +435,8 @@ public class CoursesWebService {
 		return course;
 	}
 
-	private static ICourse copyCourse(Long copyFrom, UserRequest ureq, Identity initialAuthor, String shortTitle, String longTitle, String displayName,
-			String description, String softKey, int access, boolean membersOnly, String authors, String location, String externalId, String externalRef,
+	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) {
 
 		OLATResourceable originalOresTrans = OresHelper.createOLATResourceableInstance(CourseModule.class, copyFrom);
@@ -440,6 +459,7 @@ public class CoursesWebService {
 
 		if(lockResult == null || (lockResult != null && lockResult.isSuccess()) && !isAlreadyLocked) {
 			RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
+			OrganisationService organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
 
 			//create new repo entry
 			String name;
@@ -457,11 +477,18 @@ public class CoursesWebService {
 			if (resName == null) {
 				resName = "";
 			}
+			
+			Organisation organisation;
+			if(organisationKey == null) {
+				organisation = organisationService.getDefaultOrganisation();
+			} else {
+				organisation = organisationService.getOrganisation(new OrganisationRefImpl(organisationKey));
+			}
 
 			OLATResource sourceResource = src.getOlatResource();
 			OLATResource copyResource = OLATResourceManager.getInstance().createOLATResourceInstance(sourceResource.getResourceableTypeName());
 			RepositoryEntry preparedEntry = repositoryService.create(initialAuthor, null, resName, name,
-					description, copyResource, RepositoryEntry.ACC_OWNERS);
+					description, copyResource, RepositoryEntry.ACC_OWNERS, organisation);
 
 			RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(src);
 			preparedEntry = handler.copy(initialAuthor, src, preparedEntry);
@@ -506,18 +533,6 @@ public class CoursesWebService {
 		return null;
 	}
 
-	/**
-	 * Create an empty course with some defaults settings
-	 * @param initialAuthor Author
-	 * @param shortTitle Title of the course
-	 * @param longTitle Long title of the course
-	 * @param courseConfigVO Can be null
-	 * @return
-	 */
-	public static ICourse createEmptyCourse(Identity initialAuthor, String shortTitle, String longTitle, CourseConfigVO courseConfigVO) {
-		return createEmptyCourse(initialAuthor, shortTitle, longTitle, shortTitle, null, null, RepositoryEntry.ACC_OWNERS, false, null, null, null, null, null, courseConfigVO);
-	}
-
 	/**
 	 * Create an empty course with some settings
 	 * @param initialAuthor
@@ -530,8 +545,8 @@ public class CoursesWebService {
 	 * @param courseConfigVO
 	 * @return
 	 */
-	public static ICourse createEmptyCourse(Identity initialAuthor, String shortTitle, String longTitle, String reDisplayName,
-			String description, String softKey, int access, boolean membersOnly, String authors, String location,
+	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) {
 
 		if(!StringHelper.containsNonWhitespace(reDisplayName)) {
@@ -539,10 +554,20 @@ public class CoursesWebService {
 		}
 
 		try {
-			// create a repository entry
+
 			RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
+			OrganisationService organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
+			
+			Organisation organisation;
+			if(organisationKey == null) {
+				organisation = organisationService.getDefaultOrganisation();
+			} else {
+				organisation = organisationService.getOrganisation(new OrganisationRefImpl(organisationKey));
+			}
+
+			// create a repository entry
 			OLATResource resource = OLATResourceManager.getInstance().createOLATResourceInstance(CourseModule.class);
-			RepositoryEntry addedEntry = repositoryService.create(initialAuthor, null, "-", reDisplayName, null, resource, 0);
+			RepositoryEntry addedEntry = repositoryService.create(initialAuthor, null, "-", reDisplayName, null, resource, 0, organisation);
 			if(StringHelper.containsNonWhitespace(softKey) && softKey.length() <= 30) {
 				addedEntry.setSoftkey(softKey);
 			}
@@ -574,7 +599,7 @@ public class CoursesWebService {
 		}
 	}
 
-	private static ICourse prepareCourse(RepositoryEntry addedEntry, String shortTitle, String longTitle, CourseConfigVO courseConfigVO) {
+	private ICourse prepareCourse(RepositoryEntry addedEntry, String shortTitle, String longTitle, CourseConfigVO courseConfigVO) {
 		// set root node title
 		String courseShortTitle = addedEntry.getDisplayname();
 		if(StringHelper.containsNonWhitespace(shortTitle)) {
diff --git a/src/main/java/org/olat/restapi/security/RestSecurityHelper.java b/src/main/java/org/olat/restapi/security/RestSecurityHelper.java
index a01169c863b2fba034feb30d8818cead6d669f40..bee3e82543ddb8d5d57256016aa6c67d84c610f3 100644
--- a/src/main/java/org/olat/restapi/security/RestSecurityHelper.java
+++ b/src/main/java/org/olat/restapi/security/RestSecurityHelper.java
@@ -93,7 +93,7 @@ public class RestSecurityHelper {
 	public static boolean isAuthor(HttpServletRequest request) {
 		try {
 			Roles roles = getRoles(request);
-			return (roles.isAuthor() || roles.isOLATAdmin() || roles.isInstitutionalResourceManager());
+			return (roles.isAuthor() || roles.isOLATAdmin() || roles.isLearnResourceManager());
 		} catch (Exception e) {
 			return false;
 		}
@@ -150,7 +150,7 @@ public class RestSecurityHelper {
 	public static boolean isInstitutionalResourceManager(HttpServletRequest request) {
 		try {
 			Roles roles = getRoles(request);
-			return (roles.isInstitutionalResourceManager() || roles.isOLATAdmin());
+			return (roles.isLearnResourceManager() || roles.isOLATAdmin());
 		} catch (Exception e) {
 			return false;
 		}
@@ -181,11 +181,8 @@ public class RestSecurityHelper {
 				return true;
 			}
 			UserRequest ureq = (UserRequest)request.getAttribute(SEC_USER_REQUEST);
-			if(ureq != null && ureq.getUserSession() != null
-					&& ureq.getUserSession().getEntry(SYSTEM_MARKER) != null) {
-				return true;
-			}
-			return false;
+			return ureq != null && ureq.getUserSession() != null
+					&& ureq.getUserSession().getEntry(SYSTEM_MARKER) != null;
 		} catch (Exception e) {
 			return false;
 		}
diff --git a/src/main/java/org/olat/restapi/support/vo/CourseVO.java b/src/main/java/org/olat/restapi/support/vo/CourseVO.java
index 8d714f0f16c139fde52047471498ae88f1fd8463..4baf6f3f0d68a31eda1462b9805e6ac1effafc04 100644
--- a/src/main/java/org/olat/restapi/support/vo/CourseVO.java
+++ b/src/main/java/org/olat/restapi/support/vo/CourseVO.java
@@ -42,9 +42,11 @@ public class CourseVO {
 	private String displayName;
 	private String description;
 	private Long repoEntryKey;
-	@XmlAttribute(name="authors",required=false)
+	@XmlAttribute(name="organisationKey", required=false)
+	private Long organisationKey;
+	@XmlAttribute(name="authors", required=false)
 	private String authors;
-	@XmlAttribute(name="location",required=false)
+	@XmlAttribute(name="location", required=false)
 	private String location;
 	private String externalId;
 	private String externalRef;
@@ -127,6 +129,14 @@ public class CourseVO {
 		this.managedFlags = managedFlags;
 	}
 
+	public Long getOrganisationKey() {
+		return organisationKey;
+	}
+
+	public void setOrganisationKey(Long organisationKey) {
+		this.organisationKey = organisationKey;
+	}
+
 	public Long getOlatResourceKey() {
 		return olatResourceKey;
 	}
diff --git a/src/main/java/org/olat/user/ChangePrefsController.java b/src/main/java/org/olat/user/ChangePrefsController.java
index d6a6231623886904fb901d7d5f8b30cfbcd6284c..4b48de9c2e9fba5d80ab15eb8f89b5c3e9724494 100644
--- a/src/main/java/org/olat/user/ChangePrefsController.java
+++ b/src/main/java/org/olat/user/ChangePrefsController.java
@@ -299,6 +299,8 @@ class UserPrefsResetForm extends FormBasicController {
 	@Autowired
 	private I18nModule i18nModule;
 	@Autowired
+	private HistoryManager historyManager;
+	@Autowired
 	private UserSessionManager sessionManager;
 	
 	public UserPrefsResetForm(UserRequest ureq, WindowControl wControl, Identity changeableIdentity) {
@@ -372,7 +374,7 @@ class UserPrefsResetForm extends FormBasicController {
 			}
 			// Reset history
 			if (resetElements.isSelected(2)) {
-				HistoryManager.getInstance().deleteHistory(tobeChangedIdentity);
+				historyManager.deleteHistory(tobeChangedIdentity);
 			}
 			// reset form buttons
 			resetElements.uncheckAll();
diff --git a/src/main/java/org/olat/user/HomePageDisplayController.java b/src/main/java/org/olat/user/HomePageDisplayController.java
index 0ce83055282a51295e6d120ad69ef0282509833b..2dea9df48b8fbcb3c4aec9992a9edd269b83db11 100644
--- a/src/main/java/org/olat/user/HomePageDisplayController.java
+++ b/src/main/java/org/olat/user/HomePageDisplayController.java
@@ -30,7 +30,9 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.olat.core.CoreSpringFactory;
+import org.olat.basesecurity.OrganisationModule;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.image.ImageComponent;
@@ -43,9 +45,11 @@ import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
 import org.olat.core.helpers.Settings;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.User;
 import org.olat.core.id.UserConstants;
 import org.olat.core.util.StringHelper;
+import org.olat.core.util.UserSession;
 import org.olat.instantMessaging.ImPreferences;
 import org.olat.instantMessaging.InstantMessagingModule;
 import org.olat.instantMessaging.InstantMessagingService;
@@ -72,6 +76,12 @@ public class HomePageDisplayController extends BasicController {
 	private UserManager userManager;
 	@Autowired
 	private InstantMessagingModule imModule;
+	@Autowired
+	private InstantMessagingService imService;
+	@Autowired
+	private OrganisationModule organisationModule;
+	@Autowired
+	private OrganisationService organisationService;
 
 	/**
 	 * @param ureq
@@ -94,7 +104,7 @@ public class HomePageDisplayController extends BasicController {
 		// add configured property handlers and the homepage config
 		// do the looping in the velocity context
 		List<UserPropertyHandler> userPropertyHandlers
-			= new ArrayList<UserPropertyHandler>(userManager.getUserPropertyHandlersFor(usageIdentifyer, false));
+			= new ArrayList<>(userManager.getUserPropertyHandlersFor(usageIdentifyer, false));
 		UserPropertyHandler userSearchedInterestsHandler = null;
 		UserPropertyHandler userInterestsHandler = null;
 		for(Iterator<UserPropertyHandler> propIt=userPropertyHandlers.iterator(); propIt.hasNext(); ) {
@@ -124,22 +134,40 @@ public class HomePageDisplayController extends BasicController {
 		Controller dpc = new DisplayPortraitController(ureq, getWindowControl(), homeIdentity, true, false);
 		listenTo(dpc); // auto dispose
 		mainVC.put("image", dpc.getInitialComponent());
-
+		
+		UserSession usess = ureq.getUserSession();
+		
+		exposeOrganisations(homeIdentity, mainVC);
+		exposeLogo(usess, homeIdentity, mainVC);
+		exposeInstantMessageLink(homeIdentity, mainVC);
+		putInitialPanel(mainVC);
+	}
+	
+	private void exposeOrganisations(Identity homeIdentity, VelocityContainer mainVC) {
+		if(organisationModule.isEnabled()) {
+			List<Organisation> organisations = organisationService.getOrganisations(homeIdentity, OrganisationRoles.values());
+			List<String> organisationNames = new ArrayList<>(organisations.size());
+			for(Organisation organisation:organisations) {
+				organisationNames.add(organisation.getDisplayName());
+			}
+			mainVC.contextPut("organisations", organisationNames);
+		}
+	}
+	
+	private void exposeLogo(UserSession usess, Identity homeIdentity, VelocityContainer mainVC) {
 		if(userModule.isLogoByProfileEnabled()) {
 			File logo = DisplayPortraitManager.getInstance().getBigLogo(homeIdentity.getName());
 			if (logo != null) {
-				ImageComponent logoCmp = new ImageComponent(ureq.getUserSession(), "logo");
+				ImageComponent logoCmp = new ImageComponent(usess, "logo");
 				logoCmp.setMedia(logo);
 				logoCmp.setMaxWithAndHeightToFitWithin(200, 66);
 				mainVC.put("logo", logoCmp);				
 			}
 		}
-		
-		putInitialPanel(mainVC);
-		
-		
+	}
+	
+	private void exposeInstantMessageLink(Identity homeIdentity, VelocityContainer mainVC) {
 		if(imModule.isEnabled() && imModule.isPrivateEnabled()) {
-			InstantMessagingService imService = CoreSpringFactory.getImpl(InstantMessagingService.class);
 			ImPreferences prefs = imService.getImPreferences(homeIdentity);
 			if(prefs.isVisibleToOthers()) {
 				User user = homeIdentity.getUser();
@@ -157,14 +185,10 @@ public class HomePageDisplayController extends BasicController {
 	}
 	
 	private String getStatusCss(Buddy buddy) {
-		StringBuilder sb = new StringBuilder(32);
-		sb.append("o_icon_status_").append(buddy.getStatus());
-		return sb.toString();
+		return "o_icon_status_".concat(buddy.getStatus());
 	}
 
-	/**
-	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
-	 */
+	@Override
 	public void event(UserRequest ureq, Component source, Event event) {
 		if(imLink == source) {
 			Buddy buddy = (Buddy)imLink.getUserObject();
@@ -173,10 +197,7 @@ public class HomePageDisplayController extends BasicController {
 		}
 	}
 
-	/**
-	 * 
-	 * @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
-	 */
+	@Override
 	protected void doDispose() {
 		// child controller disposed by basic controller
 	}
diff --git a/src/main/java/org/olat/user/ProfileFormController.java b/src/main/java/org/olat/user/ProfileFormController.java
index d896b2afb0733e83131e2d3a2c07bca4213761eb..142f0994ba10760a9e2f30c0f9db43ec45651c54 100644
--- a/src/main/java/org/olat/user/ProfileFormController.java
+++ b/src/main/java/org/olat/user/ProfileFormController.java
@@ -32,6 +32,8 @@ import java.util.Set;
 
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.BaseSecurityModule;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.form.flexible.FormItem;
@@ -52,8 +54,10 @@ import org.olat.core.gui.control.generic.modal.DialogBoxUIFactory;
 import org.olat.core.helpers.Settings;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.User;
 import org.olat.core.util.StringHelper;
+import org.olat.core.util.UserSession;
 import org.olat.core.util.WebappHelper;
 import org.olat.core.util.coordinate.CoordinatorManager;
 import org.olat.core.util.coordinate.SyncerExecutor;
@@ -89,6 +93,7 @@ public class ProfileFormController extends FormBasicController {
 	private RichTextElement textAboutMe;
 
 	private Identity identityToModify;
+	private List<Organisation> identityOrganisations;
 	private DialogBoxController dialogCtr;
 
 	private FileElement logoUpload;
@@ -118,6 +123,8 @@ public class ProfileFormController extends FormBasicController {
 	private HomePageConfigManager hpcm;
 	@Autowired
 	private DisplayPortraitManager dps;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	/**
 	 * Create this controller with the request's identity as none administrative
@@ -148,10 +155,12 @@ public class ProfileFormController extends FormBasicController {
 		setFormStyle("o_user_profile_form");
 		
 		this.identityToModify = identityToModify;
-		this.isAdministrativeUser = isAdministrativeUser;
-		this.logoEnabled = userModule.isLogoByProfileEnabled();
+		logoEnabled = userModule.isLogoByProfileEnabled();
+		identityOrganisations = organisationService.getOrganisations(identityToModify, OrganisationRoles.values());
 		
+		this.isAdministrativeUser = isAdministrativeUser;
 		userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifier, isAdministrativeUser);
+		
 		initForm(ureq);
 	}
 	
@@ -166,7 +175,6 @@ public class ProfileFormController extends FormBasicController {
 
 	@Override
 	protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
-
 		User user = identityToModify.getUser();
 
 		// show a form element for each property handler 
@@ -607,9 +615,15 @@ public class ProfileFormController extends FormBasicController {
 	}
 
 	private boolean isAllowedToChangeEmailWithoutVerification(final UserRequest ureq) {
-		boolean isOLATAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
-		boolean isUserManagerAndBypassVerification = BaseSecurityModule.USERMANAGER_CAN_BYPASS_EMAILVERIFICATION
-				&& ureq.getUserSession().getRoles().isUserManager();
+		UserSession usess = ureq.getUserSession();
+		boolean isOLATAdmin = usess .getRoles().isOLATAdmin();
+		boolean isUserManagerAndBypassVerification = false;
+		if(!isOLATAdmin && usess.getRoles().isUserManager() && BaseSecurityModule.USERMANAGER_CAN_BYPASS_EMAILVERIFICATION.booleanValue()) {
+			//check if the user manager is allowed to manage this user
+			List<Organisation> organisations = organisationService.getManageableOrganisations(getIdentity(), usess.getRoles(), OrganisationRoles.usermanager);
+			organisations.retainAll(identityOrganisations);
+			isUserManagerAndBypassVerification = !organisations.isEmpty();
+		}
 		return isOLATAdmin || isUserManagerAndBypassVerification;
 	}
 }
diff --git a/src/main/java/org/olat/user/UserManager.java b/src/main/java/org/olat/user/UserManager.java
index 1fe345bd48a4608d0a1da7875e6cc6cd202f78dc..fb18605008c25c2bd18cb52fdbbb861d1f05dd41 100644
--- a/src/main/java/org/olat/user/UserManager.java
+++ b/src/main/java/org/olat/user/UserManager.java
@@ -35,7 +35,6 @@ import org.olat.basesecurity.IdentityRef;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.User;
-import org.olat.core.manager.BasicManager;
 import org.olat.user.propertyhandlers.UserPropertyHandler;
 
 /**
@@ -50,7 +49,7 @@ import org.olat.user.propertyhandlers.UserPropertyHandler;
  * 
  * @author Florian Gnaegi, frentix GmbH, http://www.frentix.com
  */
-public abstract class UserManager extends BasicManager {
+public abstract class UserManager {
 	protected static UserManager INSTANCE;
 	
 	// injected by spring configuration
diff --git a/src/main/java/org/olat/user/UserManagerImpl.java b/src/main/java/org/olat/user/UserManagerImpl.java
index d29f965cbd1a66276bdd4ce26864ee24974c24ba..ba7e0005225c7474a8a3060259df0feb280335be 100644
--- a/src/main/java/org/olat/user/UserManagerImpl.java
+++ b/src/main/java/org/olat/user/UserManagerImpl.java
@@ -47,6 +47,8 @@ import org.olat.core.id.Preferences;
 import org.olat.core.id.User;
 import org.olat.core.id.UserConstants;
 import org.olat.core.logging.AssertException;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 import org.olat.core.util.StringHelper;
 import org.olat.core.util.Util;
 import org.olat.core.util.WebappHelper;
@@ -71,6 +73,9 @@ import org.springframework.beans.factory.annotation.Autowired;
  * @author Florian Gnaegi, frentix GmbH, http://www.frentix.com
  */
 public class UserManagerImpl extends UserManager {
+	
+	private static final OLog log = Tracing.createLoggerFor(UserManagerImpl.class);
+	
   // used to save user data in the properties table 
   private static final String CHARSET = "charset";
   private UserDisplayNameCreator userDisplayNameCreator;
@@ -152,13 +157,9 @@ public class UserManagerImpl extends UserManager {
 			.append(" inner join fetch identity.user user ")
 			.append(" where user.").append(propName).append("=:propValue");
 
-		List<Identity> userKeys = dbInstance.getCurrentEntityManager()
+		return dbInstance.getCurrentEntityManager()
 				.createQuery(sb.toString(), Identity.class)
 				.setParameter("propValue", propValue).getResultList();
-		if(userKeys.isEmpty()) {
-			return null;
-		}
-		return userKeys;
 	}
 
 	@Override
@@ -173,7 +174,7 @@ public class UserManagerImpl extends UserManager {
 			String email = emails.get(i).toLowerCase();
 			if (!MailHelper.isValidEmailAddress(email)) {
 				emails.remove(i);
-				logWarn("Invalid email address: " + email, null);
+				log.warn("Invalid email address: " + email, null);
 			}
 			else {
 				emails.set(i, email);
@@ -278,7 +279,7 @@ public class UserManagerImpl extends UserManager {
 			String fullName = getUserDisplayName(identity);
 			updateUsernameCache(identity.getKey(), identity.getName(), fullName);
 		} catch (Exception e) {
-			logWarn("Error update usernames cache", e);
+			log.warn("Error update usernames cache", e);
 		}
 		User user = updateUser(identity.getUser());
 		((IdentityImpl)identity).setUser(user);
diff --git a/src/main/java/org/olat/user/_content/homepagedisplay.html b/src/main/java/org/olat/user/_content/homepagedisplay.html
index db80336ff646f2046f2977b6c36c9cd9e742f211..58bb23140ea7c07a271c0bf5e93a3c1edd00296a 100644
--- a/src/main/java/org/olat/user/_content/homepagedisplay.html
+++ b/src/main/java/org/olat/user/_content/homepagedisplay.html
@@ -35,13 +35,24 @@
 					<td colspan="3">$!propertyHandler.getUserPropertyAsHTML($user, $locale)</td>
 				#end
 			</tr>
-			#end		
-		#if( $homepageConfig.getTextAboutMe() && ($homepageConfig.getTextAboutMe() != "") )
-		<tr valign="top" class="o_user_aboutme">
-			<th>$r.translate("form.text")</th>
-			<td colspan="3">$!r.formatLatexFormulas($homepageConfig.getTextAboutMe())</td>
-		</tr>		
-		#end
+			#end	
+			
+			#if($r.isNotEmpty($organisations))
+			<tr valign="top" class="o_usser_organisations">
+				<th>$r.translate("form.organisations")</th>
+				<td colspan="3"><ul class="list-unstyled">
+				#foreach($organisation in $organisations)
+					<li>$r.escapeHtml($organisation)</li>
+				#end
+				</ul></td>
+			</tr>
+			#end				
+			#if( $homepageConfig.getTextAboutMe() && ($homepageConfig.getTextAboutMe() != "") )
+			<tr valign="top" class="o_user_aboutme">
+				<th>$r.translate("form.text")</th>
+				<td colspan="3">$!r.formatLatexFormulas($homepageConfig.getTextAboutMe())</td>
+			</tr>		
+			#end
 		</table>
 	</div>
 </div></div>
diff --git a/src/main/java/org/olat/user/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/user/_i18n/LocalStrings_de.properties
index 621354447675c868f960dd5b0573bcdf0a007ee6..d806d96760e232fbb1819e9ffbf43634dde25682 100644
--- a/src/main/java/org/olat/user/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/user/_i18n/LocalStrings_de.properties
@@ -45,6 +45,7 @@ form.fontsize.xsmall=Extra klein
 form.informSessionTimeout=Benachrichtigung Session Timeout nach 25 Minuten
 form.language=Sprache
 form.notification=E-Mail-Benachrichtigung
+form.organisations=Organisationen
 form.password.new1=Neues OpenOLAT-Passwort
 form.password.new2=OLAT-Passwort best\u00E4tigen
 form.password.old=Bisheriges OpenOLAT-Passwort
diff --git a/src/main/java/org/olat/user/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/user/_i18n/LocalStrings_en.properties
index b15c85add2f69c9d9e76fdda5d23652898daee34..e4a988e16a5a2e7cbe434900a991aba6c04e0048 100644
--- a/src/main/java/org/olat/user/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/user/_i18n/LocalStrings_en.properties
@@ -45,6 +45,7 @@ form.fontsize.xsmall=Extra small
 form.informSessionTimeout=Session time-out notification after 25 minutes
 form.language=Language
 form.notification=E-mail notification
+form.organisations=Organisations
 form.password.new1=New OpenOLAT password
 form.password.new2=Confirm OpenOLAT password
 form.password.old=Old OpenOLAT password
diff --git a/src/main/java/org/olat/user/notification/UsersSubscriptionManagerImpl.java b/src/main/java/org/olat/user/notification/UsersSubscriptionManagerImpl.java
index 031d0995d06a0061e6bd6286c3d2189d88c296fc..858604b639bcc6be274dc8d3944b9ed5c366271a 100644
--- a/src/main/java/org/olat/user/notification/UsersSubscriptionManagerImpl.java
+++ b/src/main/java/org/olat/user/notification/UsersSubscriptionManagerImpl.java
@@ -19,6 +19,7 @@
  */
 package org.olat.user.notification;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
@@ -149,13 +150,13 @@ public class UsersSubscriptionManagerImpl implements UsersSubscriptionManager, G
 	public List<Identity> getNewIdentityCreated(Date from, Identity actingIdentity, Roles roles) {
 		if(from == null || (!roles.isUserManager() && !roles.isOLATAdmin())) return Collections.emptyList();
 
-		List<Organisation> userManagerOrganisations = null;
-		if(!roles.isOLATAdmin()) {
-			userManagerOrganisations = organisationDao
-					.getOrganisations(actingIdentity, Collections.singletonList(OrganisationRoles.usermanager.name()));
-			if(userManagerOrganisations.isEmpty()) {
-				return Collections.emptyList();
-			}
+		List<String> managerRoles = new ArrayList<>();
+		managerRoles.add(OrganisationRoles.administrator.name());
+		managerRoles.add(OrganisationRoles.usermanager.name());
+		
+		List<Organisation> userManagerOrganisations = organisationDao.getOrganisations(actingIdentity, managerRoles);
+		if(userManagerOrganisations.isEmpty()) {
+			return Collections.emptyList();
 		}
 		
 		SearchIdentityParams params = new SearchIdentityParams();
diff --git a/src/main/java/org/olat/user/restapi/RolesVO.java b/src/main/java/org/olat/user/restapi/RolesVO.java
index 390999911695bb303a8ef85384e0316c7a3fb67a..63d26ae64cceb3ff4b947ddf5a170fa47d37e1dc 100644
--- a/src/main/java/org/olat/user/restapi/RolesVO.java
+++ b/src/main/java/org/olat/user/restapi/RolesVO.java
@@ -57,14 +57,14 @@ public class RolesVO {
 		userManager = roles.isUserManager();
 		author = roles.isAuthor();
 		guestOnly = roles.isGuestOnly();
-		institutionalResourceManager = roles.isInstitutionalResourceManager();
+		institutionalResourceManager = roles.isLearnResourceManager();
 		poolAdmin = roles.isPoolAdmin();
 		curriculumManager = roles.isCurriculumManager();
 		invitee = roles.isInvitee();
 	}
 	
 	public Roles toRoles() {
-		return new Roles(systemAdmin, olatAdmin, userManager, groupManager, author, guestOnly, institutionalResourceManager, poolAdmin, curriculumManager, invitee);
+		return new Roles(systemAdmin, olatAdmin, userManager, groupManager, author, guestOnly, institutionalResourceManager, poolAdmin, curriculumManager, false, invitee);
 	}
 
 	public boolean isSystemAdmin() {
diff --git a/src/main/java/org/olat/user/restapi/UserWebService.java b/src/main/java/org/olat/user/restapi/UserWebService.java
index c3dbb9382ab064b012d9bbdeb425918b32c125b2..8b63173b95d85c129d976942f209cc0f352cf1eb 100644
--- a/src/main/java/org/olat/user/restapi/UserWebService.java
+++ b/src/main/java/org/olat/user/restapi/UserWebService.java
@@ -272,7 +272,8 @@ public class UserWebService {
 		List<ErrorVO> errors = validateUser(null, user, request);
 		if(errors.isEmpty()) {
 			User newUser = UserManager.getInstance().createUser(user.getFirstName(), user.getLastName(), user.getEmail());
-			Identity id = BaseSecurityManager.getInstance().createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(user.getLogin(), user.getExternalId(), user.getPassword(), newUser);
+			Identity id = BaseSecurityManager.getInstance()
+					.createAndPersistIdentityAndUserWithDefaultProviderAndUserGroup(user.getLogin(), user.getExternalId(), user.getPassword(), newUser, null);
 			post(newUser, user, getLocale(request));
 			UserManager.getInstance().updateUser(newUser);
 			return Response.ok(get(id)).build();
diff --git a/src/main/java/org/olat/user/ui/admin/UserAdminMainController.java b/src/main/java/org/olat/user/ui/admin/UserAdminMainController.java
index 33bbdf99c8986656b792a129b110c48196f94950..50f92e6f83765985d1e9128e6b60fd9cbdb0dbf7 100644
--- a/src/main/java/org/olat/user/ui/admin/UserAdminMainController.java
+++ b/src/main/java/org/olat/user/ui/admin/UserAdminMainController.java
@@ -30,7 +30,6 @@ import java.util.Calendar;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import org.olat.admin.user.NewUsersNotificationsController;
 import org.olat.admin.user.UserAdminController;
@@ -71,9 +70,11 @@ import org.olat.core.gui.control.generic.messages.MessageUIFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.core.id.context.BusinessControlFactory;
 import org.olat.core.id.context.ContextEntry;
 import org.olat.core.id.context.StateEntry;
+import org.olat.core.util.UserSession;
 import org.olat.core.util.coordinate.CoordinatorManager;
 import org.olat.core.util.coordinate.LockResult;
 import org.olat.core.util.resource.OresHelper;
@@ -112,7 +113,7 @@ public class UserAdminMainController extends MainLayoutBasicController implement
 	private LayoutMain3ColsController columnLayoutCtr;
 
 	private final boolean isOlatAdmin;
-	private List<Organisation> userManagerOrganisations;
+	private List<Organisation> manageableOrganisations;
 
 	private LockResult lock;
 	@Autowired
@@ -130,9 +131,13 @@ public class UserAdminMainController extends MainLayoutBasicController implement
 	public UserAdminMainController(UserRequest ureq, WindowControl wControl) {
 		super(ureq, wControl);
 		
-		isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
-		if(!isOlatAdmin) {
-			userManagerOrganisations = organisationService.getOrganisations(getIdentity(), OrganisationRoles.usermanager);
+		UserSession usess = ureq.getUserSession();
+		isOlatAdmin = usess.getRoles().isOLATAdmin();
+		if(isOlatAdmin) {
+			manageableOrganisations = organisationService.getOrganisations();
+		} else {
+			manageableOrganisations = organisationService
+					.getManageableOrganisations(getIdentity(), usess.getRoles(), OrganisationRoles.usermanager);
 		}
 		
 		menuTree = new MenuTree("olatMenuTree");
@@ -359,11 +364,15 @@ public class UserAdminMainController extends MainLayoutBasicController implement
 	}
 	
 	private UsermanagerUserSearchController createUserSearchController(UserRequest ureq, WindowControl bwControl) {
-		return new UsermanagerUserSearchController(ureq, bwControl, content, userManagerOrganisations);
+		return new UsermanagerUserSearchController(ureq, bwControl, content, manageableOrganisations);
 	}
 	
 	private UsermanagerUserSearchController createUserSearchController(UserRequest ureq, WindowControl bwControl, SearchIdentityParams predefinedQuery) {
-		predefinedQuery.setOrganisationParents(userManagerOrganisations);
+		if(manageableOrganisations != null && predefinedQuery.getOrganisations() != null) {
+				List<OrganisationRef> allowedOrganisations = new ArrayList<>(predefinedQuery.getOrganisations());
+				allowedOrganisations	.retainAll(manageableOrganisations);
+				predefinedQuery.setOrganisations(allowedOrganisations);
+		}
 		return new UsermanagerUserSearchController(ureq, bwControl, content, predefinedQuery, true);
 	}
 	
@@ -458,12 +467,12 @@ public class UserAdminMainController extends MainLayoutBasicController implement
 
 	private void buildTreeOrganisationSubMenu(GenericTreeNode accessNode) {
 		List<Organisation> organisations;
-		if(userManagerOrganisations != null) {
+		if(manageableOrganisations != null) {
 			organisations = new ArrayList<>();
 			List<Organisation> allOrganisations = organisationService.getOrganisations();
 			for(Organisation organisation:allOrganisations) {
 				String path = organisation.getMaterializedPathKeys();
-				for(Organisation userManagerOrganisation:userManagerOrganisations) {
+				for(Organisation userManagerOrganisation:manageableOrganisations) {
 					if(path.startsWith(userManagerOrganisation.getMaterializedPathKeys())) {
 						organisations.add(organisation);
 					}
@@ -473,9 +482,11 @@ public class UserAdminMainController extends MainLayoutBasicController implement
 			organisations = organisationService.getOrganisations();
 		}
 		
-		Map<Long,Organisation> keytoOrganisations = organisations.stream()
-				.collect(Collectors.toMap(Organisation::getKey, l -> l));
-		
+		Map<Long,Organisation> keytoOrganisations = new HashMap<>();
+		for(Organisation organisation:organisations) {
+			keytoOrganisations.put(organisation.getKey(), organisation);
+		}
+
 		Map<Long, GenericTreeNode> fieldKeyToNode = new HashMap<>();
 		for(Organisation organisation:organisations) {
 			Long key = organisation.getKey();
diff --git a/src/main/java/org/olat/user/ui/organisation/OrganisationRow.java b/src/main/java/org/olat/user/ui/organisation/OrganisationRow.java
index 942149757646961163550e81976f142b8a9cd296..32070e27b21626afdcaab071af2116992842d739 100644
--- a/src/main/java/org/olat/user/ui/organisation/OrganisationRow.java
+++ b/src/main/java/org/olat/user/ui/organisation/OrganisationRow.java
@@ -19,10 +19,10 @@
  */
 package org.olat.user.ui.organisation;
 
-import org.olat.basesecurity.OrganisationRef;
 import org.olat.core.gui.components.form.flexible.elements.FormLink;
 import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTreeTableNode;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 
 /**
  * 
diff --git a/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_de.properties
index cc4f731e588e968acf9e8a025c4ca15efc2db1c9..6f22cb3f3785e38e656c365b25d7e7648387b7c3 100644
--- a/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_de.properties
@@ -9,6 +9,7 @@ curriculummanager=Curriculumverwalter
 author=Author
 user=Benutzer
 guest=Gast
+coach=Betreuer
 add.member=Benutzer hinzufügen
 add.member.role=Benutzer hinzufügen als "{0}"
 admin.description=Organisationen verwalten
diff --git a/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_en.properties
index cdf485e82b523e17f311f80c6adbed880aab4fc2..0b6ed3433fd4b6bfe62762354816d0260da82373 100644
--- a/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/user/ui/organisation/_i18n/LocalStrings_en.properties
@@ -4,6 +4,7 @@ add.user.manager=Add user manager
 admin.description=Manage your organisations
 admin.menu.title=Organisations
 admin.menu.title.alt=Organisations
+coach=Coach
 create.organisation=Create new organisation
 organisation.configuration=Organisations
 organisation.admin.enabled=Enable organisations
diff --git a/src/test/java/org/olat/admin/user/delete/service/UserDeletionManagerTest.java b/src/test/java/org/olat/admin/user/delete/service/UserDeletionManagerTest.java
index dd10abbeb014f31dc473d1be522fcfe11d7ab953..45c9ecabdee4507bcbed3270b12e380494844ce2 100644
--- a/src/test/java/org/olat/admin/user/delete/service/UserDeletionManagerTest.java
+++ b/src/test/java/org/olat/admin/user/delete/service/UserDeletionManagerTest.java
@@ -49,6 +49,7 @@ import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.portfolio.manager.EPFrontendManager;
 import org.olat.portfolio.manager.EPStructureManager;
+import org.olat.portfolio.manager.EPStructureManagerTest;
 import org.olat.portfolio.model.artefacts.AbstractArtefact;
 import org.olat.portfolio.model.structel.ElementType;
 import org.olat.portfolio.model.structel.PortfolioStructure;
@@ -97,7 +98,7 @@ public class UserDeletionManagerTest extends OlatTestCase {
 		PortfolioStructureMap map = epFrontendManager.createAndPersistPortfolioDefaultMap(identity, "A map to delete", "This map must be deleted");
 		Assert.assertNotNull(map);
 		//a template
-		PortfolioStructureMap template = epStructureManager.createPortfolioMapTemplate(identity, "A template to delete", "This template must be deleted");
+		PortfolioStructureMap template = EPStructureManagerTest.createPortfolioMapTemplate(identity, "A template to delete", "This template must be deleted");
 		epStructureManager.savePortfolioStructure(template);
 		//an artefact
 		AbstractArtefact artefact = epFrontendManager.createAndPersistArtefact(identity, "Forum");
diff --git a/src/test/java/org/olat/basesecurity/BaseSecurityManagerTest.java b/src/test/java/org/olat/basesecurity/BaseSecurityManagerTest.java
index d81300af8ec1ea7ad8e1852fa734628f1773c999..d4b114e41467fb194688c6fff5edd065301ac4c9 100644
--- a/src/test/java/org/olat/basesecurity/BaseSecurityManagerTest.java
+++ b/src/test/java/org/olat/basesecurity/BaseSecurityManagerTest.java
@@ -316,7 +316,7 @@ public class BaseSecurityManagerTest extends OlatTestCase {
 
 		//update roles
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		Roles modifiedRoles = new Roles(false, true, true, true, true, false, true, true, true, false);
+		Roles modifiedRoles = new Roles(false, true, true, true, true, false, true, true, true, false, false);
 		securityManager.updateRoles(id2, id1, defOrganisation, modifiedRoles);
 		dbInstance.commitAndCloseSession();
 		
@@ -326,7 +326,7 @@ public class BaseSecurityManagerTest extends OlatTestCase {
 		Assert.assertTrue(reloadRoles.isAuthor());
 		Assert.assertTrue(reloadRoles.isGroupManager());
 		Assert.assertFalse(reloadRoles.isGuestOnly());
-		Assert.assertTrue(reloadRoles.isInstitutionalResourceManager());
+		Assert.assertTrue(reloadRoles.isLearnResourceManager());
 		Assert.assertFalse(reloadRoles.isInvitee());
 		Assert.assertTrue(reloadRoles.isOLATAdmin());
 		Assert.assertTrue(reloadRoles.isPoolAdmin());
@@ -347,7 +347,7 @@ public class BaseSecurityManagerTest extends OlatTestCase {
 
 		//update roles
 		Organisation defOrganisation = organisationService.getDefaultOrganisation();
-		Roles modifiedRoles = new Roles(false, false, true, false, true, false, false, false, true, false);
+		Roles modifiedRoles = new Roles(false, false, true, false, true, false, false, false, true, false, false);
 		securityManager.updateRoles(id2, id1, defOrganisation, modifiedRoles);
 		dbInstance.commitAndCloseSession();
 		
@@ -357,7 +357,7 @@ public class BaseSecurityManagerTest extends OlatTestCase {
 		Assert.assertTrue(reloadRoles.isAuthor());
 		Assert.assertFalse(reloadRoles.isGroupManager());
 		Assert.assertFalse(reloadRoles.isGuestOnly());
-		Assert.assertFalse(reloadRoles.isInstitutionalResourceManager());
+		Assert.assertFalse(reloadRoles.isLearnResourceManager());
 		Assert.assertFalse(reloadRoles.isInvitee());
 		Assert.assertFalse(reloadRoles.isOLATAdmin());
 		Assert.assertFalse(reloadRoles.isPoolAdmin());
@@ -388,7 +388,7 @@ public class BaseSecurityManagerTest extends OlatTestCase {
 		Assert.assertFalse(reloadRoles.isAuthor());
 		Assert.assertFalse(reloadRoles.isGroupManager());
 		Assert.assertTrue(reloadRoles.isGuestOnly());
-		Assert.assertFalse(reloadRoles.isInstitutionalResourceManager());
+		Assert.assertFalse(reloadRoles.isLearnResourceManager());
 		Assert.assertFalse(reloadRoles.isInvitee());
 		Assert.assertFalse(reloadRoles.isOLATAdmin());
 		Assert.assertFalse(reloadRoles.isUserManager());
diff --git a/src/test/java/org/olat/basesecurity/manager/OrganisationDAOTest.java b/src/test/java/org/olat/basesecurity/manager/OrganisationDAOTest.java
index 1845084f5fc7c701e99be410a1b5e6381879e2db..0d54a49d937fbf423a3ba516b0e8d67d95a4f362 100644
--- a/src/test/java/org/olat/basesecurity/manager/OrganisationDAOTest.java
+++ b/src/test/java/org/olat/basesecurity/manager/OrganisationDAOTest.java
@@ -32,6 +32,7 @@ import org.olat.basesecurity.model.OrganisationMember;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.Organisation;
+import org.olat.core.id.OrganisationRef;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -82,6 +83,25 @@ public class OrganisationDAOTest extends OlatTestCase {
 		Assert.assertEquals(type, reloadedOrganisation.getType());
 	}
 	
+	@Test
+	public void createOrganisationWithParent() {
+		Organisation parentOrganisation = organisationDao.createAndPersistOrganisation("Org-10", null, null, null, null);
+		Organisation organisation = organisationDao.createAndPersistOrganisation("Org-10", null, null, parentOrganisation, null);
+		dbInstance.commitAndCloseSession();
+
+		Assert.assertNotNull(organisation);
+		Assert.assertNotNull(organisation.getKey());
+		Assert.assertNotNull(organisation.getCreationDate());
+		Assert.assertNotNull(organisation.getLastModified());
+		
+		// check the ad-hoc parent line
+		List<OrganisationRef> parentLine = organisation.getParentLine();
+		Assert.assertNotNull(parentLine);
+		Assert.assertEquals(1, parentLine.size());
+		Assert.assertEquals(parentOrganisation.getKey(), parentLine.get(0).getKey());
+		
+	}
+	
 	@Test
 	public void loadByIdentifier() {
 		String identifier = UUID.randomUUID().toString();
diff --git a/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java b/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java
index 9a82d5e308b9bfe2f832f0ca0e1a753086bdb153..bb3364fad863eb9c745b4406475c1e6686ac85ee 100644
--- a/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java
+++ b/src/test/java/org/olat/commons/coordinate/CoordinatorTest.java
@@ -37,9 +37,11 @@ import java.util.concurrent.TimeUnit;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.AssertException;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -62,6 +64,8 @@ public class CoordinatorTest extends OlatTestCase {
 	
 	@Autowired
 	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
 	
 
 	/**
@@ -342,7 +346,8 @@ public class CoordinatorTest extends OlatTestCase {
 		OLATResource r =  CoreSpringFactory.getImpl(OLATResourceManager.class).findOrPersistResourceable(ores);
 		int maxLoop = 500;
 
-		final RepositoryEntry re = repositoryService.create("test", "perfTest", "testPerf", "perfTest description", r);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		final RepositoryEntry re = repositoryService.create(null, "test", "perfTest", "testPerf", "perfTest description", r, 0, defOrganisation);
 		// create security group
 		repositoryService.update(re);
 		DBFactory.getInstance().commitAndCloseSession();
@@ -361,6 +366,7 @@ public class CoordinatorTest extends OlatTestCase {
 		long startTimeDoInSync = System.currentTimeMillis();
 		for (int i = 0; i<maxLoop ; i++) {
 			CoordinatorManager.getInstance().getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){
+				@Override
 				public void execute() {
 					doTestPerformanceJob(re);
 				}
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 5904d1e466ee480f3bb3966645ef4770adaf409f..2aeb847b6aa619b62af91d4a6af9d10c1ff7fb75 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
@@ -30,7 +30,6 @@ import java.util.UUID;
 
 import javax.ws.rs.core.UriBuilder;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.http.Header;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpDelete;
@@ -133,7 +132,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 			Assert.assertTrue(allowValue.contains(allowedMethod));
 		}
 
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -160,7 +159,8 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Assert.assertNotNull(typeHeader);
 		Assert.assertEquals("text/plain", typeHeader.getValue());
 		EntityUtils.consume(response.getEntity());
-		IOUtils.closeQuietly(conn);
+		
+		conn.close();
 	}
 	
 	@Test
@@ -185,7 +185,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Assert.assertTrue(publicXml.indexOf("<D:multistatus") > 0);//Windows need the D namespace
 		Assert.assertTrue(publicXml.indexOf("<D:href>/webdav/home/public/</D:href>") > 0);//check the root
 
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -219,7 +219,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Assert.assertTrue(newItem instanceof VFSContainer);
 		Assert.assertTrue(newItem.exists());
 	
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -253,7 +253,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		VFSItem sourceItem = vfsPublic.resolve("test.txt");
 		Assert.assertNull(sourceItem);
 	
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -289,7 +289,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Assert.assertTrue(sourceItem instanceof VFSLeaf);
 		Assert.assertTrue(sourceItem.exists());
 	
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -323,7 +323,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		String text = EntityUtils.toString(getResponse.getEntity());
 		Assert.assertEquals("Small text", text);
 	
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	/**
@@ -383,7 +383,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		HttpResponse patchResponse = conn.execute(patch);
 		Assert.assertEquals(207, patchResponse.getStatusLine().getStatusCode());
 	
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	/**
@@ -445,8 +445,8 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		int coauthorLock_2 = assistantConn.lockTry(putUri, coauthorLockToken_2);
 		Assert.assertEquals(200, coauthorLock_2);// it's lock
 		
-		IOUtils.closeQuietly(authorConn);
-		IOUtils.closeQuietly(assistantConn);
+		authorConn.close();
+		assistantConn.close();
 	}
 	
 	/**
@@ -494,7 +494,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Assert.assertEquals(assistant.getKey(), lock.getLockedBy());
 		Assert.assertEquals(1, lock.getTokensSize());
 
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	/**
@@ -556,7 +556,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Assert.assertEquals(user.getKey(), lockAfterUnlock.getLockedBy());
 		Assert.assertEquals(1, lock.getTokensSize());
 		
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -642,7 +642,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		VFSItem reloadTestLeaf = vfsPublic.resolve("testDelete.txt");
 		Assert.assertNull(reloadTestLeaf);
 
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -654,7 +654,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("auth-webdav");
 		Identity participant = JunitTestHelper.createAndPersistIdentityAsRndUser("participant-webdav");
 		URL courseWithForumsUrl = WebDAVCommandsTest.class.getResource("webdav_course.zip");
-		RepositoryEntry course = deployTestCourse(author, null, courseWithForumsUrl);
+		RepositoryEntry course = deployTestCourse(author, null, "WebDAV course", courseWithForumsUrl);
 		repositoryEntryRelationDao.addRole(participant, course, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
 		
@@ -686,7 +686,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("auth-webdav");
 		URL courseWithForumsUrl = WebDAVCommandsTest.class.getResource("webdav_course.zip");
-		deployTestCourse(author, null, courseWithForumsUrl);
+		deployTestCourse(author, null, "WebDAV course", courseWithForumsUrl);
 		dbInstance.commitAndCloseSession();
 		
 		WebDAVConnection conn = new WebDAVConnection();
@@ -822,7 +822,7 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 		VFSItem level5Mkcol = level_1_Container.resolve("DT2_01").resolve("DT3_01").resolve("DT4_01").resolve("DT5_01");
 		Assert.assertNull(level5Mkcol);
 	
-		IOUtils.closeQuietly(conn);
+		conn.close();
 	}
 	
 	@Test
@@ -880,38 +880,37 @@ public class WebDAVCommandsTest extends WebDAVTestCase {
 	
 	private VFSItem createFile(VFSContainer container, String filename) throws IOException {
 		VFSLeaf testLeaf = container.createChildLeaf(filename);
-		InputStream in = WebDAVCommandsTest.class.getResourceAsStream("text.txt");
-		OutputStream out = testLeaf.getOutputStream(false);
-		FileUtils.copy(in, out);
-		out.flush();
-		IOUtils.closeQuietly(in);
-		IOUtils.closeQuietly(out);
+		try(InputStream in = WebDAVCommandsTest.class.getResourceAsStream("text.txt");
+				OutputStream out = testLeaf.getOutputStream(false)) {
+			FileUtils.copy(in, out);
+			out.flush();
+		} catch(IOException e) {
+			log.error("", e);
+		}
 		return container.resolve(filename);
 	}
 	
 	private RepositoryEntry deployMkdirsCourse(Identity author) 
 	throws URISyntaxException {
 		URL courseWithForumsUrl = WebDAVCommandsTest.class.getResource("mkdirs.zip");
-		return deployTestCourse(author, null, courseWithForumsUrl);
+		return deployTestCourse(author, null, "Mkdirs", courseWithForumsUrl);
 	}
 
 	private RepositoryEntry deployTestCourse(Identity author, Identity coAuthor)
 	throws URISyntaxException {
 		URL courseWithForumsUrl = CoursePublishTest.class.getResource("myCourseWS.zip");
-		return deployTestCourse(author, coAuthor, courseWithForumsUrl);
+		return deployTestCourse(author, coAuthor, "Kurs", courseWithForumsUrl);
 	}
 	
-	private RepositoryEntry deployTestCourse(Identity author, Identity coAuthor, URL courseWithForumsUrl)
+	private RepositoryEntry deployTestCourse(Identity author, Identity coAuthor, String displayName, URL courseWithForumsUrl)
 	throws URISyntaxException {
 		Assert.assertNotNull(courseWithForumsUrl);
 		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString().replace("-", "").substring(0, 30);
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);	
+		RepositoryEntry re = JunitTestHelper.deployCourse(author, displayName, courseWithForums);
 		repositoryService.addRole(author, re, GroupRoles.owner.name());
 		if(coAuthor != null) {
 			repositoryService.addRole(coAuthor, re, GroupRoles.owner.name());
 		}
-		
 		dbInstance.commitAndCloseSession();
 		return re;
 	}
diff --git a/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java b/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java
index d97d68e469ee4aabadfce2ef9999ab5605b9ddd0..13a75096d73aad9cec03a7c2871e40048b08054e 100644
--- a/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java
+++ b/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java
@@ -27,7 +27,6 @@ import java.net.URISyntaxException;
 
 import javax.ws.rs.core.UriBuilder;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.http.Header;
 import org.apache.http.HttpResponse;
 import org.apache.http.auth.AuthScope;
@@ -49,6 +48,8 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
+import org.olat.core.logging.OLog;
+import org.olat.core.logging.Tracing;
 
 /**
  * 
@@ -63,6 +64,8 @@ import org.junit.Assert;
  */
 public class WebDAVConnection implements Closeable {
 	
+	private static final OLog log = Tracing.createLoggerFor(WebDAVConnection.class);
+	
 	private final int port;
 	private final String host;
 	private final String protocol;
@@ -236,7 +239,11 @@ public class WebDAVConnection implements Closeable {
 	
 	@Override
 	public void close() {
-		IOUtils.closeQuietly(httpclient);
+		try {
+			httpclient.close();
+		} catch (IOException e) {
+			log.error("", e);
+		}
 	}
 	
 	/**
diff --git a/src/test/java/org/olat/core/util/FileUtilsTest.java b/src/test/java/org/olat/core/util/FileUtilsTest.java
index 2c193d28265b97616c906c47e258925a8acaff86..a0dcf57264e46aef50b24892f637f00a3f60f93e 100644
--- a/src/test/java/org/olat/core/util/FileUtilsTest.java
+++ b/src/test/java/org/olat/core/util/FileUtilsTest.java
@@ -37,7 +37,6 @@ public class FileUtilsTest {
 		
 		String normalizedAccents = FileUtils.normalizeFilename("Dépéchons-nous!");
 		Assert.assertEquals(normalizedAccents, "Depechonsnous");
-		
 	}
 	
 	@Test
@@ -46,7 +45,32 @@ public class FileUtilsTest {
 		String normalized = FileUtils.normalizeFilename(smorrebrod);
 		Assert.assertEquals(normalized, "Smorrebrod");
 	}
+	
+	@Test
+	public void cleanedFilename() {
+		assertCleanedFilename("test.xml", "test.xml");
+		assertCleanedFilename("abc/abc", "abc_abc");
+		assertCleanedFilename("abc\\abc", "abc_abc");
+		assertCleanedFilename("qwe\nqwe", "qwe_qwe");
+		assertCleanedFilename("wer\rwer", "wer_wer");
+		assertCleanedFilename("ert\tert", "ert_ert");
+		assertCleanedFilename("rtz\frtz", "rtz_rtz");
+		assertCleanedFilename("tzu'tzu", "tzu'tzu");
+		assertCleanedFilename("zui?zui", "zui_zui");
+		assertCleanedFilename("uio*uio", "uio_uio");
+		assertCleanedFilename("asd<asd", "asd_asd");
+		assertCleanedFilename("sdf>sdf", "sdf_sdf");
+		assertCleanedFilename("dfg|dfg", "dfg_dfg");
+		assertCleanedFilename("fgh\"fgh", "fgh_fgh");
+		assertCleanedFilename("fgh:ghj", "fgh_ghj");
+		assertCleanedFilename("fgh,ghj", "fgh_ghj");
+		assertCleanedFilename("fgh=ghj", "fgh_ghj");
+	}
 
+	private void assertCleanedFilename(String raw, String expected) {
+		String cleaned = FileUtils.cleanFilename(raw);
+		Assert.assertEquals(expected, cleaned);
+	}
 
 	@Test
 	public void testMetaFiles() {
@@ -64,7 +88,6 @@ public class FileUtilsTest {
 
 		Assert.assertTrue(FileUtils.isMetaFilename("._"));
 		Assert.assertTrue(FileUtils.isMetaFilename("._gugus"));
-
 	}
 
 }
diff --git a/src/test/java/org/olat/course/assessment/manager/AssessmentToolManagerTest.java b/src/test/java/org/olat/course/assessment/manager/AssessmentToolManagerTest.java
index 4b288dbc5b9841df786f43cfd3b96db0a2e4f0e2..ed995eb2e0b04a12512babfe69874ac3f7dbf69a 100644
--- a/src/test/java/org/olat/course/assessment/manager/AssessmentToolManagerTest.java
+++ b/src/test/java/org/olat/course/assessment/manager/AssessmentToolManagerTest.java
@@ -29,7 +29,6 @@ import org.olat.basesecurity.GroupRoles;
 import org.olat.basesecurity.IdentityShort;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
-import org.olat.course.ICourse;
 import org.olat.course.assessment.AssessmentToolManager;
 import org.olat.course.assessment.model.AssessedBusinessGroup;
 import org.olat.course.assessment.model.AssessmentStatistics;
@@ -43,7 +42,6 @@ import org.olat.modules.assessment.model.AssessmentEntryStatus;
 import org.olat.modules.assessment.model.AssessmentMembersStatistics;
 import org.olat.modules.assessment.ui.AssessmentToolSecurityCallback;
 import org.olat.repository.RepositoryEntry;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -72,7 +70,7 @@ public class AssessmentToolManagerTest extends OlatTestCase {
 	public void assessmentTool_coach() {
 		//course
 		Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-author-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "course-assessment-tool", "course long name", null);
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		
 		//members as participant and coach
 		Identity assessedIdentity1 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-1");
@@ -81,7 +79,6 @@ public class AssessmentToolManagerTest extends OlatTestCase {
 		Identity assessedIdentity4 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-4");
 		Identity coach = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-coach-1");
 
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		RepositoryEntry refEntry = JunitTestHelper.createAndPersistRepositoryEntry();
 		String subIdent = UUID.randomUUID().toString();
 		
diff --git a/src/test/java/org/olat/course/assessment/manager/EfficiencyStatementManagerTest.java b/src/test/java/org/olat/course/assessment/manager/EfficiencyStatementManagerTest.java
index 8105ecc67eb013beafccb5c0f9023799bf7e5255..149b87286d735dc2e2377c83f6c8c64e28333788 100644
--- a/src/test/java/org/olat/course/assessment/manager/EfficiencyStatementManagerTest.java
+++ b/src/test/java/org/olat/course/assessment/manager/EfficiencyStatementManagerTest.java
@@ -19,13 +19,11 @@
  */
 package org.olat.course.assessment.manager;
 
-import java.io.File;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import java.util.UUID;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -174,10 +172,8 @@ public class EfficiencyStatementManagerTest extends OlatTestCase {
 	
 	private RepositoryEntry deployTestcourse() throws URISyntaxException {
 		//deploy a course
-		URL courseWithForumsUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString();
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);// 4);
 		Assert.assertNotNull(re);
 		dbInstance.commitAndCloseSession();
 		ICourse course = CourseFactory.loadCourse(re);			
diff --git a/src/test/java/org/olat/course/assessment/manager/UserCourseInformationsManagerTest.java b/src/test/java/org/olat/course/assessment/manager/UserCourseInformationsManagerTest.java
index 176f752387f9b10f599cb54a24158f72fc5ba325..ff7220a0cf051967cd24a55ea432a11bd0315649 100644
--- a/src/test/java/org/olat/course/assessment/manager/UserCourseInformationsManagerTest.java
+++ b/src/test/java/org/olat/course/assessment/manager/UserCourseInformationsManagerTest.java
@@ -35,6 +35,7 @@ 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.course.assessment.UserCourseInformations;
 import org.olat.group.BusinessGroup;
@@ -42,7 +43,6 @@ import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
 import org.olat.repository.RepositoryEntry;
 import org.olat.resource.OLATResource;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -68,8 +68,9 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	
 	@Test
 	public void createUpdateCourseInfos_create() {
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-1-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-1-");
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -91,8 +92,9 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	
 	@Test
 	public void createUpdateCourseInfos_updateToo() {
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-1-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-1-");
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -114,8 +116,9 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	 */
 	@Test
 	public void createUpdateCourseInfos_updateToo_implementationDetails() {
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-1-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-1-");
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -138,8 +141,9 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getRecentLaunchDate() {
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-7-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-7-");
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -152,8 +156,9 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getInitialLaunchDate_ressource() {
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-2-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch");
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -166,12 +171,13 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	
 	@Test
 	public void getInitialLaunchDate_repositoryEntry() {
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-2-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch");
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
-		RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		userCourseInformationsManager.updateUserCourseInformations(courseResource, user);
 		dbInstance.commitAndCloseSession();
 		
@@ -183,11 +189,12 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	public void getInitialParticiantLaunchDate_businessGroup() {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("init-launch-1-");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("init-launch-2-");
-		ICourse course = CoursesWebService.createEmptyCourse(id1, "course-launch-dates", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id1);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
-		RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		userCourseInformationsManager.updateUserCourseInformations(courseResource, id1);
 		userCourseInformationsManager.updateUserCourseInformations(courseResource, id2);
 		dbInstance.commit();
@@ -206,7 +213,8 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	public void getInitialLaunchDates() {
 		Identity user1 = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-3-" + UUID.randomUUID().toString());
 		Identity user2 = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-4-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user1, "course-launch-dates", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user1);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -232,7 +240,8 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 		Identity user1 = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-7-");
 		Identity user2 = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-8-");
 		Identity user3 = JunitTestHelper.createAndPersistIdentityAsRndUser("user-launch-9-");
-		ICourse course = CoursesWebService.createEmptyCourse(user1, "course-launch-dates", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user1);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
@@ -259,7 +268,8 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	@Test
 	public void updateInitialLaunchDates_loop() {
 		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-5-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-launch-dates", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		for(int i=0; i<10; i++) {
@@ -283,7 +293,8 @@ public class UserCourseInformationsManagerTest extends OlatTestCase {
 	@Test
 	public void updateInitialLaunchDates_concurrent() {
 		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("user-launch-concurrent-6-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "course-concurrent-launch-dates", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(user);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		final int numThreads = 20;
diff --git a/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java b/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
index 6d2cdf9999d419f4aec8c09cc7a7c41cec20e0cb..a806209e60d8c4082091f3a1a4a637447c3ffcc5 100644
--- a/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
+++ b/src/test/java/org/olat/course/config/CourseConfigManagerImplTest.java
@@ -30,7 +30,9 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.vfs.VFSItem;
 import org.olat.course.CourseFactory;
 import org.olat.course.CourseModule;
@@ -43,9 +45,6 @@ import org.olat.test.OlatTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
 
 /**
- * Description: <br>
- * TODO: patrick Class Description for CourseConfigManagerImplTest
- * <P>
  * Initial Date: Jun 3, 2005 <br>
  * 
  * @author patrick
@@ -58,12 +57,16 @@ public class CourseConfigManagerImplTest extends OlatTestCase {
 	private RepositoryService repositoryService;
 	@Autowired
 	private OLATResourceManager resourceManager;
+	@Autowired
+	private OrganisationService organisationService;
 
 	@Test
 	public void testConfigFileCRUD() {
 		// create course and persist as OLATResourceImpl
 		OLATResource resource = resourceManager.createOLATResourceInstance(CourseModule.class);
-		RepositoryEntry addedEntry = repositoryService.create("Ayanami", "-", "JUnit course configuration course", "A JUnit course", resource);
+
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry addedEntry = repositoryService.create(null, "Ayanami", "-", "JUnit course configuration course", "A JUnit course", resource, 0, 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 620c5febc8b3413c1c747e99ea394e8c32737985..00f8afc77d0638dc1e3dbe76b055ffecfe148498 100644
--- a/src/test/java/org/olat/course/editor/PublishProcessTest.java
+++ b/src/test/java/org/olat/course/editor/PublishProcessTest.java
@@ -29,7 +29,9 @@ import java.util.UUID;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.StringHelper;
 import org.olat.core.util.nodes.INode;
@@ -66,6 +68,8 @@ public class PublishProcessTest extends OlatTestCase {
 	private OLATResourceManager olatResourceManager;
 	@Autowired
 	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	/**
 	 * Publish process without error
@@ -326,9 +330,10 @@ public class PublishProcessTest extends OlatTestCase {
 		if(!StringHelper.containsNonWhitespace(softKey)) {
 			softKey = importExport.getSoftkey();
 		}
-		
-		RepositoryEntry re = repositoryService.create(importExport.getInitialAuthor(), importExport.getResourceName(),
-				importExport.getDisplayName(), importExport.getDescription(), newCourseResource);
+
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, importExport.getInitialAuthor(), importExport.getResourceName(),
+				importExport.getDisplayName(), importExport.getDescription(), newCourseResource, 0, defOrganisation);
 		// ok, continue import
 		re.setSoftkey(softKey);
 		// set access configuration
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 9e46d1b9a0a3eb4178c9a427a867ae757c91500d..abddd7a9bb40a2aa6b9b2c42f9efa1c3b4fc4c34 100644
--- a/src/test/java/org/olat/course/nodes/en/EnrollmentManagerConcurrentTest.java
+++ b/src/test/java/org/olat/course/nodes/en/EnrollmentManagerConcurrentTest.java
@@ -44,6 +44,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.gui.components.Component;
@@ -55,6 +56,7 @@ import org.olat.core.gui.control.info.WindowControlInfo;
 import org.olat.core.gui.translator.Translator;
 import org.olat.core.id.Identity;
 import org.olat.core.id.IdentityEnvironment;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.context.BusinessControl;
 import org.olat.core.id.context.ContextEntry;
@@ -114,6 +116,8 @@ public class EnrollmentManagerConcurrentTest extends OlatTestCase implements Win
 	@Autowired
 	private OLATResourceManager resourceManager;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private BusinessGroupService businessGroupService;
 	@Autowired
 	private EnrollmentManager enrollmentManager;
@@ -168,7 +172,8 @@ public class EnrollmentManagerConcurrentTest extends OlatTestCase implements Win
 		ENCourseNode enNode = new ENCourseNode();
 
 		OLATResource resource = resourceManager.createOLATResourceInstance(CourseModule.class);
-		RepositoryEntry addedEntry = repositoryService.create("Ayanami", "-", "Enrollment test course 1", "A JUnit course", resource);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry addedEntry = repositoryService.create(null, "Ayanami", "-", "Enrollment test course 1", "A JUnit course", resource, 0, 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/course/nodes/gta/rule/GTAReminderRuleTest.java b/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java
index 6d78418506b6aefb8390b39f6119d2bcf8ebbe91..6ec20e0c5ec51e02bfd558591ab7fcb0b291b448 100644
--- a/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java
+++ b/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java
@@ -60,7 +60,6 @@ import org.olat.repository.manager.RepositoryEntryRelationDAO;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 import org.olat.repository.model.RepositoryEntryToGroupRelation;
 import org.olat.resource.OLATResource;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -319,7 +318,8 @@ public class GTAReminderRuleTest extends OlatTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-2");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-3");
 
-		ICourse course = CoursesWebService.createEmptyCourse(null, "initial-launch-dates", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(null);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.participant.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
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 7218474690ac0204d45f26189aafb9d6ac93f8d7..5729e3be46b303149e88028361d73c2acea9b5b7 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
@@ -38,7 +38,9 @@ import org.dom4j.Element;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.xml.XMLParser;
@@ -103,6 +105,8 @@ public class QTIStatisticsManagerLargeTest extends OlatTestCase {
 	private QTIStatisticsManager qtim;
 	@Autowired
 	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
 
 	@Before
 	public void setUp() throws Exception {
@@ -348,7 +352,8 @@ public class QTIStatisticsManagerLargeTest extends OlatTestCase {
 		dbInstance.saveObject(r);
 		dbInstance.intermediateCommit();
 
-		RepositoryEntry d = repositoryService.create("Kanu Unchou", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry d = repositoryService.create(null, "Kanu Unchou", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r, 0, defOrganisation);
 		dbInstance.saveObject(d);
 		dbInstance.intermediateCommit();
 		return d;
diff --git a/src/test/java/org/olat/modules/coach/CoachingLargeTest.java b/src/test/java/org/olat/modules/coach/CoachingLargeTest.java
index 835db3f6ce88abe381798edac957e9fa3ab869df..2a0bb52472fdf269445c225c59768062e64e8527 100644
--- a/src/test/java/org/olat/modules/coach/CoachingLargeTest.java
+++ b/src/test/java/org/olat/modules/coach/CoachingLargeTest.java
@@ -21,7 +21,6 @@ package org.olat.modules.coach;
 
 import static org.junit.Assert.assertNotNull;
 
-import java.io.File;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -38,7 +37,6 @@ import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
-import org.olat.course.CourseFactory;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
@@ -131,11 +129,8 @@ public class CoachingLargeTest extends OlatTestCase {
 
 		//create courses with members
 		for(int i=0; i<NUM_OF_COURSES; i++) {
-			
-			URL courseWithForumsUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-			File courseWithForums = new File(courseWithForumsUrl.toURI());
-			String softKey = UUID.randomUUID().toString();
-			RepositoryEntry re = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 3);
+			URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+			RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl); // 3
 			if(i == 0) {
 				course10 = re;
 			}
@@ -176,11 +171,8 @@ public class CoachingLargeTest extends OlatTestCase {
 		
 		//create courses with members
 		for(int i=0; i<NUM_OF_COURSES; i++) {
-			
-			URL courseWithForumsUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-			File courseWithForums = new File(courseWithForumsUrl.toURI());
-			String softKey = UUID.randomUUID().toString();
-			RepositoryEntry re = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 3);
+			URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+			RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);// 3 
 			// create groups without waiting list
 			BusinessGroup g1 = businessGroupService.createBusinessGroup(author, "coach-g1", null, new Integer(0), new Integer(10), false, false, re);
 			BusinessGroup g2 = businessGroupService.createBusinessGroup(author, "coach-g2", null, new Integer(0), new Integer(10), false, false, re);
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 b418ffaa0b9d333c16dfe982c491663a394b4d95..f6b712c955dd1dbfcdd92f33969da3ec70d1d205 100644
--- a/src/test/java/org/olat/modules/coach/manager/CoachingDAOTest.java
+++ b/src/test/java/org/olat/modules/coach/manager/CoachingDAOTest.java
@@ -19,7 +19,6 @@
  */
 package org.olat.modules.coach.manager;
 
-import java.io.File;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Date;
@@ -100,10 +99,9 @@ public class CoachingDAOTest extends OlatTestCase {
 	throws URISyntaxException {
 		List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(UserListController.usageIdentifyer, false);
 		
-		URL courseWithForumsUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString();
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);
+
 		Assert.assertNotNull(re);
 
 		dbInstance.commitAndCloseSession();
@@ -206,11 +204,10 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void getStatistics_notAttempted()
 	throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re1 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re2 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re3 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1", courseUrl);
+		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2", courseUrl);
+		RepositoryEntry re3 = JunitTestHelper.deployCourse(null, "Coaching course 3", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		
@@ -326,11 +323,10 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void getStatistics_owner()
 	throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re1 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re2 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re3 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1", courseUrl); 
+		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2", courseUrl); 
+		RepositoryEntry re3 = JunitTestHelper.deployCourse(null, "Coaching course 3", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -473,11 +469,10 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void getStatistics_permissionOnCourses()
 	throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re1 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 1);
-		RepositoryEntry re2 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 2);
-		RepositoryEntry re3 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 3);
+		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);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -657,10 +652,9 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void getStatistics_emptyStatements_emptyCourseInfos()
 	throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re1 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re2 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1", courseUrl);
+		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -736,10 +730,9 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void getStatistics_empty()
 	throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re1 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re2 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1", courseUrl);
+		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -771,11 +764,10 @@ public class CoachingDAOTest extends OlatTestCase {
 	@Test
 	public void getUsers()
 	throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re1 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re2 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
-		RepositoryEntry re3 = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re1 = JunitTestHelper.deployCourse(null, "Coaching course 1", courseUrl);
+		RepositoryEntry re2 = JunitTestHelper.deployCourse(null, "Coaching course 2", courseUrl);
+		RepositoryEntry re3 = JunitTestHelper.deployCourse(null, "Coaching course 3", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -850,9 +842,8 @@ public class CoachingDAOTest extends OlatTestCase {
 	
 	@Test
 	public void getStudents_coach_course() throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -882,9 +873,8 @@ public class CoachingDAOTest extends OlatTestCase {
 	
 	@Test
 	public void getStudents_owner_course() throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);
 		dbInstance.commitAndCloseSession();
 		
 		//members of courses
@@ -926,9 +916,8 @@ public class CoachingDAOTest extends OlatTestCase {
 
 	@Test
 	public void isCoach_owner() throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);
 		dbInstance.commitAndCloseSession();
 	
 		//members of courses
@@ -942,9 +931,8 @@ public class CoachingDAOTest extends OlatTestCase {
 	
 	@Test
 	public void isCoach_coach() throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 4);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", courseUrl);
 		dbInstance.commitAndCloseSession();
 	
 		//coach of course
@@ -967,9 +955,8 @@ public class CoachingDAOTest extends OlatTestCase {
 	
 	@Test
 	public void isCoach_notPermitted() throws URISyntaxException {
-		URL coachingCourseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
-		File coachingCourseFile = new File(coachingCourseUrl.toURI());
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(coachingCourseFile, UUID.randomUUID().toString(), 1);
+		URL courseUrl = CoachingLargeTest.class.getResource("CoachingCourse.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "Coaching course", RepositoryEntry.ACC_OWNERS, courseUrl);
 		dbInstance.commitAndCloseSession();
 	
 		//owner of course
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 a627b89b295227f1df6ed3325eab6b49dbbeeec0..f2e547c9bab7f29e2300a0fe738db263f4de65e0 100644
--- a/src/test/java/org/olat/modules/forms/manager/EvaluationFormTestsHelper.java
+++ b/src/test/java/org/olat/modules/forms/manager/EvaluationFormTestsHelper.java
@@ -74,7 +74,7 @@ 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);
+		return repositoryService.create(author, null, "", "Display name", "Description", resource, RepositoryEntry.ACC_OWNERS, 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 54df1186d43989a2c2ff780783618beb0e60a4e6..80940c6b2a35650f5298c80f7705841457650ad6 100644
--- a/src/test/java/org/olat/modules/iq/IQTestHelper.java
+++ b/src/test/java/org/olat/modules/iq/IQTestHelper.java
@@ -22,10 +22,12 @@ package org.olat.modules.iq;
 import java.util.Calendar;
 import java.util.Date;
 
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.ims.qti.QTIResult;
 import org.olat.ims.qti.QTIResultSet;
 import org.olat.repository.RepositoryEntry;
@@ -102,8 +104,10 @@ public class IQTestHelper extends OlatTestCase {
 		OLATResource r =  CoreSpringFactory.getImpl(OLATResourceManager.class).createOLATResourceInstance("QTIStatisticsTest");
 		dbInstance.getCurrentEntityManager().persist(r);
 		dbInstance.commit();
-
-		RepositoryEntry d = CoreSpringFactory.getImpl(RepositoryService.class).create("Rei Ayanami", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r);
+		
+		Organisation defOrganisation = CoreSpringFactory.getImpl(OrganisationService.class).getDefaultOrganisation();
+		RepositoryEntry d = CoreSpringFactory.getImpl(RepositoryService.class)
+				.create(null, "Rei Ayanami", "QTIStatisticsTest", "QTIStatisticsTest", "Repo entry", r, 0, 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 0c5e143403bd0b9428e6fd6edf8f477d239a5782..789929665ad943e0d5daa6140e7f97b7aeb01163 100644
--- a/src/test/java/org/olat/modules/portfolio/manager/PortfolioServiceTest.java
+++ b/src/test/java/org/olat/modules/portfolio/manager/PortfolioServiceTest.java
@@ -26,10 +26,12 @@ import java.util.Locale;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.services.commentAndRating.manager.UserCommentsDAO;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.modules.portfolio.Assignment;
 import org.olat.modules.portfolio.AssignmentType;
@@ -74,6 +76,8 @@ public class PortfolioServiceTest extends OlatTestCase {
 	private PortfolioService portfolioService;
 	@Autowired
 	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	@Test
 	public void createNewOwnedPorfolio() {
@@ -892,7 +896,8 @@ public class PortfolioServiceTest extends OlatTestCase {
 	
 	private RepositoryEntry createTemplate(Identity initialAuthor, String displayname, String description) {
 		OLATResource resource = portfolioService.createBinderTemplateResource();
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
+		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;
 	}
diff --git a/src/test/java/org/olat/modules/reminder/manager/ReminderRuleEngineTest.java b/src/test/java/org/olat/modules/reminder/manager/ReminderRuleEngineTest.java
index 45216c0c807e545ecf1870a697beb246764e0b3f..937294f2a49460d67b2152cd3ec841044a79a363 100644
--- a/src/test/java/org/olat/modules/reminder/manager/ReminderRuleEngineTest.java
+++ b/src/test/java/org/olat/modules/reminder/manager/ReminderRuleEngineTest.java
@@ -72,7 +72,6 @@ import org.olat.repository.manager.RepositoryEntryRelationDAO;
 import org.olat.repository.model.RepositoryEntryLifecycle;
 import org.olat.repository.model.RepositoryEntryToGroupRelation;
 import org.olat.resource.OLATResource;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatTestCase;
 import org.olat.user.UserManager;
@@ -317,9 +316,9 @@ public class ReminderRuleEngineTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-1");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-2");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-3");
+		
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(null);
 
-		ICourse course = CoursesWebService.createEmptyCourse(null, "initial-launch-dates", "course long name", null);
-		RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.coach.name());
 		repositoryEntryRelationDao.addRole(id3, re, GroupRoles.participant.name());
@@ -437,9 +436,9 @@ public class ReminderRuleEngineTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-1");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-2");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-3");
+		
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(null);
 
-		ICourse course = CoursesWebService.createEmptyCourse(null, "initial-launch-dates", "course long name", null);
-		RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.coach.name());
 		repositoryEntryRelationDao.addRole(id3, re, GroupRoles.participant.name());
@@ -557,9 +556,10 @@ public class ReminderRuleEngineTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-1");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-2");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("initial-launch-3");
-
-		ICourse course = CoursesWebService.createEmptyCourse(null, "initial-launch-dates", "course long name", null);
-		RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(null);
+		dbInstance.commit();
+		
 		addEnrollmentDate(re, id1, GroupRoles.owner,  -5, Calendar.DATE);
 		addEnrollmentDate(re, id2, GroupRoles.coach, -35, Calendar.DATE);
 		addEnrollmentDate(re, id3, GroupRoles.participant, -75, Calendar.DATE);
@@ -671,8 +671,7 @@ public class ReminderRuleEngineTest extends OlatTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("before-begin-2");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("before-begin-3");
 
-		ICourse course = CoursesWebService.createEmptyCourse(null, "initial-launch-dates", "course long name", null);
-		RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(null);
 		
 		Calendar cal = Calendar.getInstance();
 		cal.setTime(new Date());//now
@@ -755,10 +754,9 @@ public class ReminderRuleEngineTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("after-end-1");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("after-end-2");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("after-end-3");
-
-		ICourse course = CoursesWebService.createEmptyCourse(null, "initial-launch-dates", "course long name", null);
-		RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		
+		RepositoryEntry re = JunitTestHelper.deployBasicCourse(null);
+
 		Calendar cal = Calendar.getInstance();
 		cal.setTime(new Date());//now
 		cal.add(Calendar.DATE, -25);
diff --git a/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java b/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
index a0282f6d4860152e552c8be5f58bf099b51b8ed2..243fdb56c8044a48c344d2ebd27fe8f5dc2d69cf 100644
--- a/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
+++ b/src/test/java/org/olat/portfolio/EPFrontendManagerTest.java
@@ -35,8 +35,10 @@ import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.Invitation;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.portfolio.manager.EPFrontendManager;
 import org.olat.portfolio.manager.EPMapPolicy;
@@ -82,20 +84,18 @@ public class EPFrontendManagerTest extends OlatTestCase {
 	
 	@Autowired
 	private DB dbInstance;
-	
 	@Autowired
 	private EPFrontendManager epFrontendManager;
-	
 	@Autowired
 	private EPStructureManager epStructureManager;
-	
 	@Autowired
 	private BaseSecurity securityManager;
 	@Autowired
 	private InvitationDAO invitationDao;
-	
 	@Autowired
 	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	@Before
 	public void setUp() {
@@ -118,7 +118,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		//create a template
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		//create a repository entry
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "template-1", "map-template-1", resource, RepositoryEntry.ACC_OWNERS);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "template-1", "map-template-1", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		//create the template owned by ident1
 		PortfolioStructureMap templateEl = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(ident1, addedEntry);
@@ -207,7 +208,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		//create a template
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		//create a repository entry
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource, RepositoryEntry.ACC_OWNERS);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
 		//create the template owned by ident1
 		PortfolioStructureMap templateEl = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(ident1, addedEntry);
 		//create five pages
@@ -469,7 +471,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		
 		//create a repository entry
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "test repo", "desc repo", resource, RepositoryEntry.ACC_OWNERS);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "test repo", "desc repo", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		//create the template owned by ident1
@@ -497,7 +500,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		//create a template
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
 		//create a repository entry
-		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource, RepositoryEntry.ACC_OWNERS);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry addedEntry = repositoryService.create(ident1, null, "-", "Template in user", "Template in use", resource, RepositoryEntry.ACC_OWNERS, defOrganisation);
 		//create the template owned by ident1
 		PortfolioStructureMap template = epStructureManager.createAndPersistPortfolioMapTemplateFromEntry(ident1, addedEntry);
 		dbInstance.commitAndCloseSession();
@@ -805,7 +809,8 @@ public class EPFrontendManagerTest extends OlatTestCase {
 		//save parent and 20 children
 		
 		OLATResource resource = epStructureManager.createPortfolioMapTemplateResource();
-		RepositoryEntry re = repositoryService.create(id, null, "", "Template to delete", "", resource, RepositoryEntry.ACC_OWNERS);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(id, null, "", "Template to delete", "", resource, RepositoryEntry.ACC_OWNERS, 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/EPImportTest.java b/src/test/java/org/olat/portfolio/EPImportTest.java
index 44d9298d214c116f23f672563fd9a821586755e7..cfd1763bc01b41c773c08670d753de34f8369e27 100644
--- a/src/test/java/org/olat/portfolio/EPImportTest.java
+++ b/src/test/java/org/olat/portfolio/EPImportTest.java
@@ -31,6 +31,7 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.portfolio.manager.EPFrontendManager;
 import org.olat.portfolio.manager.EPStructureManager;
+import org.olat.portfolio.manager.EPStructureManagerTest;
 import org.olat.portfolio.manager.EPXStreamHandler;
 import org.olat.portfolio.model.structel.PortfolioStructure;
 import org.olat.portfolio.model.structel.PortfolioStructureMap;
@@ -83,7 +84,7 @@ public class EPImportTest extends OlatTestCase {
 	public void testCopy() throws URISyntaxException  {
 		Identity ident = JunitTestHelper.createAndPersistIdentityAsRndUser("ImPort-1");
 		//save the map
-		PortfolioStructureMap map = epStructureManager.createPortfolioMapTemplate(ident, "import-map-1", "map-template");
+		PortfolioStructureMap map = EPStructureManagerTest.createPortfolioMapTemplate(ident, "import-map-1", "map-template");
 		epStructureManager.savePortfolioStructure(map);
 		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 1b40bc82d6a83b4f26264b6abd334424dc8aacc5..28343c8b10306c1434e6ae2138dcf21f5e66f433 100644
--- a/src/test/java/org/olat/portfolio/manager/EPStructureManagerTest.java
+++ b/src/test/java/org/olat/portfolio/manager/EPStructureManagerTest.java
@@ -27,22 +27,30 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.UUID;
 
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.olat.basesecurity.Group;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.manager.SecurityGroupDAO;
+import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Persistable;
 import org.olat.core.id.Roles;
 import org.olat.portfolio.model.artefacts.AbstractArtefact;
 import org.olat.portfolio.model.structel.EPStructureElement;
+import org.olat.portfolio.model.structel.EPStructureElementToGroupRelation;
 import org.olat.portfolio.model.structel.EPStructureToStructureLink;
 import org.olat.portfolio.model.structel.EPStructuredMap;
+import org.olat.portfolio.model.structel.EPStructuredMapTemplate;
 import org.olat.portfolio.model.structel.EPTargetResource;
 import org.olat.portfolio.model.structel.ElementType;
 import org.olat.portfolio.model.structel.PortfolioStructure;
@@ -372,7 +380,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	@Test
 	public void testCreateStructureMapTemplate() {
 		//save parent and 20 children
-		PortfolioStructureMap template = epStructureManager.createPortfolioMapTemplate(ident1, "paged-parent-structure-el", "parent-structure-element");
+		PortfolioStructureMap template = createPortfolioMapTemplate(ident1, "paged-parent-structure-el", "parent-structure-element");
 		epStructureManager.savePortfolioStructure(template);
 		dbInstance.commitAndCloseSession();
 		
@@ -389,7 +397,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	@Test
 	public void testUseStructureMapTemplate() {
 		//save parent and 20 children
-		PortfolioStructureMap template = epStructureManager.createPortfolioMapTemplate(ident1, "paged-parent-structure-el", "parent-structure-element");
+		PortfolioStructureMap template = createPortfolioMapTemplate(ident1, "paged-parent-structure-el", "parent-structure-element");
 		epStructureManager.savePortfolioStructure(template);
 		dbInstance.commitAndCloseSession();
 		
@@ -423,7 +431,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	public void testLoadPortfolioStructuredMap(){
 		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("EP-tmp-");
 		//create a template
-		PortfolioStructureMap template = epStructureManager.createPortfolioMapTemplate(user, "paged-parent-structure-el", "parent-structure-element");
+		PortfolioStructureMap template = createPortfolioMapTemplate(user, "paged-parent-structure-el", "parent-structure-element");
 		epStructureManager.savePortfolioStructure(template);
 		dbInstance.commitAndCloseSession();
 		//clone the template
@@ -448,7 +456,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	public void testLoadPortfolioStructuredMaps() {
 		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("EP-tmp-");
 		//a template
-		PortfolioStructureMap template = epStructureManager.createPortfolioMapTemplate(user, "paged-parent-structure-el", "parent-structure-element");
+		PortfolioStructureMap template = createPortfolioMapTemplate(user, "paged-parent-structure-el", "parent-structure-element");
 		epStructureManager.savePortfolioStructure(template);
 		dbInstance.commitAndCloseSession();
 		//clone the template
@@ -475,7 +483,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	public void loadPortfolioStructure_resourceable() {
 		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("EP-res-tmp-");
 		//a template
-		PortfolioStructureMap template = epStructureManager.createPortfolioMapTemplate(user, "resourced-el", "resource-element");
+		PortfolioStructureMap template = createPortfolioMapTemplate(user, "resourced-el", "resource-element");
 		epStructureManager.savePortfolioStructure(template);
 		dbInstance.commitAndCloseSession();
 		
@@ -640,7 +648,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	@Test
 	public void testAddAuthorToMap() {
 		//save the map
-		PortfolioStructureMap map = epStructureManager.createPortfolioMapTemplate(ident1, "add-author-map-1", "add-an-author-to-map-template");
+		PortfolioStructureMap map = createPortfolioMapTemplate(ident1, "add-author-map-1", "add-an-author-to-map-template");
 		epStructureManager.savePortfolioStructure(map);
 		dbInstance.commitAndCloseSession();
 		
@@ -662,7 +670,7 @@ public class EPStructureManagerTest extends OlatTestCase {
 	@Test
 	public void testRemoveAuthorToMap() {
 		//save the map
-		PortfolioStructureMap map = epStructureManager.createPortfolioMapTemplate(ident1, "add-author-map-1", "add-an-author-to-map-template");
+		PortfolioStructureMap map = createPortfolioMapTemplate(ident1, "add-author-map-1", "add-an-author-to-map-template");
 		epStructureManager.savePortfolioStructure(map);
 		dbInstance.commitAndCloseSession();
 		
@@ -691,4 +699,43 @@ public class EPStructureManagerTest extends OlatTestCase {
 		securityGroupDao.getSecurityGroupsForIdentity(ident1);
 		repositoryManager.queryReferencableResourcesLimitType(ident1, new Roles(false, false, false, false, false, false, false), null, null, null, null);
 	}
+	
+	
+	/**
+	 * Create a map template, create an OLAT resource and a repository entry with a security group
+	 * of type owner to the repository and add the identity has an owner.
+	 * @param identity
+	 * @param title
+	 * @param description
+	 * @return The structure element
+	 */
+	public static PortfolioStructureMap createPortfolioMapTemplate(Identity identity, String title, String description) {
+		EPStructureManager epStructureManager = CoreSpringFactory.getImpl(EPStructureManager.class);
+		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
+		OrganisationService organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
+		DB dbInstance = CoreSpringFactory.getImpl(DB.class);
+		
+		
+		EPStructuredMapTemplate el = new EPStructuredMapTemplate();
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		
+		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);
+				
+		dbInstance.commit();
+		
+		Group ownerGroup = repositoryService.getDefaultGroup(re);
+		
+		EPStructureElementToGroupRelation relation = epStructureManager.createBaseRelation(el, ownerGroup);
+		Set<EPStructureElementToGroupRelation> relations = new HashSet<>();
+		relations.add(relation);
+		el.setGroups(relations);
+		return el;
+	}
+	
+	
+	
+	
 }
\ No newline at end of file
diff --git a/src/test/java/org/olat/repository/RepositoryManagerQueryTest.java b/src/test/java/org/olat/repository/RepositoryManagerQueryTest.java
index f5442df86418b515aa7ce568c0c650aaf0f69d74..82f122f9c0799a0b2339feda3f95b59537148ad3 100644
--- a/src/test/java/org/olat/repository/RepositoryManagerQueryTest.java
+++ b/src/test/java/org/olat/repository/RepositoryManagerQueryTest.java
@@ -29,9 +29,12 @@ import java.util.List;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.olat.basesecurity.BaseSecurity;
+import org.olat.basesecurity.OrganisationRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
-import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.UserConstants;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
@@ -55,14 +58,24 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 	
 	private static final String TEST_RES_NAME = "TestManagerQuery";
 	
+	@Autowired
+	private DB dbInstance;
 	@Autowired
 	private RepositoryManager rm;
 	@Autowired
+	private UserManager userManager;
+	@Autowired
+	private BaseSecurity securityManager;
+	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
-	private UserManager userManager;
+	private OLATResourceManager resourceManager;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	private static Identity admin;
+	private static Identity learnResourceManager1;
+	private static Identity learnResourceManager2;
 	
 	private static final String author = "RepositoryManagerQueryAuthor";
 	private static boolean initialized = false;
@@ -74,8 +87,10 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 	@Before
 	public void setup() {
 		if(initialized) return;
-		
-		DB db = DBFactory.getInstance();
+
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		Organisation organisation = organisationService.createOrganisation("Test repo query", "test-repo-query", null, defOrganisation, null);
+		dbInstance.commit();
 		
 		admin = JunitTestHelper.createAndPersistIdentityAsAdmin("administrator");
 		
@@ -89,19 +104,25 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 		id2.getUser().setProperty(UserConstants.LASTNAME, author + "2");
 		userManager.updateUserFromIdentity(id2);
 
-		Identity institut1 = JunitTestHelper.createAndPersistIdentityAsAuthor("kanu");
-		institut1.getUser().setProperty(UserConstants.INSTITUTIONALNAME, "Volks");
-		institut1.getUser().setProperty(UserConstants.FIRSTNAME, "Kanu");
-		institut1.getUser().setProperty(UserConstants.LASTNAME, "Unchou");
-		userManager.updateUserFromIdentity(institut1);
+		learnResourceManager1 = JunitTestHelper.createAndPersistIdentityAsAuthor("kanu");
+		learnResourceManager1.getUser().setProperty(UserConstants.INSTITUTIONALNAME, "Volks");
+		learnResourceManager1.getUser().setProperty(UserConstants.FIRSTNAME, "Kanu");
+		learnResourceManager1.getUser().setProperty(UserConstants.LASTNAME, "Unchou");
+		userManager.updateUserFromIdentity(learnResourceManager1);
 
-		Identity institut2 = JunitTestHelper.createAndPersistIdentityAsAuthor("rei");
-		institut2.getUser().setProperty(UserConstants.INSTITUTIONALNAME, "Nerv");
-		institut2.getUser().setProperty(UserConstants.FIRSTNAME, "Rei");
-		institut2.getUser().setProperty(UserConstants.LASTNAME, "Ayanami");
-		userManager.updateUserFromIdentity(institut2);
+		learnResourceManager2 = JunitTestHelper.createAndPersistIdentityAsAuthor("rei");
+		learnResourceManager2.getUser().setProperty(UserConstants.INSTITUTIONALNAME, "Nerv");
+		learnResourceManager2.getUser().setProperty(UserConstants.FIRSTNAME, "Rei");
+		learnResourceManager2.getUser().setProperty(UserConstants.LASTNAME, "Ayanami");
+		userManager.updateUserFromIdentity(learnResourceManager2);
 
-		db.commitAndCloseSession();
+		dbInstance.commit();
+		
+		organisationService.addMember(organisation, learnResourceManager1, OrganisationRoles.learnresourcemanager);
+		organisationService.addMember(organisation, learnResourceManager2, OrganisationRoles.learnresourcemanager);
+		organisationService.addMember(organisation, id1, OrganisationRoles.user);
+		organisationService.addMember(organisation, id2, OrganisationRoles.user);
+		dbInstance.commitAndCloseSession();
 
 		// generate some repo entries
 		int numbRes = 500;
@@ -124,27 +145,27 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 				}
 				case 2: {
 					access = RepositoryEntry.ACC_OWNERS;
-					owner = institut1;
+					owner = learnResourceManager1;
 					break;
 				}
 				case 3: {
 					access = RepositoryEntry.ACC_OWNERS;
-					owner = institut2;
+					owner = learnResourceManager2;
 					break;
 				}
 			}
 			
 			// create course and persist as OLATResourceImpl
-			RepositoryEntry re = createCourseRepositoryEntry(db, owner, i);
+			RepositoryEntry re = createCourseRepositoryEntry(owner, i, organisation);
 			re.setAccess(access);
 
 			repositoryService.update(re);
 			if (i % 20 == 0) {
-				db.commitAndCloseSession();
+				dbInstance.commitAndCloseSession();
 			}
 		}
 
-		db.commitAndCloseSession();
+		dbInstance.commitAndCloseSession();
 		
 		initialized = true;
 	}
@@ -154,8 +175,8 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 		List<String> types = Collections.singletonList(TEST_RES_NAME);
 		
 		//roles: author + institution manager
-		Roles role2 = new Roles(false, false, false, true, false, true, false);
-		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, null, null, types, admin, role2, "Volks");
+		Roles adminRoles = securityManager.getRoles(admin);
+		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, null, null, types, admin, adminRoles, "Volks");
 		List<RepositoryEntry> resultOneShootInstitut = rm.genericANDQueryWithRolesRestriction(params, 0, -1, true);
 		assertNotNull(resultOneShootInstitut);
 		assertFalse(resultOneShootInstitut.isEmpty());
@@ -179,9 +200,10 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 		List<String> types = Collections.singletonList(TEST_RES_NAME);
 		
 		//roles: institution manager
-		Roles role3 = new Roles(false, false, false, true, false, true, false);
+		Roles learnResourceManager1Roles = securityManager.getRoles(learnResourceManager1);
 
-		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, null, null, types, null, role3, "Volks");
+		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, null, null, types,
+				learnResourceManager1, learnResourceManager1Roles, "Volks");
 		List<RepositoryEntry> resultOneShootInstitut3 = rm.genericANDQueryWithRolesRestriction(params, 0, -1, true);
 		assertNotNull(resultOneShootInstitut3);
 		assertFalse(resultOneShootInstitut3.isEmpty());
@@ -192,9 +214,10 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 		List<String> types = Collections.singletonList(TEST_RES_NAME);
 		
 		//roles: institution manager search: authorname
-		Roles role4 = new Roles(false, false, false, false, false, true, false);
+		Roles learnResourceManager2Roles = securityManager.getRoles(learnResourceManager2);
 
-		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, "kan", null, types, null, role4, "Volks");
+		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, "kan", null, types,
+				learnResourceManager2, learnResourceManager2Roles, "Volks");
 		List<RepositoryEntry> resultOneShootInstitut4 = rm.genericANDQueryWithRolesRestriction(params, 0, -1, true);
 		assertNotNull(resultOneShootInstitut4);
 		assertFalse(resultOneShootInstitut4.isEmpty());
@@ -205,24 +228,23 @@ public class RepositoryManagerQueryTest extends OlatTestCase {
 		List<String> types = Collections.singletonList(TEST_RES_NAME);
 		
 		//roles: institution manager search: authorname
-		Roles role4 = new Roles(false, false, false, false, false, true, false);
+		Roles learnResourceManager1Role = securityManager.getRoles(learnResourceManager1);
 
-		
 		//test paging
-		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, "kan", null, types, null, role4, "Volks");
+		SearchRepositoryEntryParameters params = new SearchRepositoryEntryParameters(null, "kan", null, types,
+				learnResourceManager1, learnResourceManager1Role, "Volks");
 		List<RepositoryEntry> resultOneShootInstitut6 = rm.genericANDQueryWithRolesRestriction(params, 0, 50, true);
 		rm.countGenericANDQueryWithRolesRestriction(params);
 		assertNotNull(resultOneShootInstitut6);
 		assertEquals(50, resultOneShootInstitut6.size());
 	}
 	
-	private RepositoryEntry createCourseRepositoryEntry(DB db, Identity owner, final int i) {
-		OLATResource r =  OLATResourceManager.getInstance().createOLATResourceInstance(TEST_RES_NAME);
-		db.saveObject(r);
+	private RepositoryEntry createCourseRepositoryEntry(Identity owner, final int i, Organisation organisation) {
+		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);
-		//db.commit();
+				"Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "Description of learning by OLAT " + i, r, RepositoryEntry.ACC_OWNERS, organisation);
 		return re;
 	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/olat/repository/RepositoryManagerTest.java b/src/test/java/org/olat/repository/RepositoryManagerTest.java
index 22cf4eaac1b368bce2b37eb5821c477307bffd3d..703a037d31b798bcd9a132ba2a20983098569b03 100644
--- a/src/test/java/org/olat/repository/RepositoryManagerTest.java
+++ b/src/test/java/org/olat/repository/RepositoryManagerTest.java
@@ -49,6 +49,7 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.services.mark.MarkManager;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.UserConstants;
 import org.olat.core.logging.AssertException;
@@ -116,8 +117,9 @@ public class RepositoryManagerTest extends OlatTestCase {
 			// create course and persist as OLATResourceImpl
 			OLATResource r =  rm.createOLATResourceInstance(resourceable);
 			dbInstance.getCurrentEntityManager().persist(r);
-			
-			RepositoryEntry d = repositoryService.create("Florian Gnägi", "Lernen mit OpenOLAT", "JunitTest_RepositoryEntry", "Beschreibung", r);
+
+			Organisation defOrganisation = organisationService.getDefaultOrganisation();
+			RepositoryEntry d = repositoryService.create(null, "Florian Gnägi", "Lernen mit OpenOLAT", "JunitTest_RepositoryEntry", "Beschreibung", r, 0, defOrganisation);
 			
 			dbInstance.commit();
 			Assert.assertNotNull(d);
@@ -755,8 +757,9 @@ public class RepositoryManagerTest extends OlatTestCase {
 			dbInstance.getCurrentEntityManager().persist(r);
 			
 			// 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);			
+					"Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "yo man description bla bla + i", r, RepositoryEntry.ACC_OWNERS_AUTHORS, defOrganisation);			
 			if ((i % 2 > 0)) {
 				re.setCanReference(true);
 			}
@@ -1331,7 +1334,8 @@ public class RepositoryManagerTest extends OlatTestCase {
 	 */
 	@Test
 	public void lazyLoadingCheck() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 5", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		RepositoryEntryLifecycle cycle = lifecycleDao.create("New cycle 1", "New cycle soft 1", false, new Date(), new Date());
@@ -1361,9 +1365,10 @@ public class RepositoryManagerTest extends OlatTestCase {
 		dbInstance.saveObject(r);
 		
 		// now make a repository entry for this course
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		final RepositoryEntry re = repositoryService.create(owner, null,
 				"Lernen mit OLAT " + i, "JunitTest_RepositoryEntry_" + i, "yo man description bla bla + i",
-				r, RepositoryEntry.ACC_OWNERS_AUTHORS);
+				r, RepositoryEntry.ACC_OWNERS_AUTHORS, defOrganisation);
 		return re;
 	}
 }
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java
index cd76c8d9c789d739b2d29755c168242333e01447..156eae2042aa2bc20d03eeb1f003471b34de6ea6 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryDAOTest.java
@@ -27,7 +27,9 @@ import java.util.UUID;
 
 import org.junit.Assert;
 import org.junit.Test;
+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.RepositoryManager;
 import org.olat.repository.RepositoryService;
@@ -51,10 +53,13 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 	private RepositoryService repositoryService;
 	@Autowired
 	private RepositoryEntryDAO repositoryEntryDao;
+	@Autowired
+	private OrganisationService organisationService;
 
 	@Test
 	public void loadByKey() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 1", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 1", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 
@@ -65,7 +70,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 	@Test
 	public void loadByResourceKey() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 2", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 2", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 
@@ -76,8 +82,9 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 	@Test
 	public void loadByResourceKeys() {
-		RepositoryEntry re1 = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 3a", "", null);
-		RepositoryEntry re2 = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 3b", "", null);
+		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);
 		dbInstance.commitAndCloseSession();
 
 		List<Long> resourceKeys = new ArrayList<>(2);
@@ -99,7 +106,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 	@Test
 	public void searchByIdAndRefs() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 4", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 4", "", null, 0, defOrganisation);
 		dbInstance.commit();
 		String externalId = UUID.randomUUID().toString();
 		String externalRef = UUID.randomUUID().toString();
@@ -147,7 +155,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 	@Test
 	public void getAllRepositoryEntries() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 4", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 4", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 
@@ -159,7 +168,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 	@Test
 	public void loadRepositoryEntryResource() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 5", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getSoftkey());
@@ -172,7 +182,8 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 
 	@Test
 	public void loadRepositoryEntryResourceBySoftKey() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 5", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 5", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getSoftkey());
@@ -195,10 +206,11 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 				.executeUpdate();
 
 		// insert test data
-		RepositoryEntry re1 = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 7a", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 7a", "", null, 0, defOrganisation);
 		re1.setExternalId(externalId);
 		repositoryService.update(re1);
-		RepositoryEntry re2 = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 7b", "", null);
+		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 7b", "", null, 0, defOrganisation);
 		re2.setExternalId(externalId);
 		repositoryService.update(re2);
 		dbInstance.commitAndCloseSession();
@@ -225,10 +237,11 @@ public class RepositoryEntryDAOTest extends OlatTestCase {
 				.executeUpdate();
 
 		// insert test data
-		RepositoryEntry re1 = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 8a", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re1 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 8a", "", null, 0, defOrganisation);
 		re1.setExternalRef(externalRef);
 		repositoryService.update(re1);
-		RepositoryEntry re2 = repositoryService.create("Rei Ayanami", "-", "Repository entry DAO Test 8b", "", null);
+		RepositoryEntry re2 = repositoryService.create(null, "Rei Ayanami", "-", "Repository entry DAO Test 8b", "", null, 0, defOrganisation);
 		re2.setExternalRef(externalRef);
 		repositoryService.update(re2);
 		dbInstance.commitAndCloseSession();
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java
index 5dd98faed4270265a8e6f10f070aff79389b4b83..e3a7e8ba51ad23f5876423f53571d655b8210675 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryRelationDAOTest.java
@@ -30,8 +30,10 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.olat.basesecurity.Group;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
 import org.olat.group.manager.BusinessGroupRelationDAO;
@@ -56,6 +58,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryRelationDAO repositoryEntryRelationDao;
 	@Autowired
 	private BusinessGroupService businessGroupService;
@@ -64,7 +68,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	
 	@Test
 	public void getDefaultGroup() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		Group group = repositoryEntryRelationDao.getDefaultGroup(re);
@@ -74,7 +79,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Test
 	public void addRole() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("add-role-2-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
@@ -84,7 +90,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Test
 	public void hasRole() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("add-role-3-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commit();
@@ -98,7 +105,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Test
 	public void getRoles() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("get-roles-1-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commit();
@@ -112,7 +120,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Test
 	public void removeRole() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("add-role-4-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		dbInstance.commit();
@@ -136,7 +145,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getMembersAndCountMembers() {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-1-");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-2-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
@@ -166,8 +176,9 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-2-");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-3-");
 		Identity id4 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-4-");
-		RepositoryEntry re1 = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
-		RepositoryEntry re2 = repositoryService.create("Rei Ayanami (alt)", "rel", "rel", null, null);
+		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);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re1, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re1, GroupRoles.participant.name());
@@ -202,7 +213,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-2-");
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-3-");
 		Identity id4 = JunitTestHelper.createAndPersistIdentityAsRndUser("member-4-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
@@ -226,7 +238,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getEnrollmentDate() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("enroll-date-1-");
 		Identity wid = JunitTestHelper.createAndPersistIdentityAsRndUser("not-enroll-date-1-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id, re, GroupRoles.participant.name());
@@ -256,7 +269,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("enroll-date-2-");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("enroll-date-3-");
 		Identity wid = JunitTestHelper.createAndPersistIdentityAsRndUser("not-enroll-date-2-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
@@ -274,7 +288,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	@Test
 	public void getEnrollmentDates_emptyCourse() {
 		//enrollment of an empty course
-		RepositoryEntry notEnrolledRe = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry notEnrolledRe = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		Map<Long,Date> notEnrollmentDates = repositoryEntryRelationDao.getEnrollmentDates(notEnrolledRe);
 		Assert.assertNotNull(notEnrollmentDates);
@@ -285,7 +300,8 @@ public class RepositoryEntryRelationDAOTest extends OlatTestCase {
 	public void getAuthorKeys() {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("auth-1-");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("part-2-");
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "rel", "rel", null, null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commit();
 		repositoryEntryRelationDao.addRole(id1, re, GroupRoles.owner.name());
 		repositoryEntryRelationDao.addRole(id2, re, GroupRoles.participant.name());
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java
index 3873b783ab8e2cfa3e1bc0055abdbcb6b9eed7bc..fb826dcf3619302066dbf856713718528c9b3286 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryStatisticsDAOTest.java
@@ -32,11 +32,13 @@ import java.util.concurrent.TimeUnit;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.services.commentAndRating.manager.UserCommentsDAO;
 import org.olat.core.commons.services.commentAndRating.manager.UserRatingsDAO;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.repository.RepositoryEntry;
@@ -68,11 +70,14 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryStatisticsDAO reStatisticsDao;
 	
 	@Test
 	public void createRepositoryEntry() {
-		RepositoryEntry re = repositoryService.create("Rei Ayanami", "-", "Statistics", "", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "Rei Ayanami", "-", "Statistics", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getStatistics());
@@ -91,7 +96,7 @@ 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);
+		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null, 0, null);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getStatistics());
@@ -109,7 +114,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	public void updateCommentsStatistics() {
 		//create an entry
 		Identity id = JunitTestHelper.createAndPersistIdentityAsAuthor("update-comment-");
-		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null, 0);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(id, null, "-", "Statistics", "", null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		Assert.assertNotNull(re.getStatistics());
@@ -125,7 +131,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	
 	@Test
 	public void incrementLaunchCounter() {
-		RepositoryEntry repositoryEntry = repositoryService.create("Rei Ayanami", "-", "T1_perf1", "T1_perf1", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf1", "T1_perf1", null, 0, defOrganisation);
 		
 		final Long keyRepo = repositoryEntry.getKey();
 		final OLATResourceable resourceable = repositoryEntry.getOlatResource();
@@ -156,7 +163,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	 */
 	@Test
 	public void incrementLaunchCounter_setDescription() {
-		RepositoryEntry repositoryEntry = repositoryService.create("Rei Ayanami", "-", "T1_perf1b", "T1_perf1b", null);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf1b", "T1_perf1b", null, 0, defOrganisation);
 		dbInstance.closeSession();
 		
 		final Long keyRepo = repositoryEntry.getKey();
@@ -184,7 +192,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	
 	@Test
 	public void incrementDownloadCounter() {
-		RepositoryEntry repositoryEntry = repositoryService.create("Rei Ayanami", "-", "T1_perf2", "T1_perf2", null);	
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_perf2", "T1_perf2", null, 0, defOrganisation);	
 		final Long keyRepo = repositoryEntry.getKey();
 		final OLATResourceable resourceable = repositoryEntry.getOlatResource();
 		assertNotNull(resourceable);
@@ -218,7 +227,9 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 
 		final int loop = 100;
 		final int numberOfThreads = 3;
-		final RepositoryEntry repositoryEntry = repositoryService.create("Rei Ayanami", "-", "T1_concurrent1", "T1_concurrent1", null);	
+
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		final RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_concurrent1", "T1_concurrent1", null, 0, defOrganisation);	
 		final Long keyRepo = repositoryEntry.getKey();
 		assertNotNull(repositoryEntry.getOlatResource());
 		dbInstance.commitAndCloseSession();
@@ -364,7 +375,8 @@ public class RepositoryEntryStatisticsDAOTest extends OlatTestCase {
 	public void concurrentIncrementDownloadCounter() {
 		final List<Exception> exceptionHolder = Collections.synchronizedList(new ArrayList<Exception>(1));
 
-		RepositoryEntry repositoryEntry = repositoryService.create("Rei Ayanami", "-", "T1_concurrent3", "T1_concurrent3", null);	
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry repositoryEntry = repositoryService.create(null, "Rei Ayanami", "-", "T1_concurrent3", "T1_concurrent3", null, 0, defOrganisation);	
 		final Long keyRepo = repositoryEntry.getKey();
 		final OLATResourceable resourceable = repositoryEntry.getOlatResource();
 		assertNotNull(resourceable);
diff --git a/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java b/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java
index 72049f432e41e5745c4cba56c8579c0bd3a97f93..52e054fa9e0c5b963079cb5cf22b05d5f1d9ee23 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryEntryToOrganisationDAOTest.java
@@ -21,6 +21,7 @@ package org.olat.repository.manager;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.manager.OrganisationDAO;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Organisation;
@@ -45,12 +46,15 @@ public class RepositoryEntryToOrganisationDAOTest extends OlatTestCase {
 	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryToOrganisationDAO repositoryEntryToOrganisationDao;
 	
 	@Test
 	public void createRelation() {
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
 		Organisation organisation = organisationDao.createAndPersistOrganisation("Repo-org-1", null, null, null, null);
-		RepositoryEntry re = repositoryService.create("Asuka Langley", "rel", "rel", null, null);
+		RepositoryEntry re = repositoryService.create(null, "Asuka Langley", "rel", "rel", null, null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		
 		RepositoryEntryToOrganisation relation = repositoryEntryToOrganisationDao
diff --git a/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java b/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java
index 09d6ceb7b7d01e729a66bf362e912a6c1fc851f7..b9e3a7636fe96b237a810275ca3af9401b5b3602 100644
--- a/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java
+++ b/src/test/java/org/olat/repository/manager/RepositoryServiceImplTest.java
@@ -25,8 +25,10 @@ import java.util.Locale;
 import org.junit.Assert;
 import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
@@ -56,6 +58,8 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 	@Autowired
 	private BusinessGroupService businessGroupService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryRelationDAO repositoryEntryRelationDao;
 	
 	@Test
@@ -65,7 +69,8 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 		String displayName = "ServiceTest";
 		String resourceName = "ServiceTest";
 		String description = "Test the brand new service";
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null, 0);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null, 0, defOrganisation);
 		dbInstance.commit();
 		
 		Assert.assertNotNull(re);
@@ -81,7 +86,8 @@ public class RepositoryServiceImplTest extends OlatTestCase {
 		String displayName = "Service test 2";
 		String resourceName = "ServiceTest";
 		String description = "Test the brand new service";
-		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null, 0);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(initialAuthor, null, resourceName, displayName, description, null, 0, defOrganisation);
 		dbInstance.commitAndCloseSession();
 		Assert.assertNotNull(re);
 		
diff --git a/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java b/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java
index 764d236a5fc2df145ac7c02bc78491e78c2cbe39..1e16c488cb7c3d51bd6298d3bc2bb99c535cd7f1 100644
--- a/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java
+++ b/src/test/java/org/olat/resource/accesscontrol/ACFrontendManagerTest.java
@@ -33,9 +33,11 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.util.CodeHelper;
 import org.olat.group.BusinessGroup;
@@ -84,6 +86,8 @@ public class ACFrontendManagerTest extends OlatTestCase {
 	@Autowired
 	private BusinessGroupService businessGroupService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private BusinessGroupRelationDAO businessGroupRelationDao;
 	@Autowired
 	private ACMethodDAO acMethodManager;
@@ -400,8 +404,9 @@ public class ACFrontendManagerTest extends OlatTestCase {
 		dbInstance.getCurrentEntityManager().persist(r);
 
 		// now make a repository entry for this resource
-		RepositoryEntry re = repositoryService.create("Florian Gnägi", "Access controlled by OLAT ",
-				"JunitRE" + UUID.randomUUID().toString().replace("-", ""), "Description", r);
+		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);
 		re = repositoryService.update(re);
 		dbInstance.commitAndCloseSession();
diff --git a/src/test/java/org/olat/resource/references/ReferenceManagerTest.java b/src/test/java/org/olat/resource/references/ReferenceManagerTest.java
index 035742acbec1a4803b6004eafc994659d62af70f..5e2cded9fea95c670d83252cc50cce269173019e 100644
--- a/src/test/java/org/olat/resource/references/ReferenceManagerTest.java
+++ b/src/test/java/org/olat/resource/references/ReferenceManagerTest.java
@@ -35,9 +35,11 @@ import java.util.List;
 import org.junit.Assert;
 import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.repository.RepositoryEntry;
@@ -64,6 +66,8 @@ public class ReferenceManagerTest extends OlatTestCase {
 	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryRelationDAO repositoryEntryRelationDao;
 	
 	@Test
@@ -215,10 +219,11 @@ public class ReferenceManagerTest extends OlatTestCase {
 	public void getReferencesInfos_simpleCase() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("Asuka");
 		Roles adminRoles = new Roles(true, false, false, false, false, false, false);
-		
-		RepositoryEntry course1 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 1", "", null);
-		RepositoryEntry course2 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 2", "", null);
-		RepositoryEntry test = repositoryService.create("Asuka Langley", "-", "Reference Manager test ", "", null);
+
+		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);
 		// add the references
 		referenceManager.addReference(course1.getOlatResource(), test.getOlatResource(), "86234");
 		referenceManager.addReference(course2.getOlatResource(), test.getOlatResource(), "78437590");
@@ -256,14 +261,15 @@ public class ReferenceManagerTest extends OlatTestCase {
 	public void getReferencesInfos_difficultCase() {
 		Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("Asuka");
 		Roles adminRoles = new Roles(true, false, false, false, false, false, false);
-		
-		RepositoryEntry course1 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 1", "", null);
-		RepositoryEntry course2 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 2", "", null);
-		RepositoryEntry course3 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 3", "", null);
-		RepositoryEntry course4 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 4", "", null);
-		RepositoryEntry test12 = repositoryService.create("Asuka Langley", "-", "Reference Manager test 12", "", null);
-		RepositoryEntry test2 = repositoryService.create("Asuka Langley", "-", "Reference Manager test 2", "", null);
-		RepositoryEntry test234 = repositoryService.create("Asuka Langley", "-", "Reference Manager test 234", "", null);
+
+		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);
 		// add the references
 		referenceManager.addReference(course1.getOlatResource(), test12.getOlatResource(), "45345");
 		referenceManager.addReference(course2.getOlatResource(), test12.getOlatResource(), "453421");
@@ -336,16 +342,17 @@ public class ReferenceManagerTest extends OlatTestCase {
 		Identity id1 = JunitTestHelper.createAndPersistIdentityAsRndUser("Asuka");
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("Rei");
 		Roles roles = new Roles(false, false, false, false, false, false, false);
-		
-		RepositoryEntry course1 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 1 permission", "", null);
-		RepositoryEntry course2 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 2 permission", "", null);
-		RepositoryEntry course3 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 3 permission", "", null);
-		RepositoryEntry course4 = repositoryService.create("Asuka Langley", "-", "Reference Manager course 4 permission", "", null);
-		RepositoryEntry test12 = repositoryService.create("Asuka Langley", "-", "Reference Manager test 12 permission", "", null);
+
+		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);
 		repositoryEntryRelationDao.addRole(id1, test12, GroupRoles.owner.name());
-		RepositoryEntry test2 = repositoryService.create("Asuka Langley", "-", "Reference Manager test 2 permission", "", null);
+		RepositoryEntry test2 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 2 permission", "", null, 0, defOrganisation);
 		repositoryEntryRelationDao.addRole(id2, test2, GroupRoles.owner.name());
-		RepositoryEntry test234 = repositoryService.create("Asuka Langley", "-", "Reference Manager test 234 permission", "", null);
+		RepositoryEntry test234 = repositoryService.create(null, "Asuka Langley", "-", "Reference Manager test 234 permission", "", null, 0, 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 7505f833c8f8c38e5f9fc28e9ce4031a74d72d5f..948eb9f30fef24e697cf907b8e9c899ec03cfc74 100644
--- a/src/test/java/org/olat/restapi/CalendarTest.java
+++ b/src/test/java/org/olat/restapi/CalendarTest.java
@@ -62,7 +62,6 @@ import org.olat.course.config.CourseConfig;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -99,7 +98,8 @@ public class CalendarTest extends OlatJerseyTestCase {
 			//create a course with a calendar
 			CourseConfigVO config = new CourseConfigVO();
 			config.setCalendar(Boolean.TRUE);
-			course1 = CoursesWebService.createEmptyCourse(id1, "Cal course", "Cal course", config);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id1, RepositoryEntry.ACC_OWNERS);
+			course1 = CourseFactory.loadCourse(courseEntry);
 			dbInstance.commit();
 			
 			ICourse course = CourseFactory.loadCourse(course1.getResourceableId());
@@ -136,7 +136,8 @@ public class CalendarTest extends OlatJerseyTestCase {
 			//create a course with a calendar
 			CourseConfigVO config = new CourseConfigVO();
 			config.setCalendar(Boolean.TRUE);
-			course2 = CoursesWebService.createEmptyCourse(id2, "Cal course - 2", "Cal course - 2", config);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id2, RepositoryEntry.ACC_OWNERS);
+			course2 = CourseFactory.loadCourse(courseEntry);
 			dbInstance.commit();
 
 			KalendarRenderWrapper calendarWrapper = calendarManager.getCourseCalendar(course2);
diff --git a/src/test/java/org/olat/restapi/CatalogTest.java b/src/test/java/org/olat/restapi/CatalogTest.java
index f3373264886b2a3e72ad482e83cd5587836e2d85..9bba85b69fd4f0d015cc1f2f46ac70a192ed65fb 100644
--- a/src/test/java/org/olat/restapi/CatalogTest.java
+++ b/src/test/java/org/olat/restapi/CatalogTest.java
@@ -51,10 +51,12 @@ import org.codehaus.jackson.type.TypeReference;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.basesecurity.manager.SecurityGroupDAO;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.course.CourseModule;
 import org.olat.repository.CatalogEntry;
 import org.olat.repository.RepositoryEntry;
@@ -95,6 +97,8 @@ public class CatalogTest extends OlatJerseyTestCase {
 	private RepositoryManager repositoryManager;
 	@Autowired
 	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	private Identity admin, id1;
 	private CatalogEntry root1, entry1, entry2, subEntry11, subEntry12;
@@ -697,7 +701,8 @@ public class CatalogTest extends OlatJerseyTestCase {
 		
 		RepositoryEntry d = repositoryManager.lookupRepositoryEntry(resourceable, false);
 		if(d == null) {
-			d = repositoryService.create("Rei Ayanami", "-", displayName, "Repo entry", r);
+			Organisation defOrganisation = organisationService.getDefaultOrganisation();
+			d = repositoryService.create(null, "Rei Ayanami", "-", displayName, "Repo entry", r, 0, 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 c7c716dde9e0d1bbaaf136d2bbed7ef7fa30576d..3bead3d5374e8c67f8faa6509a5d3534c89fef81 100644
--- a/src/test/java/org/olat/restapi/ContactsTest.java
+++ b/src/test/java/org/olat/restapi/ContactsTest.java
@@ -36,10 +36,12 @@ import org.apache.http.client.methods.HttpGet;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.group.BusinessGroup;
 import org.olat.group.BusinessGroupService;
@@ -66,6 +68,8 @@ public class ContactsTest extends OlatJerseyTestCase {
 	private BusinessGroupRelationDAO businessGroupRelationDao;
 	@Autowired
 	private BusinessGroupService businessGroupService;
+	@Autowired
+	private OrganisationService organisationService;
 	
 	@Before
 	@Override
@@ -87,7 +91,9 @@ public class ContactsTest extends OlatJerseyTestCase {
 		course = OLATResourceManager.getInstance().findOrPersistResourceable(resourceable);
 		
 		RepositoryService rs = CoreSpringFactory.getImpl(RepositoryService.class);
-		RepositoryEntry re = rs.create("administrator", "-", "rest-re", null, course);
+
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = rs.create(null, "administrator", "-", "rest-re", null, course, 0, 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 a3d6b8ac652b5dc2f2e6c031b91ee9b3f1f5b629..39fdf71d41c9d4d3879f579166372680d29d9cd1 100644
--- a/src/test/java/org/olat/restapi/CourseCalendarTest.java
+++ b/src/test/java/org/olat/restapi/CourseCalendarTest.java
@@ -66,7 +66,7 @@ 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.restapi.repository.course.CoursesWebService;
+import org.olat.repository.RepositoryEntry;
 import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -103,7 +103,8 @@ public class CourseCalendarTest extends OlatJerseyTestCase {
 			auth1 = JunitTestHelper.createAndPersistIdentityAsUser("rest-course-cal-one");
 			CourseConfigVO config = new CourseConfigVO();
 			config.setCalendar(Boolean.TRUE);
-			course1 = CoursesWebService.createEmptyCourse(auth1, "course calendar", "course with calendar for REST API testing", config);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(auth1, RepositoryEntry.ACC_OWNERS);
+			course1 = CourseFactory.loadCourse(courseEntry);
 			dbInstance.commit();
 			
 			ICourse course = CourseFactory.loadCourse(course1.getResourceableId());
@@ -191,7 +192,9 @@ public class CourseCalendarTest extends OlatJerseyTestCase {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
 		CourseConfigVO config = new CourseConfigVO();
 		config.setCalendar(Boolean.TRUE);
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "Course with calendar", "Course with calendar", config);
+		
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		//create an event
diff --git a/src/test/java/org/olat/restapi/CourseDBTest.java b/src/test/java/org/olat/restapi/CourseDBTest.java
index 1843e90025ca79eaedf4af5c4ec6cae4e4b23220..7e2b4d05fc32b2d64b50b0d38e3936ce778edee0 100644
--- a/src/test/java/org/olat/restapi/CourseDBTest.java
+++ b/src/test/java/org/olat/restapi/CourseDBTest.java
@@ -42,12 +42,12 @@ import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.util.resource.OresHelper;
+import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.course.db.CourseDBEntry;
 import org.olat.course.db.CourseDBManager;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.KeyValuePair;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -79,7 +79,8 @@ public class CourseDBTest extends OlatJerseyTestCase {
 		// create course and persist as OLATResourceImpl
 		if(!initialized) {
 			auth = JunitTestHelper.createAndPersistIdentityAsUser("rest-course-cal-one");
-			course = CoursesWebService.createEmptyCourse(auth, "course calendar", "course with calendar for REST API testing", null);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(auth);
+			course = CourseFactory.loadCourse(courseEntry);
 			initialized = true;
 		}
 	}
diff --git a/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java b/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java
index 1296bd8869300c4dadfe79a05f886540ffb44be5..c8376b5be242596517faaae380b6173a559b93c8 100644
--- a/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java
+++ b/src/test/java/org/olat/restapi/CourseGroupMgmtTest.java
@@ -58,13 +58,10 @@ 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.ICourse;
 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.RepositoryManager;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.GroupVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
@@ -97,8 +94,6 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
 	private BusinessGroupService businessGroupService;
 	@Autowired
 	private BusinessGroupRelationDAO businessGroupRelationDao;
-	@Autowired
-	private RepositoryManager repositoryManager;
 	
 	
 	/**
@@ -116,28 +111,26 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
 		id2 = JunitTestHelper.createAndPersistIdentityAsUser("rest-c-g-2");
 		JunitTestHelper.createAndPersistIdentityAsUser("rest-c-g-3");
 		Identity auth = JunitTestHelper.createAndPersistIdentityAsUser("rest-course-grp-one");
-		ICourse course = CoursesWebService.createEmptyCourse(auth, "course for groups", "course with groups for REST API testing", null);
-		dbInstance.commitAndCloseSession();
-		courseRepoEntry = repositoryManager.lookupRepositoryEntry(course, true);
-
 		
-    // create groups without waiting list
-    g1 = businessGroupService.createBusinessGroup(null, "rest-g1", null, 0, 10, false, false, courseRepoEntry);
-    g2 = businessGroupService.createBusinessGroup(null, "rest-g2", null, 0, 10, false, false, courseRepoEntry);
-    // members
-    businessGroupRelationDao.addRole(id1, g2, GroupRoles.coach.name());
-	businessGroupRelationDao.addRole(id1, g1, GroupRoles.participant.name());
-	businessGroupRelationDao.addRole(id2, g1, GroupRoles.participant.name());
-	businessGroupRelationDao.addRole(id2, g2, GroupRoles.participant.name());
+		courseRepoEntry = JunitTestHelper.deployBasicCourse(auth);
+
+		// create groups without waiting list
+		g1 = businessGroupService.createBusinessGroup(null, "rest-g1", null, 0, 10, false, false, courseRepoEntry);
+		g2 = businessGroupService.createBusinessGroup(null, "rest-g2", null, 0, 10, false, false, courseRepoEntry);
+		// members
+		businessGroupRelationDao.addRole(id1, g2, GroupRoles.coach.name());
+		businessGroupRelationDao.addRole(id1, g1, GroupRoles.participant.name());
+		businessGroupRelationDao.addRole(id2, g1, GroupRoles.participant.name());
+		businessGroupRelationDao.addRole(id2, g2, GroupRoles.participant.name());
     
-    // groups
-    g3 = businessGroupService.createBusinessGroup(null, "rest-g3", null, -1, -1, false, false, courseRepoEntry);
-    g4 = businessGroupService.createBusinessGroup(null, "rest-g4", null, -1, -1, false, false, courseRepoEntry);
-    // members
-	businessGroupRelationDao.addRole(id1, g3, GroupRoles.participant.name());
-	businessGroupRelationDao.addRole(id2, g4, GroupRoles.participant.name());
+		// groups
+		g3 = businessGroupService.createBusinessGroup(null, "rest-g3", null, -1, -1, false, false, courseRepoEntry);
+		g4 = businessGroupService.createBusinessGroup(null, "rest-g4", null, -1, -1, false, false, courseRepoEntry);
+		// members
+		businessGroupRelationDao.addRole(id1, g3, GroupRoles.participant.name());
+		businessGroupRelationDao.addRole(id2, g4, GroupRoles.participant.name());
     
-    dbInstance.commitAndCloseSession(); // simulate user clicks
+		dbInstance.commitAndCloseSession(); // simulate user clicks
 	}
 	
   @After
diff --git a/src/test/java/org/olat/restapi/CoursePublishTest.java b/src/test/java/org/olat/restapi/CoursePublishTest.java
index 2c775c57c83df23a9ff38fb3fc3641343163673e..7af79434cfb0b05f11942cc22f932c9c1fe5bf50 100644
--- a/src/test/java/org/olat/restapi/CoursePublishTest.java
+++ b/src/test/java/org/olat/restapi/CoursePublishTest.java
@@ -22,12 +22,10 @@ package org.olat.restapi;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.UUID;
 
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriBuilder;
@@ -47,6 +45,7 @@ import org.olat.course.ICourse;
 import org.olat.course.nodes.CourseNode;
 import org.olat.repository.RepositoryEntry;
 import org.olat.restapi.support.vo.CourseVO;
+import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -68,11 +67,8 @@ public class CoursePublishTest extends OlatJerseyTestCase {
 		assertTrue(conn.login("administrator", "openolat"));
 		
 		//deploy a test course
-		URL courseWithForumsUrl = CoursePublishTest.class.getResource("myCourseWS.zip");
-		Assert.assertNotNull(courseWithForumsUrl);
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString().replace("-", "").substring(0, 30);
-		RepositoryEntry re = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);	
+		URL courseUrl = CoursePublishTest.class.getResource("myCourseWS.zip");
+		RepositoryEntry re = JunitTestHelper.deployCourse(null, "My WS course", courseUrl); // 4);	
 		Assert.assertNotNull(re);
 		ICourse course = CourseFactory.loadCourse(re.getOlatResource().getResourceableId());
 		CourseNode rootNode = course.getRunStructure().getRootNode();
diff --git a/src/test/java/org/olat/restapi/CourseSecurityTest.java b/src/test/java/org/olat/restapi/CourseSecurityTest.java
index dccec69341d741fad4e81865e2eb5bfb4bd731d3..0b72533125e1434875d110191720e18cea8efe5b 100644
--- a/src/test/java/org/olat/restapi/CourseSecurityTest.java
+++ b/src/test/java/org/olat/restapi/CourseSecurityTest.java
@@ -49,10 +49,10 @@ 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.RepositoryManager;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -98,7 +98,8 @@ public class CourseSecurityTest extends OlatJerseyTestCase {
 			auth2 = JunitTestHelper.createAndPersistIdentityAsAuthor("id-c-s-2");
 			Assert.assertNotNull(auth2);
 			
-			course = CoursesWebService.createEmptyCourse(admin, "course-security-2", "Test course for the security test", null);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+			course = CourseFactory.loadCourse(courseEntry);
 			dbInstance.intermediateCommit();
 
 			RepositoryEntry re = repositoryManager.lookupRepositoryEntry(course, false);
diff --git a/src/test/java/org/olat/restapi/CourseTest.java b/src/test/java/org/olat/restapi/CourseTest.java
index f0e70bafc3f0ac9c297726fffcf66cfaceaa37be..8401a5137eaffc5162cf4c7befe2428521274e43 100644
--- a/src/test/java/org/olat/restapi/CourseTest.java
+++ b/src/test/java/org/olat/restapi/CourseTest.java
@@ -66,13 +66,13 @@ import org.olat.core.id.Identity;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
+import org.olat.course.CourseFactory;
 import org.olat.course.CourseModule;
 import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.model.SearchRepositoryEntryParameters;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.restapi.support.vo.CourseVO;
 import org.olat.restapi.support.vo.RepositoryEntryVO;
@@ -115,7 +115,8 @@ public class CourseTest extends OlatJerseyTestCase {
 			auth1 = JunitTestHelper.createAndPersistIdentityAsUser("rest-one");
 			auth2 = JunitTestHelper.createAndPersistIdentityAsUser("rest-two");
 			
-			course1 = CoursesWebService.createEmptyCourse(admin, "course1", "course1 long name", null);
+			RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+			course1 = CourseFactory.loadCourse(courseEntry);
 			
 			dbInstance.closeSession();
 		} catch (Exception e) {
@@ -223,7 +224,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	
 	@Test
 	public void testDeleteCourses() throws IOException, URISyntaxException {
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "courseToDel", "course to delete", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		
 		assertTrue(conn.login("administrator", "openolat"));
@@ -233,7 +235,7 @@ public class CourseTest extends OlatJerseyTestCase {
 		HttpResponse response = conn.execute(method);
 		assertEquals(200, response.getStatusLine().getStatusCode());
 		
-		List<String> courseType = new ArrayList<String>();
+		List<String> courseType = new ArrayList<>();
 		courseType.add(CourseModule.getCourseTypeName());
 		Roles roles = new Roles(true, true, true, true, false, true, false);
 
@@ -270,7 +272,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	@Test
 	public void addAuthors() throws IOException, URISyntaxException {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "course1", "course1 long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		Identity author1 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-auth-1");
 		Identity author2 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-auth-2");
 		dbInstance.commitAndCloseSession();
@@ -441,7 +444,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	@Test
 	public void addCoaches() throws IOException, URISyntaxException {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "course1", "course1 long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		Identity coach1 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-coach-1");
 		Identity coach2 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-coach-2");
 		dbInstance.commitAndCloseSession();
@@ -538,7 +542,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	@Test
 	public void addParticipants() throws IOException, URISyntaxException {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "course1", "course1 long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		Identity participant1 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-part-1");
 		Identity participant2 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-part-2");
 		dbInstance.commitAndCloseSession();
@@ -568,7 +573,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	@Test
 	public void changedStatus_closed() throws IOException, URISyntaxException {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
-		ICourse courseToClose = CoursesWebService.createEmptyCourse(admin, "Course to close", "A course to close.", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		ICourse courseToClose = CourseFactory.loadCourse(courseEntry);
 		dbInstance.closeSession();
 		
 		URI request = UriBuilder.fromUri(getContextURI()).path("repo").path("courses")
@@ -587,7 +593,8 @@ public class CourseTest extends OlatJerseyTestCase {
 	@Test
 	public void changedStatus_deleted() throws IOException, URISyntaxException {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
-		ICourse courseToClose = CoursesWebService.createEmptyCourse(admin, "Course to delete (soft)", "A course to delete.", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		ICourse courseToClose = CourseFactory.loadCourse(courseEntry);
 		dbInstance.closeSession();
 		
 		URI request = UriBuilder.fromUri(getContextURI()).path("repo").path("courses")
diff --git a/src/test/java/org/olat/restapi/CoursesContactElementTest.java b/src/test/java/org/olat/restapi/CoursesContactElementTest.java
index 773e11fb0c287947afb496cc76b16c06933a5e0e..fd8ce62ed9404fd5a7bda0670d9581a8bf377e42 100644
--- a/src/test/java/org/olat/restapi/CoursesContactElementTest.java
+++ b/src/test/java/org/olat/restapi/CoursesContactElementTest.java
@@ -57,8 +57,9 @@ import org.olat.course.ICourse;
 import org.olat.course.nodes.CourseNode;
 import org.olat.course.tree.CourseEditorTreeNode;
 import org.olat.modules.ModuleConfiguration;
-import org.olat.restapi.repository.course.CoursesWebService;
+import org.olat.repository.RepositoryEntry;
 import org.olat.restapi.support.vo.CourseNodeVO;
+import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -90,7 +91,9 @@ public class CoursesContactElementTest extends OlatJerseyTestCase {
 		conn = new RestConnection();
 		
 		admin = securityManager.findIdentityByName("administrator");
-		course1 = CoursesWebService.createEmptyCourse(admin, "course-rest-contacts", "Course to test the contacts elements", null);
+		
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		course1 = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		
 		rootNodeId = course1.getEditorTreeModel().getRootNode().getIdent();
diff --git a/src/test/java/org/olat/restapi/CoursesFoldersTest.java b/src/test/java/org/olat/restapi/CoursesFoldersTest.java
index f1c220cb90f8f9835a8fa0166b47cfa0aa08f34f..3b72f8565d5af07c1fd473645474ad2e8bd6d4e9 100644
--- a/src/test/java/org/olat/restapi/CoursesFoldersTest.java
+++ b/src/test/java/org/olat/restapi/CoursesFoldersTest.java
@@ -62,7 +62,6 @@ 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.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.FolderVO;
 import org.olat.restapi.support.vo.FolderVOes;
 import org.olat.test.JunitTestHelper;
@@ -89,7 +88,8 @@ public class CoursesFoldersTest extends OlatJerseyTestCase {
 		
 		admin = securityManager.findIdentityByName("administrator");
 		user = JunitTestHelper.createAndPersistIdentityAsUser("rest-cf-one");
-		course1 = CoursesWebService.createEmptyCourse(admin, "course1", "course1 long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		course1 = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		
 		//create a folder
diff --git a/src/test/java/org/olat/restapi/CoursesForumsTest.java b/src/test/java/org/olat/restapi/CoursesForumsTest.java
index 2e09a586cca060c356b1667e8b679878bd31133b..5c827b18bf43f3de4e148cb8d59e5ce2cccb7204 100644
--- a/src/test/java/org/olat/restapi/CoursesForumsTest.java
+++ b/src/test/java/org/olat/restapi/CoursesForumsTest.java
@@ -48,7 +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.restapi.repository.course.CoursesWebService;
+import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -80,7 +80,8 @@ public class CoursesForumsTest  extends OlatJerseyTestCase {
 		conn = new RestConnection();
 		
 		admin = securityManager.findIdentityByName("administrator");
-		course1 = CoursesWebService.createEmptyCourse(admin, "Course forum 1", "Course forum 1 long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		course1 = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		
 		//create a folder
diff --git a/src/test/java/org/olat/restapi/CoursesInfosTest.java b/src/test/java/org/olat/restapi/CoursesInfosTest.java
index 37feb08e0c8030018791ecaf8ade51f3291e6ee0..583ddb70cc7b00abb1d5f9406c7ecded653514aa 100644
--- a/src/test/java/org/olat/restapi/CoursesInfosTest.java
+++ b/src/test/java/org/olat/restapi/CoursesInfosTest.java
@@ -40,10 +40,12 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.id.Identity;
+import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
-import org.olat.restapi.repository.course.CoursesWebService;
+import org.olat.repository.RepositoryEntry;
 import org.olat.restapi.support.vo.CourseInfoVO;
 import org.olat.restapi.support.vo.CourseInfoVOes;
+import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -77,7 +79,8 @@ public class CoursesInfosTest extends OlatJerseyTestCase {
 	@Test
 	public void testGetCourseInfos_byId() throws IOException, URISyntaxException {
 		Identity admin = securityManager.findIdentityByName("administrator");
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "course-info 1", "course long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin, "course-info 1", RepositoryEntry.ACC_OWNERS);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 
 		RestConnection conn = new RestConnection();
 		assertTrue(conn.login("administrator", "openolat"));
diff --git a/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java b/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java
index 618a25df2bca4c8cbe3828e047b641cd14537fef..d86ea302d96462648ee5ba406fc054a6bf5a1983 100644
--- a/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java
+++ b/src/test/java/org/olat/restapi/CoursesResourcesFoldersTest.java
@@ -55,9 +55,11 @@ import org.olat.core.id.Identity;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.vfs.VFSContainer;
 import org.olat.core.util.vfs.VFSLeaf;
+import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
-import org.olat.restapi.repository.course.CoursesWebService;
+import org.olat.repository.RepositoryEntry;
 import org.olat.restapi.support.vo.LinkVO;
+import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -77,7 +79,8 @@ public class CoursesResourcesFoldersTest extends OlatJerseyTestCase {
 		conn = new RestConnection();
 		
 		admin = securityManager.findIdentityByName("administrator");
-		course1 = CoursesWebService.createEmptyCourse(admin, "course1", "course1 long name", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployEmptyCourse(admin, "Empty course", RepositoryEntry.ACC_OWNERS);
+		course1 = CourseFactory.loadCourse(courseEntry);
 		
 		//copy a couple of files in the resource folder
 		VFSContainer container = course1.getCourseFolderContainer();
diff --git a/src/test/java/org/olat/restapi/CoursesTest.java b/src/test/java/org/olat/restapi/CoursesTest.java
index 8c405362b47c7241fb7698d42224b77ed56a28a5..ac8b8d170b92f58bf05956ccc09c51e0361e8d5f 100644
--- a/src/test/java/org/olat/restapi/CoursesTest.java
+++ b/src/test/java/org/olat/restapi/CoursesTest.java
@@ -74,7 +74,6 @@ import org.olat.repository.RepositoryManager;
 import org.olat.repository.manager.RepositoryEntryLifecycleDAO;
 import org.olat.repository.manager.RepositoryEntryRelationDAO;
 import org.olat.repository.model.RepositoryEntryLifecycle;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.CourseVO;
 import org.olat.restapi.support.vo.CourseVOes;
 import org.olat.test.JunitTestHelper;
@@ -86,7 +85,7 @@ public class CoursesTest extends OlatJerseyTestCase {
 	private static final OLog log = Tracing.createLoggerFor(CoursesTest.class);
 
 	private Identity admin;
-	private ICourse course1, course2, course3;
+	private ICourse course2, course3;
 	private RepositoryEntry re1, re2, re3;
 	private String externalId, externalRef;
 	private String externalId3;
@@ -113,25 +112,23 @@ public class CoursesTest extends OlatJerseyTestCase {
 		try {
 			// create course and persist as OLATResourceImpl
 			admin = securityManager.findIdentityByName("administrator");
-			course1 = CoursesWebService.createEmptyCourse(admin, "courses1", "courses1 long name", null, null, null, RepositoryEntry.ACC_OWNERS, false, null, null, null, null, null, null);
+			
+			re1 = JunitTestHelper.deployBasicCourse(admin, "courses1", RepositoryEntry.ACC_OWNERS);
+			re2 = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+			re3 = JunitTestHelper.deployBasicCourse(admin, RepositoryEntry.ACC_OWNERS);
+			dbInstance.commit();
 
 			externalId = UUID.randomUUID().toString();
 			externalRef = UUID.randomUUID().toString();
-			course2 = CoursesWebService.createEmptyCourse(admin, "courses2", "courses2 long name", null, null, null, RepositoryEntry.ACC_OWNERS, false, null, null, externalId, externalRef, "all", null);
-
-			dbInstance.commitAndCloseSession();
-
-			re1 = repositoryManager.lookupRepositoryEntry(course1, false);
-			re2 = repositoryManager.lookupRepositoryEntry(course2, false);
-
+			re2 = repositoryManager.setDescriptionAndName(re2, "courses2", "courses2 desc", null, null, externalId, externalRef, null, null);
+			
 			externalId3 = UUID.randomUUID().toString();
-			course3 = CoursesWebService.createEmptyCourse(admin, "courses3", "courses3 long name", null, null, null, RepositoryEntry.ACC_OWNERS, false, null, null, externalId3, null, "all", null);
-			re3 = repositoryManager.lookupRepositoryEntry(course3, false);
 			RepositoryEntryLifecycle lifecycle3 = reLifecycleDao.create("course3 lifecycle", UUID.randomUUID().toString(), true, new Date(), new Date());
-			dbInstance.commit();
-			re3.setLifecycle(lifecycle3);
-			re3 = dbInstance.getCurrentEntityManager().merge(re3);
+			re3 = repositoryManager.setDescriptionAndName(re3, "courses3", "courses3 desc", null, null, externalId3, null, "all", lifecycle3);
 			dbInstance.commitAndCloseSession();
+			
+			course2 = CourseFactory.loadCourse(re2);
+			course3 = CourseFactory.loadCourse(re3);
 		} catch (Exception e) {
 			log.error("Exception in setUp(): " + e);
 		}
diff --git a/src/test/java/org/olat/restapi/EfficiencyStatementTest.java b/src/test/java/org/olat/restapi/EfficiencyStatementTest.java
index 2051ef6982c4b070a70e591ffbd8ca8cd75d44bd..6d2f6ed8a9b3854ce5048c345f2aa9eef29943bf 100644
--- a/src/test/java/org/olat/restapi/EfficiencyStatementTest.java
+++ b/src/test/java/org/olat/restapi/EfficiencyStatementTest.java
@@ -38,13 +38,13 @@ import org.junit.Test;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.course.assessment.UserEfficiencyStatement;
 import org.olat.course.assessment.manager.EfficiencyStatementManager;
 import org.olat.course.assessment.model.EfficiencyStatementVO;
 import org.olat.repository.RepositoryEntry;
 import org.olat.resource.OLATResource;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,7 +69,8 @@ public class EfficiencyStatementTest extends OlatJerseyTestCase {
 		// create a standalone efficiency statement
 		Identity admin = securityManager.findIdentityByName("administrator");
 		Identity assessedIdentity = JunitTestHelper.createAndPersistIdentityAsRndUser("eff-1");
-		ICourse course = CoursesWebService.createEmptyCourse(admin, "courses1", "courses1 long name", null, null, null, RepositoryEntry.ACC_OWNERS, false, null, null, null, null, null, null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(admin);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.commitAndCloseSession();
 		
 		OLATResource resource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
diff --git a/src/test/java/org/olat/restapi/GroupFoldersTest.java b/src/test/java/org/olat/restapi/GroupFoldersTest.java
index c8f0d972f68489d3d253b69f31e4d168447c9897..9cc7fbf05ba1a9456d5a058f60044d9d4e4abd42 100644
--- a/src/test/java/org/olat/restapi/GroupFoldersTest.java
+++ b/src/test/java/org/olat/restapi/GroupFoldersTest.java
@@ -55,13 +55,14 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.collaboration.CollaborationTools;
 import org.olat.collaboration.CollaborationToolsFactory;
-import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.resource.OresHelper;
 import org.olat.core.util.vfs.VFSContainer;
@@ -98,6 +99,8 @@ public class GroupFoldersTest extends OlatJerseyTestCase {
 	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private BusinessGroupService businessGroupService;
 	@Autowired
 	private BusinessGroupRelationDAO businessGroupRelationDao;
@@ -122,8 +125,8 @@ public class GroupFoldersTest extends OlatJerseyTestCase {
 		// create course and persist as OLATResourceImpl
 		OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse",System.currentTimeMillis());
 		course = OLATResourceManager.getInstance().findOrPersistResourceable(resourceable);
-		RepositoryService rs = CoreSpringFactory.getImpl(RepositoryService.class);
-		RepositoryEntry re = rs.create("administrator", "-", "rest-re", null, course);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "administrator", "-", "rest-re", null, course, 0, 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 86aa3af55b5143333fc5c5f8a70f84489e6833bc..127845d0cbdfbab05205a413448ac7eebb34fb88 100644
--- a/src/test/java/org/olat/restapi/GroupMgmtTest.java
+++ b/src/test/java/org/olat/restapi/GroupMgmtTest.java
@@ -57,13 +57,14 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.collaboration.CollaborationTools;
 import org.olat.collaboration.CollaborationToolsFactory;
-import org.olat.core.CoreSpringFactory;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
 import org.olat.core.util.resource.OresHelper;
@@ -111,6 +112,10 @@ public class GroupMgmtTest extends OlatJerseyTestCase {
 	@Autowired
 	private DB dbInstance;
 	@Autowired
+	private RepositoryService repositoryService;
+	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private BusinessGroupService businessGroupService;
 	@Autowired
 	private BusinessGroupRelationDAO businessGroupRelationDao;
@@ -137,9 +142,9 @@ public class GroupMgmtTest extends OlatJerseyTestCase {
 		// create course and persist as OLATResourceImpl
 		OLATResourceable resourceable = OresHelper.createOLATResourceableInstance("junitcourse",System.currentTimeMillis());
 		course = rm.findOrPersistResourceable(resourceable);
-		RepositoryService rs = CoreSpringFactory.getImpl(RepositoryService.class);
-		RepositoryEntry re = rs.create("administrator", "-", "rest-re", null, course);
-		DBFactory.getInstance().commit();
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry re = repositoryService.create(null, "administrator", "-", "rest-re", null, course, 0, defOrganisation);
+		dbInstance.commit();
 		assertNotNull(re);
 		
 		//create learn group
@@ -148,7 +153,7 @@ public class GroupMgmtTest extends OlatJerseyTestCase {
 		// create groups without waiting list
 		g1 = businessGroupService.createBusinessGroup(null, "rest-g1", null, 0, 10, false, false, c1);
 		g2 = businessGroupService.createBusinessGroup(null, "rest-g2", null, 0, 10, false, false, c1);
-		DBFactory.getInstance().commit();
+		dbInstance.commit();
 		//permission to see owners and participants
 		businessGroupService.updateDisplayMembers(g1, false, false, false, false, false, false, false);
 		businessGroupService.updateDisplayMembers(g2, true, true, false, false, false, false, false);
diff --git a/src/test/java/org/olat/restapi/LecturesBlocksRootTest.java b/src/test/java/org/olat/restapi/LecturesBlocksRootTest.java
index e4c24fa315509f7155f6a74397fb377d5bc4d925..ab2c3ac4c4f359bedb25c2fba155de9586203a15 100644
--- a/src/test/java/org/olat/restapi/LecturesBlocksRootTest.java
+++ b/src/test/java/org/olat/restapi/LecturesBlocksRootTest.java
@@ -38,13 +38,10 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
-import org.olat.course.ICourse;
 import org.olat.modules.lecture.LectureBlock;
 import org.olat.modules.lecture.LectureService;
 import org.olat.modules.lecture.restapi.LectureBlockVO;
 import org.olat.repository.RepositoryEntry;
-import org.olat.restapi.repository.course.CoursesWebService;
-import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -66,8 +63,8 @@ public class LecturesBlocksRootTest extends OlatJerseyTestCase {
 	public void getLecturesBlock()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-root-all");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence", "Course with absence", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 		lectureService.addTeacher(block, author);
@@ -101,8 +98,7 @@ public class LecturesBlocksRootTest extends OlatJerseyTestCase {
 	public void getLecturesBlock_date()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-root-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence", "Course with absence", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 		lectureService.addTeacher(block, author);
diff --git a/src/test/java/org/olat/restapi/LecturesBlocksTest.java b/src/test/java/org/olat/restapi/LecturesBlocksTest.java
index d3d84e880c0816734844a9eb5ac4c6320143de93..564f98a88fdeb048ebf2bfc6a05e2ef680a9c091 100644
--- a/src/test/java/org/olat/restapi/LecturesBlocksTest.java
+++ b/src/test/java/org/olat/restapi/LecturesBlocksTest.java
@@ -45,6 +45,7 @@ import org.junit.Test;
 import org.olat.basesecurity.Group;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.course.CourseFactory;
 import org.olat.course.ICourse;
 import org.olat.modules.lecture.LectureBlock;
 import org.olat.modules.lecture.LectureBlockStatus;
@@ -56,8 +57,6 @@ import org.olat.modules.lecture.restapi.LectureBlockVO;
 import org.olat.modules.lecture.restapi.RepositoryEntryLectureConfigurationVO;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryService;
-import org.olat.restapi.repository.course.CoursesWebService;
-import org.olat.restapi.support.vo.CourseConfigVO;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -88,7 +87,8 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void getLecturesBlock_course()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence", "Course with absence", new CourseConfigVO());
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(author);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
@@ -120,7 +120,8 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void getLecturesBlock_repository()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence", "Course with absence", new CourseConfigVO());
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(author);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
@@ -146,7 +147,8 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void putLecturesBlock_repository()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence", "Course with absence", new CourseConfigVO());
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(author);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		dbInstance.commit();
 
@@ -212,7 +214,8 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void putLecturesBlock_autoclosed()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence", "Course with absence", new CourseConfigVO());
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(author);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		dbInstance.commit();
 
@@ -261,7 +264,8 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void getLecturesBlockConfiguration()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(author);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
 		dbInstance.commit();
 		
@@ -282,8 +286,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void updateLecturesBlockConfiguration()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		dbInstance.commit();
 		
 		RestConnection conn = new RestConnection();
@@ -333,8 +336,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void getLectureBlock()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 
@@ -359,8 +361,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void deleteLectureBlock()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 
@@ -383,8 +384,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void addRepositoryEntryDefaultGroupToLectureBlock()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 
@@ -414,8 +414,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	public void removeRepositoryEntryDefaultGroupToLectureBlock()
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		Group defGroup = repositoryService.getDefaultGroup(entry);
 		lectureService.save(block, Collections.singletonList(defGroup));
@@ -446,8 +445,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 	throws IOException, URISyntaxException {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
 		Identity teacher = JunitTestHelper.createAndPersistIdentityAsRndUser("teacher-1");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 		
@@ -475,8 +473,7 @@ public class LecturesBlocksTest extends OlatJerseyTestCase {
 		Identity author = JunitTestHelper.createAndPersistIdentityAsAuthor("lect-1");
 		Identity teacher1 = JunitTestHelper.createAndPersistIdentityAsRndUser("teacher-2");
 		Identity teacher2 = JunitTestHelper.createAndPersistIdentityAsRndUser("teacher-3");
-		ICourse course = CoursesWebService.createEmptyCourse(author, "Course with absence config", "Course with absence configuration", new CourseConfigVO());
-		RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
+		RepositoryEntry entry = JunitTestHelper.deployBasicCourse(author);
 		LectureBlock block = createLectureBlock(entry);
 		dbInstance.commit();
 		lectureService.addTeacher(block, teacher1);
diff --git a/src/test/java/org/olat/restapi/MyForumsTest.java b/src/test/java/org/olat/restapi/MyForumsTest.java
index 485727bdb60ea725e88284483ee0f129681aeca4..b0783289e9e64bce3e97eb2fafe29e100d3354e2 100644
--- a/src/test/java/org/olat/restapi/MyForumsTest.java
+++ b/src/test/java/org/olat/restapi/MyForumsTest.java
@@ -29,7 +29,6 @@ package org.olat.restapi;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
@@ -85,11 +84,8 @@ public class MyForumsTest extends OlatJerseyTestCase {
 	 */
 	@Test
 	public void myForums() throws IOException, URISyntaxException {
-		URL courseWithForumsUrl = MyForumsTest.class.getResource("myCourseWS.zip");
-		Assert.assertNotNull(courseWithForumsUrl);
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString().replace("_", "");
-		RepositoryEntry myCourseRe = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);	
+		URL courseUrl = MyForumsTest.class.getResource("myCourseWS.zip");
+		RepositoryEntry myCourseRe = JunitTestHelper.deployCourse(null, "My course", courseUrl);// 4);	
 		Assert.assertNotNull(myCourseRe);
 		ICourse myCourse = CourseFactory.loadCourse(myCourseRe);
 		
diff --git a/src/test/java/org/olat/restapi/NotificationsSubscribersTest.java b/src/test/java/org/olat/restapi/NotificationsSubscribersTest.java
index 21eba53307e36a784668b7692be9d1722607acb4..2df8721787b990cc1837689a1a4648256adeda3a 100644
--- a/src/test/java/org/olat/restapi/NotificationsSubscribersTest.java
+++ b/src/test/java/org/olat/restapi/NotificationsSubscribersTest.java
@@ -19,14 +19,12 @@
  */
 package org.olat.restapi;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.List;
-import java.util.UUID;
 
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriBuilder;
@@ -84,11 +82,8 @@ public class NotificationsSubscribersTest extends OlatJerseyTestCase {
 		Identity id2 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-sub-2");
 		
 		//deploy a course with forums
-		URL courseWithForumsUrl = MyForumsTest.class.getResource("myCourseWS.zip");
-		Assert.assertNotNull(courseWithForumsUrl);
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString().replace("-", "");
-		RepositoryEntry courseEntry = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);	
+		URL courseUrl = MyForumsTest.class.getResource("myCourseWS.zip");
+		RepositoryEntry courseEntry = JunitTestHelper.deployCourse(null, "My course", courseUrl);// 4);	
 		Assert.assertNotNull(courseEntry);
 		
 		//load the course and found the first forum
@@ -148,11 +143,8 @@ public class NotificationsSubscribersTest extends OlatJerseyTestCase {
 		Identity id3 = JunitTestHelper.createAndPersistIdentityAsRndUser("rest-sub-5");
 		
 		//deploy a course with forums
-		URL courseWithForumsUrl = MyForumsTest.class.getResource("myCourseWS.zip");
-		Assert.assertNotNull(courseWithForumsUrl);
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		String softKey = UUID.randomUUID().toString().replace("-", "");
-		RepositoryEntry courseEntry = CourseFactory.deployCourseFromZIP(courseWithForums, softKey, 4);	
+		URL courseUrl = MyForumsTest.class.getResource("myCourseWS.zip");
+		RepositoryEntry courseEntry = JunitTestHelper.deployCourse(null, "My course", courseUrl);	
 		Assert.assertNotNull(courseEntry);
 		
 		//load the course and found the first forum
diff --git a/src/test/java/org/olat/restapi/NotificationsTest.java b/src/test/java/org/olat/restapi/NotificationsTest.java
index 08c200bb0249e36084b8786dba9f952f32700460..4c9ae94d17b3526fb6b71d72ac425424838126fb 100644
--- a/src/test/java/org/olat/restapi/NotificationsTest.java
+++ b/src/test/java/org/olat/restapi/NotificationsTest.java
@@ -85,7 +85,6 @@ import org.olat.modules.fo.Message;
 import org.olat.modules.fo.manager.ForumManager;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.test.JunitTestHelper;
 import org.olat.test.OlatJerseyTestCase;
 import org.olat.user.notification.UsersSubscriptionManager;
@@ -368,7 +367,8 @@ public class NotificationsTest extends OlatJerseyTestCase {
 	public void testGetCourseForumNotifications() throws IOException, URISyntaxException {
 		//create a course with a forum
 		Identity id = JunitTestHelper.createAndPersistIdentityAsAuthor("rest-not-6-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(id, "Course forum not", "Course forum with notification", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		//create the forum
 		CourseNodeConfiguration newNodeConfig = CourseNodeFactory.getInstance().getCourseNodeConfiguration("fo");
@@ -417,7 +417,8 @@ public class NotificationsTest extends OlatJerseyTestCase {
 	public void testGetCourseFolderNotifications() throws IOException, URISyntaxException {
 		//create a course with a forum
 		Identity id = JunitTestHelper.createAndPersistIdentityAsAuthor("rest-not-7-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(id, "Course folder not", "Course with folder and notification", null);
+		RepositoryEntry courseEntry = JunitTestHelper.deployBasicCourse(id);
+		ICourse course = CourseFactory.loadCourse(courseEntry);
 		dbInstance.intermediateCommit();
 		//create the folder
 		CourseNodeConfiguration newNodeConfig = CourseNodeFactory.getInstance().getCourseNodeConfiguration("bc");
diff --git a/src/test/java/org/olat/restapi/RepositoryEntriesTest.java b/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
index 71544a342ea8440898838ecdc6f9d098ff753283..0151c07bccc0ad70836c2ebe31c5d2a4615f5ccf 100644
--- a/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
+++ b/src/test/java/org/olat/restapi/RepositoryEntriesTest.java
@@ -60,9 +60,11 @@ import org.junit.Test;
 import org.olat.admin.securitygroup.gui.IdentitiesAddEvent;
 import org.olat.basesecurity.BaseSecurity;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.commons.persistence.DBFactory;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
@@ -84,7 +86,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * 
- * @author srosse, stephane.rosse@frentix.com, http:
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
  */
 public class RepositoryEntriesTest extends OlatJerseyTestCase {
 	
@@ -98,6 +100,8 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 	@Autowired
 	private RepositoryService repositoryService;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private DB dbInstance;
 
 	@Test
@@ -847,7 +851,8 @@ public class RepositoryEntriesTest extends OlatJerseyTestCase {
 		DBFactory.getInstance().saveObject(r);
 		DBFactory.getInstance().intermediateCommit();
 
-		RepositoryEntry d = repositoryService.create(displayName, "-", displayName, "Repo entry", r);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry d = repositoryService.create(null, displayName, "-", displayName, "Repo entry", r, 0, defOrganisation);
 		DBFactory.getInstance().commit();
 		return d;
 	}
diff --git a/src/test/java/org/olat/restapi/RepositoryEntryResourceTest.java b/src/test/java/org/olat/restapi/RepositoryEntryResourceTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..af5a9ff0ae996e769892175b7c2d7f042c107666
--- /dev/null
+++ b/src/test/java/org/olat/restapi/RepositoryEntryResourceTest.java
@@ -0,0 +1,86 @@
+package org.olat.restapi;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Locale;
+
+import javax.ws.rs.core.UriBuilder;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.util.EntityUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.olat.basesecurity.OrganisationService;
+import org.olat.core.commons.persistence.DB;
+import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
+import org.olat.fileresource.types.ImsQTI21Resource;
+import org.olat.repository.RepositoryEntry;
+import org.olat.repository.handlers.RepositoryHandler;
+import org.olat.repository.handlers.RepositoryHandlerFactory;
+import org.olat.test.JunitTestHelper;
+import org.olat.test.OlatJerseyTestCase;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 
+ * Initial date: 2 mai 2018<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class RepositoryEntryResourceTest extends OlatJerseyTestCase {
+	
+	@Autowired
+	private DB dbInstance;
+	@Autowired
+	private OrganisationService organisationService;
+	
+	@Test
+	public void exportCourse()
+	throws IOException, URISyntaxException {
+		RestConnection conn = new RestConnection();
+		Assert.assertTrue(conn.login("administrator", "openolat"));
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("course-owner");
+		RepositoryEntry course = JunitTestHelper.deployBasicCourse(author);
+		dbInstance.closeSession();
+		
+		URI request = UriBuilder.fromUri(getContextURI()).path("repo").path("entries")
+				.path(course.getKey().toString()).path("file").build();
+		HttpGet method = conn.createGet(request, "application/zip", true);
+		HttpResponse response = conn.execute(method);
+
+		Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+		byte[] exportedFile = EntityUtils.toByteArray(response.getEntity());
+		Assert.assertTrue(exportedFile.length > 1000);	
+	}
+	
+	@Test
+	public void exportQTI21Test()
+	throws IOException, URISyntaxException {
+		//deploy QTI 2.1 test
+		Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("test-owner");
+		URL testUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_hotspot.zip");
+		File testFile = new File(testUrl.toURI());		
+		RepositoryHandler courseHandler = RepositoryHandlerFactory.getInstance()
+						.getRepositoryHandler(ImsQTI21Resource.TYPE_NAME);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry testEntry = courseHandler.importResource(author, null, "Test QTI 2.1", "", true, defOrganisation, Locale.ENGLISH, testFile, null);
+		dbInstance.closeSession();
+		
+		RestConnection conn = new RestConnection();
+		Assert.assertTrue(conn.login("administrator", "openolat"));
+		
+		URI request = UriBuilder.fromUri(getContextURI()).path("repo").path("entries")
+				.path(testEntry.getKey().toString()).path("file").build();
+		HttpGet method = conn.createGet(request, "application/zip", true);
+		HttpResponse response = conn.execute(method);
+
+		Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+		byte[] exportedFile = EntityUtils.toByteArray(response.getEntity());
+		Assert.assertTrue(exportedFile.length > 1000);
+	}
+}
diff --git a/src/test/java/org/olat/restapi/SharedFolderTest.java b/src/test/java/org/olat/restapi/SharedFolderTest.java
index 2b23a33fafd7fffea9017cf8e1bae8c9bf0009e0..0eae05443d6b0226b4fe0677c1ab6c7c12d90d00 100644
--- a/src/test/java/org/olat/restapi/SharedFolderTest.java
+++ b/src/test/java/org/olat/restapi/SharedFolderTest.java
@@ -40,8 +40,10 @@ import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
 import org.olat.basesecurity.GroupRoles;
+import org.olat.basesecurity.OrganisationService;
 import org.olat.core.commons.persistence.DB;
 import org.olat.core.id.Identity;
+import org.olat.core.id.Organisation;
 import org.olat.core.util.FileUtils;
 import org.olat.core.util.vfs.VFSContainer;
 import org.olat.core.util.vfs.VFSItem;
@@ -67,6 +69,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 	@Autowired
 	private DB dbInstance;
 	@Autowired
+	private OrganisationService organisationService;
+	@Autowired
 	private RepositoryEntryRelationDAO repositoryEntryRelationDao;
 	
 	/**
@@ -81,7 +85,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
 		
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-owner-");
-		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 1", "A shared folder", null, Locale.ENGLISH);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 1", "A shared folder", null, defOrganisation, Locale.ENGLISH);
 		VFSContainer container = SharedFolderManager.getInstance().getNamedSharedFolder(sharedFolder, true);
 		copyFileInResourceFolder(container, "portrait.jpg", "1_");
 		
@@ -108,7 +113,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 	@Test
 	public void putDirectories_owner() throws IOException, URISyntaxException {
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-owner-");
-		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "A shared folder", null, Locale.ENGLISH);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "A shared folder", null, defOrganisation, Locale.ENGLISH);
 		VFSContainer container = SharedFolderManager.getInstance().getNamedSharedFolder(sharedFolder, true);
 		copyFileInResourceFolder(container, "portrait.jpg", "2_");
 		
@@ -142,7 +148,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 		Assert.assertTrue(conn.login("administrator", "openolat"));
 		
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-owner-");
-		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "Shared files", null, Locale.ENGLISH);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "Shared files", null, defOrganisation, Locale.ENGLISH);
 		VFSContainer container = SharedFolderManager.getInstance().getNamedSharedFolder(sharedFolder, true);
 		copyFileInResourceFolder(container, "portrait.jpg", "2_");
 		
@@ -171,7 +178,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 	public void putFiles_owner() throws IOException, URISyntaxException {
 		//create a shared folder
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-owner-");
-		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "Shared files", null, Locale.ENGLISH);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "Shared files", null, defOrganisation, Locale.ENGLISH);
 		VFSContainer container = SharedFolderManager.getInstance().getNamedSharedFolder(sharedFolder, true);
 		copyFileInResourceFolder(container, "certificate.pdf", "2_");
 		
@@ -208,7 +216,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 		//a shared folder with a participant
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-owner-");
 		Identity participant = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-part-");
-		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "Shared files", null, Locale.ENGLISH);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 2", "Shared files", null, defOrganisation, Locale.ENGLISH);
 		VFSContainer container = SharedFolderManager.getInstance().getNamedSharedFolder(sharedFolder, true);
 		copyFileInResourceFolder(container, "portrait.jpg", "3_");
 		repositoryEntryRelationDao.addRole(participant, sharedFolder, GroupRoles.participant.name());
@@ -254,7 +263,8 @@ public class SharedFolderTest extends OlatJerseyTestCase {
 		//a shared folder with a participant
 		Identity owner = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-owner-");
 		Identity participant = JunitTestHelper.createAndPersistIdentityAsRndUser("shared-part-");
-		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 5", "Shared files", null, Locale.ENGLISH);
+		Organisation defOrganisation = organisationService.getDefaultOrganisation();
+		RepositoryEntry sharedFolder = new SharedFolderHandler().createResource(owner, "Shared 5", "Shared files", null, defOrganisation, Locale.ENGLISH);
 		VFSContainer container = SharedFolderManager.getInstance().getNamedSharedFolder(sharedFolder, true);
 		copyFileInResourceFolder(container, "portrait.jpg", "5_");
 		repositoryEntryRelationDao.addRole(participant, sharedFolder, GroupRoles.participant.name());
diff --git a/src/test/java/org/olat/restapi/UserCoursesTest.java b/src/test/java/org/olat/restapi/UserCoursesTest.java
index 78728d89a928f9ac9f198e1f1daf8f786a26fd3f..a785eccf2106e2ed19a7df615fc8858339335897 100644
--- a/src/test/java/org/olat/restapi/UserCoursesTest.java
+++ b/src/test/java/org/olat/restapi/UserCoursesTest.java
@@ -41,11 +41,9 @@ import org.olat.core.commons.services.mark.MarkManager;
 import org.olat.core.id.Identity;
 import org.olat.core.logging.OLog;
 import org.olat.core.logging.Tracing;
-import org.olat.course.ICourse;
 import org.olat.repository.RepositoryEntry;
 import org.olat.repository.RepositoryManager;
 import org.olat.repository.RepositoryService;
-import org.olat.restapi.repository.course.CoursesWebService;
 import org.olat.restapi.support.vo.CourseVO;
 import org.olat.restapi.support.vo.CourseVOes;
 import org.olat.test.JunitTestHelper;
@@ -73,9 +71,9 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 	@Test
 	public void testMyCourses() throws IOException, URISyntaxException {
 		//prepare a course with a participant
-		Identity user = JunitTestHelper.createAndPersistIdentityAsUser("My-course-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(user, "My course 1", "My course", null);
-		RepositoryEntry courseRe = repositoryManager.lookupRepositoryEntry(course, true);
+		Identity user = JunitTestHelper.createAndPersistIdentityAsRndUser("My-course-");
+		
+		RepositoryEntry courseRe = JunitTestHelper.deployBasicCourse(user);
 		repositoryManager.setAccess(courseRe, RepositoryEntry.ACC_OWNERS, true);
 		repositoryService.addRole(user, courseRe, GroupRoles.participant.name());
 		dbInstance.commitAndCloseSession();
@@ -112,9 +110,8 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 	@Test
 	public void testTeachedCourses() throws IOException, URISyntaxException {
 		//prepare a course with a tutor
-		Identity teacher = JunitTestHelper.createAndPersistIdentityAsUser("Course-teacher-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(teacher, "A course to teach", "A course to teach", null);
-		RepositoryEntry courseRe = repositoryManager.lookupRepositoryEntry(course, true);
+		Identity teacher = JunitTestHelper.createAndPersistIdentityAsRndUser("Course-teacher-");
+		RepositoryEntry courseRe = JunitTestHelper.deployBasicCourse(teacher);
 		repositoryManager.setAccess(courseRe, RepositoryEntry.ACC_OWNERS, true);
 		repositoryService.addRole(teacher, courseRe, GroupRoles.coach.name());
 		dbInstance.commitAndCloseSession();
@@ -152,8 +149,7 @@ public class UserCoursesTest extends OlatJerseyTestCase {
 	public void testFavoritCourses() throws IOException, URISyntaxException {
 		//prepare a course with a tutor
 		Identity me = JunitTestHelper.createAndPersistIdentityAsUser("Course-teacher-" + UUID.randomUUID().toString());
-		ICourse course = CoursesWebService.createEmptyCourse(me, "A course to teach", "A course to teach", null);
-		RepositoryEntry courseRe = repositoryManager.lookupRepositoryEntry(course, true);
+		RepositoryEntry courseRe = JunitTestHelper.deployBasicCourse(me);
 		repositoryManager.setAccess(courseRe, RepositoryEntry.ACC_USERS, false);
 		markManager.setMark(courseRe, me, null, "[RepositoryEntry:" + courseRe.getKey() + "]");	
 		dbInstance.commitAndCloseSession();
diff --git a/src/test/java/org/olat/restapi/UserFoldersTest.java b/src/test/java/org/olat/restapi/UserFoldersTest.java
index a7ce1b69516ca0517b65b672e13c0c7058dbea59..8c6af5ef64e55947213367a7ef8e12ce81b316f0 100644
--- a/src/test/java/org/olat/restapi/UserFoldersTest.java
+++ b/src/test/java/org/olat/restapi/UserFoldersTest.java
@@ -29,7 +29,6 @@ package org.olat.restapi;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
@@ -85,10 +84,8 @@ public class UserFoldersTest extends OlatJerseyTestCase {
 		
 		if(setup) return;
 		
-		URL courseWithForumsUrl = UserFoldersTest.class.getResource("myCourseWS.zip");
-		Assert.assertNotNull(courseWithForumsUrl);
-		File courseWithForums = new File(courseWithForumsUrl.toURI());
-		myCourseRe = CourseFactory.deployCourseFromZIP(courseWithForums, UUID.randomUUID().toString(), 4);
+		URL courseUrl = UserFoldersTest.class.getResource("myCourseWS.zip");
+		myCourseRe = JunitTestHelper.deployCourse(null, "My course", courseUrl);// 4);
 		Assert.assertNotNull(myCourseRe);
 		myCourse = CourseFactory.loadCourse(myCourseRe);
 
diff --git a/src/test/java/org/olat/restapi/UserMgmtTest.java b/src/test/java/org/olat/restapi/UserMgmtTest.java
index 7d52cd2f0da0bc03b8d7103e67ffc9263c64ae6f..f373ce0d31a457b8a686427078a94caaf0ac11d2 100644
--- a/src/test/java/org/olat/restapi/UserMgmtTest.java
+++ b/src/test/java/org/olat/restapi/UserMgmtTest.java
@@ -1018,7 +1018,7 @@ public class UserMgmtTest extends OlatJerseyTestCase {
 		Assert.assertTrue(reloadRoles.isAuthor());
 		Assert.assertFalse(reloadRoles.isGroupManager());
 		Assert.assertFalse(reloadRoles.isGuestOnly());
-		Assert.assertFalse(reloadRoles.isInstitutionalResourceManager());
+		Assert.assertFalse(reloadRoles.isLearnResourceManager());
 		Assert.assertFalse(reloadRoles.isInvitee());
 		Assert.assertFalse(reloadRoles.isOLATAdmin());
 		Assert.assertFalse(reloadRoles.isPoolAdmin());
diff --git a/src/test/java/org/olat/selenium/PortfolioV2Test.java b/src/test/java/org/olat/selenium/PortfolioV2Test.java
index 157035cd967da422f8d1516643e0af6f50874567..13e9e17a4bca8bbbab46e9d2ad554de632c424b5 100644
--- a/src/test/java/org/olat/selenium/PortfolioV2Test.java
+++ b/src/test/java/org/olat/selenium/PortfolioV2Test.java
@@ -989,7 +989,7 @@ public class PortfolioV2Test extends Deployments {
 		portfolio
 			.clickToolbarBack()
 			.openDeletedBinders()
-			.switchTableView()
+			.switchDeletedBindersTableView()
 			.restoreBinder(binderTitle);
 		
 		// move it to the trash again
diff --git a/src/test/java/org/olat/selenium/page/portfolio/BinderPage.java b/src/test/java/org/olat/selenium/page/portfolio/BinderPage.java
index d097767a5dd22d0b1defde5bdef6967f1fde18df..14782b5cb62ed642f60ddc364ef8c2e2637ab72c 100644
--- a/src/test/java/org/olat/selenium/page/portfolio/BinderPage.java
+++ b/src/test/java/org/olat/selenium/page/portfolio/BinderPage.java
@@ -118,6 +118,7 @@ public class BinderPage {
 		OOGraphene.waitElement(deleteBy, 5, browser);
 		browser.findElement(deleteBy).click();
 		OOGraphene.waitBusy(browser);
+		OOGraphene.scrollTop(browser);
 		
 		//confirm check box
 		By confirmBoxBy = By.cssSelector("div.modal-body input[type='checkbox']");
@@ -126,6 +127,7 @@ public class BinderPage {
 		
 		By deleteButtonBy = By.cssSelector("div.modal-body div.o_button_group button.btn.btn-primary");
 		browser.findElement(deleteButtonBy).click();
+		OOGraphene.waitModalDialogDisappears(browser);
 		OOGraphene.waitAndCloseBlueMessageWindow(browser);
 		return new BindersPage(browser);
 	}
diff --git a/src/test/java/org/olat/selenium/page/portfolio/BindersPage.java b/src/test/java/org/olat/selenium/page/portfolio/BindersPage.java
index 826382b8b0babb14f9c210391afc129c43c0d942..78e1b17727ddffccae1f22d3a4bd5b25e3f67f1a 100644
--- a/src/test/java/org/olat/selenium/page/portfolio/BindersPage.java
+++ b/src/test/java/org/olat/selenium/page/portfolio/BindersPage.java
@@ -70,13 +70,13 @@ public class BindersPage {
 		return new BinderPage(browser);
 	}
 	
-	public BindersPage switchTableView() {
-		By tableViewBy = By.xpath("//a[i[contains(@class,'o_icon o_icon_table o_icon-lg')]]");
+	public BindersPage switchDeletedBindersTableView() {
+		By tableViewBy = By.xpath("//div[contains(@class,'o_table_tools')]/div/a[contains(@class,'o_sel_table')]");
 		browser.findElement(tableViewBy).click();
 		OOGraphene.waitBusy(browser);
 		
-		By classicViewBy = By.cssSelector(".o_rendertype_classic");
-		OOGraphene.waitElement(classicViewBy, 5, browser);
+		By classicViewBy = By.cssSelector(".o_portfolio_deleted_listing.o_rendertype_classic");
+		OOGraphene.waitElement(classicViewBy, browser);
 		return this;
 	}
 	
diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java
index 2b8c524dfe76033f4d6e3208c89380697d496d7b..3a9ff3fb21d86c781555939f17e0ad366cb9a8ad 100644
--- a/src/test/java/org/olat/test/AllTestsJunit4.java
+++ b/src/test/java/org/olat/test/AllTestsJunit4.java
@@ -333,6 +333,7 @@ import org.junit.runners.Suite;
 	org.olat.restapi.NotificationsSubscribersTest.class,
 	org.olat.restapi.RepositoryEntryLifecycleTest.class,
 	org.olat.restapi.RepositoryEntriesTest.class,
+	org.olat.restapi.RepositoryEntryResourceTest.class,
 	org.olat.restapi.RestApiLoginFilterTest.class,
 	org.olat.restapi.UserAuthenticationMgmtTest.class,
 	org.olat.restapi.UserFoldersTest.class,
diff --git a/src/test/java/org/olat/test/JunitTestHelper.java b/src/test/java/org/olat/test/JunitTestHelper.java
index 68a7d8e8c7dcfad8344745f85a18864a16ca2aad..fa2717fda3272f1a372336e1229c4238b9432869 100644
--- a/src/test/java/org/olat/test/JunitTestHelper.java
+++ b/src/test/java/org/olat/test/JunitTestHelper.java
@@ -29,6 +29,7 @@
 package org.olat.test;
 
 import java.io.File;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Locale;
 import java.util.Random;
@@ -41,6 +42,7 @@ import org.olat.basesecurity.OrganisationService;
 import org.olat.core.CoreSpringFactory;
 import org.olat.core.id.Identity;
 import org.olat.core.id.OLATResourceable;
+import org.olat.core.id.Organisation;
 import org.olat.core.id.Roles;
 import org.olat.core.id.User;
 import org.olat.core.logging.OLog;
@@ -52,6 +54,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.RepositoryManager;
 import org.olat.repository.RepositoryService;
 import org.olat.repository.handlers.RepositoryHandler;
 import org.olat.repository.handlers.RepositoryHandlerFactory;
@@ -193,7 +196,9 @@ public class JunitTestHelper {
 	
 	public static final RepositoryEntry createAndPersistRepositoryEntry(String initialAuthor, OLATResource r, boolean membersOnly) {
 		RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
-		RepositoryEntry re = repositoryService.create(initialAuthor, "Lernen mit OLAT", r.getResourceableTypeName(), null, r);
+		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);
@@ -209,20 +214,10 @@ public class JunitTestHelper {
 	 * @return the created RepositoryEntry
 	 */
 	public static RepositoryEntry deployDemoCourse(Identity initialAuthor) {		
-		String displayname = "Demo-Kurs-7.1";
-		String description = "";
-
 		RepositoryEntry re = null;
 		try {
 			URL courseUrl = JunitTestHelper.class.getResource("file_resources/Demo-Kurs-7.1.zip");
-			File courseFile = new File(courseUrl.toURI());
-			
-			RepositoryHandler courseHandler = RepositoryHandlerFactory.getInstance()
-					.getRepositoryHandler(CourseModule.getCourseTypeName());
-			re = courseHandler.importResource(initialAuthor, null, displayname, description, true, Locale.ENGLISH, courseFile, null);
-			
-			ICourse course = CourseFactory.loadCourse(re);
-			CourseFactory.publishCourse(course, RepositoryEntry.ACC_USERS, false,  initialAuthor, Locale.ENGLISH);
+			re = deployCourse(initialAuthor, "Demo-Kurs-7.1", RepositoryEntry.ACC_USERS, courseUrl);
 		} catch (Exception e) {
 			log.error("", e);
 		}
@@ -230,50 +225,120 @@ public class JunitTestHelper {
 	}
 	
 	/**
-	 * Deploy a course with only a single page.
-	 * @param initialAuthor
-	 * @return
+	 * Deploy a course with only a single page. Title is randomized.
+	 * 
+	 * @param initialAuthor The author
+	 * @return The repository entry of the course
 	 */
-	public static RepositoryEntry deployBasicCourse(Identity initialAuthor) {		
+	public static RepositoryEntry deployBasicCourse(Identity initialAuthor) {
 		String displayname = "Basic course (" + CodeHelper.getForeverUniqueID() + ")";
-		String description = "A course with only a single page";
+		return deployBasicCourse(initialAuthor, displayname, RepositoryEntry.ACC_USERS);
+	}
+	
+	/**
+	 * Deploy a course with only a single page. Title is randomized.
+	 * 
+	 * @param initialAuthor The author
+	 * @param access The access
+	 * @return The repository entry of the course
+	 */
+	public static RepositoryEntry deployBasicCourse(Identity initialAuthor, int access) {
+		String displayname = "Basic course (" + CodeHelper.getForeverUniqueID() + ")";
+		return deployBasicCourse(initialAuthor, displayname, access);
+	}
 
-		RepositoryEntry re = null;
+	/**
+	 * Deploy a course with only a single page.
+	 * 
+	 * @param initialAuthor The author
+	 * @param displayname The title of the course
+	 * @param access The access
+	 * @return The repository entry of the course
+	 */
+	public static RepositoryEntry deployBasicCourse(Identity initialAuthor, String displayname, int access) {
 		try {
 			URL courseUrl = JunitTestHelper.class.getResource("file_resources/Basic_course.zip");
-			File courseFile = new File(courseUrl.toURI());
-			
-			RepositoryHandler courseHandler = RepositoryHandlerFactory.getInstance()
-					.getRepositoryHandler(CourseModule.getCourseTypeName());
-			re = courseHandler.importResource(initialAuthor, null, displayname, description, true, Locale.ENGLISH, courseFile, null);
-			
-			ICourse course = CourseFactory.loadCourse(re);
-			CourseFactory.publishCourse(course, RepositoryEntry.ACC_USERS, false,  initialAuthor, Locale.ENGLISH);
+			return deployCourse(initialAuthor, displayname, access, courseUrl);
 		} catch (Exception e) {
 			log.error("", e);
+			return null;
+		}
+	}
+	
+	public static RepositoryEntry deployEmptyCourse(Identity initialAuthor, String displayname, int access) {
+		try {
+			URL courseUrl = JunitTestHelper.class.getResource("file_resources/Empty_course.zip");
+			return deployCourse(initialAuthor, displayname, access, courseUrl);
+		} catch (Exception e) {
+			log.error("", e);
+			return null;
 		}
-		return re;
 	}
 	
 	/**
-	 * Deploy a course with only a single page.
-	 * @param initialAuthor
-	 * @return
+	 * The course will be accessible to all registrated users.
+	 * 
+	 * @param initialAuthor The author
+	 * @param displayname the name of the course
+	 * @param courseUrl The file to import
+	 * @return The repository entry of the course
 	 */
-	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, File courseFile) {		
-		String description = "A course";
-
-		RepositoryEntry re = null;
+	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, URL courseUrl) {
+		return deployCourse(initialAuthor, displayname, RepositoryEntry.ACC_USERS, courseUrl);
+	}
+	
+	/**
+	 * 
+	 * @param initialAuthor The author
+	 * @param displayname The name of the course
+	 * @param access The access
+	 * @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) {
+		try {
+			File courseFile = new File(courseUrl.toURI());
+			return deployCourse(initialAuthor, displayname, courseFile, access);
+		} catch (URISyntaxException e) {
+			log.error("", e);
+			return null;
+		}
+	}
+	
+	/**
+	 * The course will be accessible to all registrated users.
+	 * 
+	 * @param initialAuthor The author (not mandatory)
+	 * @param displayname The name of the course
+	 * @param courseFile The file to import
+	 * @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) ;
+	}
+	
+	/**
+	 * 
+	 * @param initialAuthor The author (not mandatory)
+	 * @param displayname The name of the course
+	 * @param courseFile The file to import
+	 * @param access The access
+	 * @return The repository entry of the course
+	 */
+	public static RepositoryEntry deployCourse(Identity initialAuthor, String displayname, File courseFile, int access) {		
 		try {
 			RepositoryHandler courseHandler = RepositoryHandlerFactory.getInstance()
 					.getRepositoryHandler(CourseModule.getCourseTypeName());
-			re = courseHandler.importResource(initialAuthor, null, displayname, description, true, Locale.ENGLISH, courseFile, null);
+			OrganisationService organisationService = CoreSpringFactory.getImpl(OrganisationService.class);
+			Organisation defOrganisation = organisationService.getDefaultOrganisation();
+			RepositoryEntry re = courseHandler.importResource(initialAuthor, null, displayname, "A course", true, defOrganisation, Locale.ENGLISH, courseFile, null);
 			
 			ICourse course = CourseFactory.loadCourse(re);
-			CourseFactory.publishCourse(course, RepositoryEntry.ACC_USERS, false,  initialAuthor, Locale.ENGLISH);
+			CourseFactory.publishCourse(course, access, false,  initialAuthor, Locale.ENGLISH);
+			return  CoreSpringFactory.getImpl(RepositoryManager.class).lookupRepositoryEntry(re.getKey());
 		} catch (Exception e) {
 			log.error("", e);
+			return null;
 		}
-		return re;
 	}
 }
diff --git a/src/test/java/org/olat/test/OlatTestCase.java b/src/test/java/org/olat/test/OlatTestCase.java
index 2e1d6f9c2c155737ab12386a305755a4b3e51cea..684430469f65986236787f71749182c1ec880663 100644
--- a/src/test/java/org/olat/test/OlatTestCase.java
+++ b/src/test/java/org/olat/test/OlatTestCase.java
@@ -66,7 +66,7 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests {
 	private static boolean oracleConfigured = false;
 	private static boolean started = false;
 	
-	 @Rule public TestName name = new TestName();
+	 @Rule public TestName currentTestName = new TestName();
 	
 	/**
 	 * If you like to disable a test method for some time just add the
@@ -85,7 +85,7 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests {
 	
 	@Before
 	public void printBanner(){
-		log.info("Method run: " + name.getMethodName() + "(" + this.getClass().getCanonicalName() + ")");
+		log.info("Method run: " + currentTestName.getMethodName() + "(" + this.getClass().getCanonicalName() + ")");
 		
 		if(started) {
 			return;
@@ -108,7 +108,7 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests {
 	
 	@After
 	public void closeConnectionAfter() {
-		log.info("Method test finished: " + name.getMethodName() + "(" + this.getClass().getCanonicalName() + ")");
+		log.info("Method test finished: " + currentTestName.getMethodName() + "(" + this.getClass().getCanonicalName() + ")");
 		try {
 			DBFactory.getInstance().commitAndCloseSession();
 		} catch (Exception e) {
diff --git a/src/test/java/org/olat/test/file_resources/Basic_course.zip b/src/test/java/org/olat/test/file_resources/Basic_course.zip
index 6e887df4e24022d15eb5f85c75d83544892a963e..e9ba547f431876b4e6550e94406562f84c188dcf 100644
Binary files a/src/test/java/org/olat/test/file_resources/Basic_course.zip and b/src/test/java/org/olat/test/file_resources/Basic_course.zip differ
diff --git a/src/test/java/org/olat/test/file_resources/Empty_course.zip b/src/test/java/org/olat/test/file_resources/Empty_course.zip
new file mode 100644
index 0000000000000000000000000000000000000000..533373d84928dad52d38fe9ade2374a88f9a54eb
Binary files /dev/null and b/src/test/java/org/olat/test/file_resources/Empty_course.zip differ