diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f5a9a88d619fd7b31384561357aba060035ebd3e..1d7726c11ae28f147df5493112b9a302c6ce1fd5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,20 +9,11 @@ stages:
 # Include templates
 
 include:
-  - template: Security/License-Scanning.gitlab-ci.yml
   - template: Dependency-Scanning.gitlab-ci.yml
   - template: Security/SAST.gitlab-ci.yml
 
 variables:
   SAST_EXCLUDED_ANALYZERS: 'brakeman, bundler-audit, semgrep'
-
-license_scanning:
-  variables:
-    USE_FREEDESKTOP_PLACEHOLDER: "true"
-  before_script:
-    - apt-get update || true
-    - apt-get install --no-install-recommends -y dpkg-dev file g++ gcc imagemagick libbz2-dev libc6-dev libdb-dev libevent-dev libffi-dev libgdbm-dev libglib2.0-dev libgmp-dev libjpeg-dev libkrb5-dev liblzma-dev libmagickcore-dev libmagickwand-dev libmaxminddb-dev libpng-dev libpq-dev libreadline-dev libtool libwebp-dev libxml2-dev libxslt-dev libyaml-dev patch xz-utils zlib1g-dev libz-dev libiconv-hook1 libgconf-2-4 build-essential libsqlite3-dev libmariadb-dev libglpk-dev nodejs
-
 # -------------------------------------------------------------------------------------------------
 # Build base docker image
 
@@ -75,30 +66,34 @@ build-branch:
   services:
     - name: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
       alias: elasticsearch
-      command: [ "bin/elasticsearch", "-Ediscovery.type=single-node" ]
+      command:
+        - /bin/bash
+        - -c
+        - echo -Xms256m >> /usr/share/elasticsearch/config/jvm.options && echo -Xmx512m >> /usr/share/elasticsearch/config/jvm.options && /usr/local/bin/docker-entrypoint.sh elasticsearch -Ediscovery.type=single-node
+    - name: mariadb:10
+      alias: mariadb
   variables:
-    DB_TYPE: sqlite
     RAILS_ENV: test
     ELASTICSEARCH_URL: "http://elasticsearch:9200"
     COVERAGE: "true"
+    MYSQL_DATABASE: projectforum
+    MYSQL_ROOT_PASSWORD: root
   before_script:
-    - bundle config --local path /projectforum/vendor
+    - cp config/database.ci.yml config/database.yml
     - mkdir /pf_tests
     - cp -r . /pf_tests
   script:
     - cd /pf_tests
     # Check elasticsearch is running
-    - sleep 10
-    - 'for i in $(seq 1 10); do curl "$ELASTICSEARCH_URL/_cat/health" && s=0 && break || s=$? && sleep 5; done; (exit $s)'
+    - 'for i in $(seq 1 12); do curl "$ELASTICSEARCH_URL/_cat/health" && s=0 && break || s=$? && sleep 5; done; (exit $s)'
     # Setup environment
     - bin/rails db:environment:set
-    - DB_TYPE=sqlite bundle exec rake db:schema:load
-    - DB_TYPE=sqlite bundle exec rake db:seed
+    - bundle exec rails db:schema:load db:seed
     # Run the tests
-    - bundle exec rake test
+    - bundle exec rails test
   after_script:
     - cd /pf_tests
-    - bundle exec rake test:combine
+    - bundle exec rails test:combine
     # Move the output back into the builds folder
     - cp test/reports -r --parents $CI_PROJECT_DIR
     - cp coverage -r --parents $CI_PROJECT_DIR
@@ -117,31 +112,35 @@ build-branch:
   services:
     - name: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
       alias: elasticsearch
-      command: [ "bin/elasticsearch", "-Ediscovery.type=single-node" ]
+      command:
+        - /bin/bash
+        - -c
+        - echo -Xms256m >> /usr/share/elasticsearch/config/jvm.options && echo -Xmx512m >> /usr/share/elasticsearch/config/jvm.options && /usr/local/bin/docker-entrypoint.sh elasticsearch -Ediscovery.type=single-node
+    - name: mariadb:10
+      alias: mariadb
   variables:
-    DB_TYPE: sqlite
     RAILS_ENV: test
     ELASTICSEARCH_URL: "http://elasticsearch:9200"
     CHROME_HEADLESS: "true"
     COVERAGE: "true"
+    MYSQL_DATABASE: projectforum
+    MYSQL_ROOT_PASSWORD: root
   before_script:
-    - bundle config --local path /projectforum/vendor
+    - cp config/database.ci.yml config/database.yml
     - mkdir /pf_tests
     - cp -r . /pf_tests
   script:
     - cd /pf_tests
     # Check elasticsearch is running
-    - sleep 10
-    - 'for i in $(seq 1 10); do curl "$ELASTICSEARCH_URL/_cat/health" && s=0 && break || s=$? && sleep 5; done; (exit $s)'
+    - 'for i in $(seq 1 12); do curl "$ELASTICSEARCH_URL/_cat/health" && s=0 && break || s=$? && sleep 5; done; (exit $s)'
     # Setup environment
     - bin/rails db:environment:set
-    - DB_TYPE=sqlite bundle exec rake db:schema:load
-    - DB_TYPE=sqlite bundle exec rake db:seed
+    - bundle exec rails db:schema:load db:seed
     # Run the system tests
-    - bundle exec rake test:system
+    - bundle exec rails test:system
   after_script:
     - cd /pf_tests
-    - bundle exec rake test:combine
+    - bundle exec rails test:combine
     # Move the output back into the builds folder
     - cp test/reports -r --parents $CI_PROJECT_DIR
     - cp coverage -r --parents $CI_PROJECT_DIR
@@ -160,8 +159,6 @@ build-branch:
 'Lint (rubocop)':
   stage: test
   image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-  before_script:
-    - bundle config --local path /projectforum/vendor
   script:
     - bundle exec rubocop --format progress --format junit --out rubocop.xml --display-only-failed
   artifacts:
@@ -177,8 +174,6 @@ build-branch:
   variables:
     # brakeman complains when default (POSIX in OS, en_US.ASCII in ruby) is used
     LANG: C.UTF-8
-  before_script:
-    - bundle config --local path /projectforum/vendor
   script:
     - bundle exec brakeman --no-progress
 
@@ -195,8 +190,6 @@ build-branch:
     - if: $CI_COMMIT_BRANCH != "master"
       allow_failure: true
     - when: on_success
-  before_script:
-    - bundle config --local path /projectforum/vendor
   script:
     - bundle exec bundle-audit update
     - bundle exec bundle-audit -v
@@ -207,21 +200,22 @@ build-branch:
   services:
     - name: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
       alias: elasticsearch
-      command: [ "bin/elasticsearch", "-Ediscovery.type=single-node" ]
+      command:
+        - /bin/bash
+        - -c
+        - echo -Xms256m >> /usr/share/elasticsearch/config/jvm.options && echo -Xmx512m >> /usr/share/elasticsearch/config/jvm.options && /usr/local/bin/docker-entrypoint.sh elasticsearch -Ediscovery.type=single-node
   variables:
     DB_TYPE: sqlite
     RAILS_ENV: development
     ELASTICSEARCH_URL: "http://elasticsearch:9200"
-  before_script:
-    - bundle config --local path /projectforum/vendor
   script:
     # Check elasticsearch is running
-    - sleep 10
-    - 'for i in $(seq 1 10); do curl "$ELASTICSEARCH_URL/_cat/health" && s=0 && break || s=$? && sleep 5; done; (exit $s)'
+    - sleep 5
+    - 'for i in $(seq 1 12); do curl "$ELASTICSEARCH_URL/_cat/health" && s=0 && break || s=$? && sleep 5; done; (exit $s)'
     # Check seeding
     - bin/rails db:environment:set
-    - DB_TYPE=sqlite bundle exec rake db:schema:load
-    - DB_TYPE=sqlite bundle exec rake db:seed
+    - DB_TYPE=sqlite bundle exec rails db:schema:load
+    - DB_TYPE=sqlite bundle exec rails db:seed
 
 # -------------------------------------------------------------------------------------------------
 # Reports
@@ -234,12 +228,11 @@ coverage-report:
     - System Test
   coverage: '/LOC\s\(\d+\.\d+%\)\scovered/'
   before_script:
-    - bundle config --local path /projectforum/vendor
     - mkdir /pf_tests
     - cp -r . /pf_tests
   script:
     - cd /pf_tests
-    - bundle exec rake coverage:combine
+    - bundle exec rails coverage:combine
   after_script:
     - cd /pf_tests
     - cp coverage -r --parents $CI_PROJECT_DIR
@@ -253,10 +246,8 @@ coverage-report:
 #  needs:
 #    - Test
 #    - System Test
-#  before_script:
-#    - bundle config --local path /projectforum/vendor
 #  script:
-#    - bundle exec rake test:combine
+#    - bundle exec rails test:combine
 #  artifacts:
 #    paths:
 #      - test/reports/junit.xml
@@ -280,7 +271,6 @@ deploy-staging:
     - mkdir -p ~/.ssh
     - ssh-keyscan eiptest.ewi.tudelft.nl >> ~/.ssh/known_hosts
     - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
-    - bundle config --local path /projectforum/vendor
   script:
     - BRANCH=development bundle exec cap staging deploy
   environment:
@@ -304,7 +294,6 @@ deploy-production:
     - mkdir -p ~/.ssh
     - ssh-keyscan projectforum.tudelft.nl >> ~/.ssh/known_hosts
     - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
-    - bundle config --local path /projectforum/vendor
   script:
     - BRANCH=master bundle exec cap production deploy
   environment:
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..e999a7866487455298ea78d5900afaefc7520ed7
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,661 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU Affero General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    Project Forum
+    Copyright (C) 2022  EIP
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published
+    by the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<https://www.gnu.org/licenses/>.
diff --git a/README.md b/README.md
index 972b33a44a17ec5fe15fe04fab565d0791b67e4f..54a49881507ec6d29fca2c2ca05a19c096e46929 100644
--- a/README.md
+++ b/README.md
@@ -129,3 +129,49 @@ Installing rglpk can fail if you have an incompatible version of the libglpk lib
 3. `make all`
 4. `sudo make install`
 5. `sudo ldconfig`
+
+## License
+Project Forum
+Copyright (C) 2022  EIP
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published
+by the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+This copyright and license applies to all of the source code files in the following folders, unless if indicated otherwise in a source code file:
+* app/assets/images/tutorials
+* app/channels
+* app/controllers
+* app/helpers
+* app/jobs
+* app/mailers
+* app/models
+* app/service
+* app/validators
+* app/views
+* db
+* lib
+* manuals
+* public (excluding images)
+* test
+
+The following folders carry both source files from the project (covered under the AGPLv3 license) as well as source files from libraries, to which a different license may apply. Please review the notice in each file carefully. If no notice is present, the source code file falls under the copyright and license of Project Forum (see above):
+* app/assets/javascripts
+* app/assets/stylesheets
+* app/assets/config
+* config
+
+The following folders contain source code files from libraries, which is not covered by the license for Project Forum:
+* bin
+* vendor
+
+If any doubt exists about the licensing of a particular source file, or if you otherwise would like more information on setting up or using Project Forum for your own institution, please contact EIP with the contact information listed on our website, https://eip.ewi.tudelft.nl.
diff --git a/app/controllers/admin/experiment_preference_dashboard_controller.rb b/app/controllers/admin/experiment_preference_dashboard_controller.rb
index 1a031ee874aab55df2ad052da8df2649ff03c7be..7f854f2f284b39612d198e924703ed03ef35d5a7 100644
--- a/app/controllers/admin/experiment_preference_dashboard_controller.rb
+++ b/app/controllers/admin/experiment_preference_dashboard_controller.rb
@@ -50,12 +50,14 @@ module Admin
 
     def filter_params
       params.permit(
-        id: [], student_type: []
+        id: [], student_type: [], experiment_projects: { round: [], course_edition: [] }
       )
     end
 
     def before_filtering(users)
       users.where(id: CourseParticipation.participants_research_practicum.ids)
+           .left_outer_joins(:experiment_projects)
+           .distinct
     end
   end
 end
diff --git a/app/controllers/admin/experiment_profiles_controller.rb b/app/controllers/admin/experiment_profiles_controller.rb
index 3b9663566e09ad2e64c2405e3fcc4834933a19c5..e8d0995e7b644aaa24a85b5b883646ebdb9ac218 100644
--- a/app/controllers/admin/experiment_profiles_controller.rb
+++ b/app/controllers/admin/experiment_profiles_controller.rb
@@ -66,7 +66,7 @@ module Admin
 
     def filter_params
       params.permit(
-        id: [], user_id: [], experiment_project_id: [], experiment_projects: { round: [], department: [] }
+        id: [], user_id: [], experiment_project_id: [], experiment_projects: { round: [], department: [], course_edition: [] }
       )
     end
 
diff --git a/app/controllers/concerns/params_concerns/projects.rb b/app/controllers/concerns/params_concerns/projects.rb
index 3b9423780fb0a39e358b95c220d2bb06549afd64..e05e02b2de487815ffc83ce7d7ed9643dda173ff 100644
--- a/app/controllers/concerns/params_concerns/projects.rb
+++ b/app/controllers/concerns/params_concerns/projects.rb
@@ -24,6 +24,8 @@ module ParamsConcerns
     # that are accepted via a controller for a company.
     def admin_project_params_keys
       BASE + FULL + [
+        shared_offerer_projects_attributes: \
+          ParamsConcerns::SharedOffererProjects::BASE + %i[id _destroy],
         groups_attributes: \
           ParamsConcerns::Groups::BASE + %i[id _destroy] + [
             memberships_attributes: \
diff --git a/app/controllers/concerns/params_concerns/shared_offerer_projects.rb b/app/controllers/concerns/params_concerns/shared_offerer_projects.rb
new file mode 100644
index 0000000000000000000000000000000000000000..64ca4aa111635162ce0b066fce008891bd3b27b6
--- /dev/null
+++ b/app/controllers/concerns/params_concerns/shared_offerer_projects.rb
@@ -0,0 +1,7 @@
+module ParamsConcerns
+  module SharedOffererProjects
+    extend ActiveSupport::Concern
+
+    BASE = %i[offerer_id].freeze
+  end
+end
diff --git a/app/controllers/generic_projects_controller.rb b/app/controllers/generic_projects_controller.rb
index fd40a9136235fbc2a65e63e239057f4edf83b7da..ad0db46d9ffa7d7b8cdd5873fce818e2071a9bd6 100644
--- a/app/controllers/generic_projects_controller.rb
+++ b/app/controllers/generic_projects_controller.rb
@@ -150,6 +150,8 @@ class GenericProjectsController < ProjectsController
 
       copy_reoffer_images
 
+      copy_reoffer_shared_offerers
+
       build_reoffer_recurrent_project_structure
 
       # assign course-specific roles
@@ -223,6 +225,16 @@ class GenericProjectsController < ProjectsController
     redirect_to generic_project_path(@specific_project)
   end
 
+  def add_shared_offerer
+    add_project_shared_offerer
+    redirect_to generic_project_path(@specific_project)
+  end
+
+  def remove_shared_offerer
+    remove_project_shared_offerer
+    redirect_to generic_project_path(@specific_project)
+  end
+
   def resume_recurrence
     authorize! :update, @project
     success = resume_project_recurrence
diff --git a/app/controllers/projects/student_preferences_controller.rb b/app/controllers/projects/student_preferences_controller.rb
index 48d5259e31bb9ceb316384fbda5a115729f4d37f..7719713d428a6b8002cdebba661a333fac1a6539 100644
--- a/app/controllers/projects/student_preferences_controller.rb
+++ b/app/controllers/projects/student_preferences_controller.rb
@@ -37,7 +37,7 @@ module Projects
     def destroy
       # If there is no id and email is present, look up by email
       if params[:id] == '-1' && params[:email].present?
-        student = User.find_by(email: params[:email].lower)
+        student = User.find_by(email: params[:email].downcase)
         # If the student does not exist, we expect an error, which is what we want.
         @student_preference = StudentPreference.find_by(user_id: current_user.id, student_id: student.id, course_edition_id: @course_edition.id)
       else
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 939b912ea25d2c5944c96d5556e0e08c0d83a0ad..4be5765992458b66c3819be189b168c9d1e1bebc 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -92,6 +92,34 @@ class ProjectsController < ApplicationController
     end
   end
 
+  # Adds a shared offerer to the current project
+  def add_project_shared_offerer
+    offerer = retrieve_shared_offerer_to_add
+    return unless offerer
+
+    if @project.shared_offerer_projects.find_by(offerer_id: offerer.id) || offerer.id == @project.offerer_id
+      flash[:danger] = 'This user/organisation already has access to this proposal.'
+      return
+    end
+
+    @project.shared_offerer_projects.create!(offerer: offerer)
+    flash[:success] = 'Successfully granted access'
+  end
+
+  # Adds a shared offerer to the current project
+  def remove_project_shared_offerer
+    shared_offerer_project_id = params[:shared_offerer_project_id]
+
+    raise ActionController::BadRequest unless shared_offerer_project_id
+
+    shared_offerer_project = @project.shared_offerer_projects.find_by(id: shared_offerer_project_id)
+
+    raise ActionController::BadRequest unless shared_offerer_project
+
+    shared_offerer_project.destroy!
+    flash[:success] = 'Successfully revoked access'
+  end
+
   # -----------------------------------------------------------------------------------------------
   # Destruction helpers
 
@@ -235,6 +263,15 @@ class ProjectsController < ApplicationController
     end
   end
 
+  # Copies shared offerers to the current project from the project being reoffered
+  def copy_reoffer_shared_offerers
+    return unless @project_to_reoffer
+
+    @project_to_reoffer.shared_offerer_projects.each do |shared|
+      @project.shared_offerer_projects.create(offerer_id: shared.offerer_id)
+    end
+  end
+
   # -----------------------------------------------------------------------------------------------
   # Params helpers
 
@@ -433,4 +470,35 @@ class ProjectsController < ApplicationController
       end
     end
   end
+
+  def retrieve_shared_offerer_to_add
+    offerer_id = params[:offerer_id]
+
+    if offerer_id
+      offerer = Offerer.find_by(id: offerer_id)
+      return offerer if offerer && !offerer.user?
+    end
+
+    user_email = params[:user_email]&.strip&.downcase
+    raise ActionController::BadRequest unless user_email
+
+    user = User.find_by(email: user_email)
+
+    return user.acting_as if user
+
+    if ldap_supported?(user_email)
+      user = generate_user_from_ldap(user_email)
+
+      return user.acting_as if user
+
+      # The user was not found in LDAP, so this email is invalid
+      flash[:danger] = "A user with email '#{user_email}' does not exist at TU Delft. " \
+                         'Is this email address correct?'
+    else
+      flash[:danger] = "User with email '#{user_email}' not found. Please make sure that the email is " \
+                       'correct and the user has registered on ProjectForum.'
+    end
+
+    nil
+  end
 end
diff --git a/app/helpers/crud_helper.rb b/app/helpers/crud_helper.rb
index 5b616a732a1bf7623f61ba48fff4c75ed13c8248..30d13d5fc036858e2ac9407c77cb1ad77471db5f 100644
--- a/app/helpers/crud_helper.rb
+++ b/app/helpers/crud_helper.rb
@@ -187,7 +187,7 @@ module CrudHelper
     if action.to_s == 'destroy' || action.to_s == 'delete'
       obj.destroyed?
     else
-      obj.valid? && obj.persisted?
+      (obj.errors.none? && obj.valid?) && obj.persisted?
     end
   end
 
diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb
index 377c5a51954933d1785e8e6f58d0e92c54f40111..1cfdb703b965164f60a6c627e2d2e73ae8285503 100644
--- a/app/helpers/links_helper.rb
+++ b/app/helpers/links_helper.rb
@@ -72,7 +72,11 @@ module LinksHelper
     name = object.send(name) if name.is_a?(Symbol) && object.respond_to?(name)
 
     if can? :show, object
-      link_to(name, url, html_options, &block)
+      if block_given?
+        link_to(url, html_options, &block)
+      else
+        link_to(name, url, html_options)
+      end
     else
       content_tag(:span, name, html_options, &block)
     end
diff --git a/app/helpers/name_helper.rb b/app/helpers/name_helper.rb
index ab9cbc22f7e650ec78495b1df1c1da8fdbd676ac..da80af008f2ad64a45e74c839361ea6e423945c1 100644
--- a/app/helpers/name_helper.rb
+++ b/app/helpers/name_helper.rb
@@ -25,4 +25,15 @@ module NameHelper
   def groups_name(count = 2)
     group_name.pluralize(count)
   end
+
+  def company_name
+    name = current_user&.company_name
+    return name if name
+
+    'company'
+  end
+
+  def companies_name(count = 2)
+    company_name.pluralize(count)
+  end
 end
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 6096bda1ad32e70396c236f6c5fddbb2a95cf235..8600809ff1787c30fb7c9be0e2f9506afe1c57ca 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -140,8 +140,8 @@ class Ability
   def unconfirmed_employee_rights(user)
     # Project
     can %i[index create], Project
-    can %i[show read_detailed reoffer], Project, id: Project.with_role(:client, user).ids
-    can %i[update update_role_client], Project, id:
+    can %i[show read_detailed reoffer add_shared_offerer remove_shared_offerer], Project, id: Project.with_role(:client, user).ids
+    can %i[update update_role_client attempt_to_destroy], Project, id:
       Project.with_role(:client, user)
              .joins(:course_edition)
              .where(course_editions: { id: CourseEdition.active.not_hidden }).ids
@@ -221,8 +221,10 @@ class Ability
     # Project
     can %i[index create], Project
     can %i[show read_detailed reoffer], Project, id: user.offerer_projects.ids
+    can %i[add_shared_offerer remove_shared_offerer], Project, id: user.own_offerer_projects.ids
     can %i[update update_role_client], Project, id: user.updatable_offerer_projects.ids
-    can :destroy, Project, id: user.offerer_projects.destroyable.map(&:id)
+    can :attempt_to_destroy, Project, id: user.updatable_own_offerer_projects.ids
+    can :destroy, Project, id: user.own_offerer_projects.destroyable.map(&:id)
 
     # Group
     can :read, Group, id: user.offerer_groups.ids
@@ -290,6 +292,14 @@ class Ability
     can %i[read access join_interest_list], CourseEdition, id: CourseEdition.open_for_offering_projects.internal.ids
     can %i[read access join_interest_list], CourseEdition, id: user.course_editions_where_has_project.not_hidden.ids
 
+    # Abilities for staff members enrolled in courses
+    can %i[read access set_preferences join_interest_list], CourseEdition, id: user.approved_course_editions.not_hidden.ids
+    can :read, CourseEdition, id: user.pending_course_editions.active.ids
+    can %i[access set_preferences], CourseEdition, id: user.pending_course_editions.allowing_pending_students_to_see_projects.active.ids
+    course_edition_content_rights(user.pending_course_editions.allowing_pending_students_to_see_projects.ids)
+    course_edition_content_rights(user.approved_course_editions.ids)
+    course_edition_interest_rights(user.pending_or_approved_course_editions.ids)
+
     # Course Edition Availability
     can %i[index create], Availability
 
diff --git a/app/models/concerns/elastic_searchable.rb b/app/models/concerns/elastic_searchable.rb
index ae3530adaf919b549bf1bb686cd011301566d43c..201ec0671089097c835ed9ca6cf64e4841f7e4d1 100644
--- a/app/models/concerns/elastic_searchable.rb
+++ b/app/models/concerns/elastic_searchable.rb
@@ -7,7 +7,5 @@ module ElasticSearchable
 
     # Use the Rails env in the index name to prevent issues of test indices overriding development/production indices
     index_name "#{Rails.env}_#{model_name.collection.gsub(%r{/}, '-')}"
-
-    after_touch { __elasticsearch__.index_document }
   end
 end
diff --git a/app/models/concerns/user_concerns/associatable.rb b/app/models/concerns/user_concerns/associatable.rb
index d70ab8a94f4d0cc279261957080b09c85aecc2be..9a6a0972158540b4dc274ea6d54f9b20b183baad 100644
--- a/app/models/concerns/user_concerns/associatable.rb
+++ b/app/models/concerns/user_concerns/associatable.rb
@@ -312,9 +312,19 @@ module UserConcerns
       end
     end
 
+    def shared_offerer_projects
+      Project.joins(:shared_offerer_projects).where(shared_offerer_projects: { offerer_id: involved_offerers })
+    end
+
+    def own_offerer_projects
+      Project.where(id: cliented_projects)
+             .or(Project.where(offerer_id: involved_offerers))
+    end
+
     def offerer_projects(offerer_type = nil)
-      Project.where(id: cliented_projects).or(Project.where(offerer_id: involved_offerers))
-             .where(offerer_id: Offerer.with_type(offerer_type))
+      own_offerer_projects
+        .or(Project.where(id: shared_offerer_projects))
+        .where(offerer_id: Offerer.with_type(offerer_type))
     end
 
     def active_offerer_projects(offerer_type = nil)
@@ -348,6 +358,11 @@ module UserConcerns
                       .where(course_editions: { id: CourseEdition.active.not_hidden })
     end
 
+    def updatable_own_offerer_projects
+      own_offerer_projects.joins(:course_edition)
+                          .where(course_editions: { id: CourseEdition.active.not_hidden })
+    end
+
     def updatable_offerer_groups
       Group.locked.where(project_id: offerer_projects).or(Group.approved.where(project_id: offerer_projects))
     end
@@ -407,11 +422,11 @@ module UserConcerns
           'project'
         end
       else
-        names = programmes.map { |p| p.configuration.present? ? p.configuration.group_text(false, false) : 'student' }.uniq
+        names = programmes.map { |p| p.configuration.present? ? p.configuration.group_text(false, false) : 'group' }.uniq
         if names.size == 1
           names[0]
         else
-          'student'
+          'group'
         end
       end
     end
diff --git a/app/models/course_edition.rb b/app/models/course_edition.rb
index 793aa898392ef4ec9f2cb14b94df4cbd5a230c58..762ebaa0653013ac81b6e86a4cffc3a2a93d88e6 100644
--- a/app/models/course_edition.rb
+++ b/app/models/course_edition.rb
@@ -283,21 +283,19 @@ class CourseEdition < ApplicationRecord
     User.staff.or(User.admin).on_interest_list_in_course_edition(self)
   end
 
-  after_create do
-    duplicate_projects
-  end
+  after_create :duplicate_projects, if: (-> { !(recurrent_edition_id.nil? || active_period_id.nil?) })
 
   # For course editions which descend from a recurring edition (which also have an active period set)
   # this method will copy over the approved projects from the recurrent edition which match the active period.
   # This method is triggered after the creation of a course edition.
   def duplicate_projects
-    unless recurrent_edition_id.nil? || active_period_id.nil?
-      recurrent_edition.projects.each do |project|
-        if project.status == 'approved' && project.periods.select { |period| period.id == active_period.id }.any?
-          project.copy_project(self)
-        end
+    recurrent_edition.projects.each do |project|
+      if project.status == 'approved' && project.periods.select { |period| period.id == active_period.id }.any?
+        project.copy_recurrent_project(self, self, :base)
       end
     end
+
+    raise ActiveRecord::Rollback if errors.include?(:base)
   end
 
   # ===== Other =====
diff --git a/app/models/offerer.rb b/app/models/offerer.rb
index 451c32bccf5ccd0a5d34ab0ad9749fa561923f63..ca4dec706c6ee910f2e8c314aa7bc25f2ab860c0 100644
--- a/app/models/offerer.rb
+++ b/app/models/offerer.rb
@@ -3,6 +3,9 @@ class Offerer < ApplicationRecord
 
   has_many :projects, dependent: :nullify
 
+  has_many :shared_offerer_projects, dependent: :destroy
+  has_many :shared_projects, through: :shared_offerer_projects, source: :project, class_name: 'Project'
+
   scope :users, -> { where(actable_type: User.model_name.name) }
 
   scope :companies, -> { where(actable_type: Company.model_name.name) }
diff --git a/app/models/project.rb b/app/models/project.rb
index 0eb1d06efdf0c4aee266e3cec02c7e96810bda51..8a1ee907764dda5b0ce761eb8d0c175f816c9212 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -17,6 +17,9 @@ class Project < ApplicationRecord
   belongs_to :offerer, counter_cache: true
   belongs_to :course_edition
   has_many :programmes, through: :course_edition
+  has_many :shared_offerer_projects, dependent: :destroy
+  accepts_nested_attributes_for :shared_offerer_projects, allow_destroy: true
+  has_many :shared_offerers, through: :shared_offerer_projects, source: :offerer, class_name: 'Offerer'
 
   has_many :images, as: :imageable, dependent: :destroy
   accepts_nested_attributes_for :images, allow_destroy: true
@@ -107,12 +110,19 @@ class Project < ApplicationRecord
     CourseEdition.descendants_of(course_edition).before_started.find_each do |course_edition|
       if periods.select { |period| period.id == course_edition.active_period.id }.any? &&
          course_edition.projects.where(original_project_id: id).none?
-        copy_project(course_edition)
+        copy_recurrent_project(course_edition, self, :course_edition)
       end
     end
+
+    throw :abort if errors.include?(:course_edition)
   end
 
-  def copy_project(course_edition)
+  # This helper method is used to copy a recurrent project to a descendent course edition.
+  # WARNING: In case the course editions are inconsistent in some way, errors will be set on the validation object.
+  # Actually rolling back the transaction is a responsibility of the caller of this method.
+  def copy_recurrent_project(course_edition, validation_object, validation_attribute)
+    raise ArgumentError, 'copy_recurrent_project method called on non-recurrent project' unless self.course_edition.recurrent
+
     new_project = nil
     Project.transaction do
       new_project = specific.dup
@@ -125,20 +135,15 @@ class Project < ApplicationRecord
         new_project.images.create(title: img.title, file: img.file)
       end
 
-      user_course_specific_roles.each do |ucsr|
-        next if ucsr.course_specific_role.assignment_rule == :not_specifiable_by_client.to_s
-
-        new_csr = course_edition.course_specific_roles.find_by(name: ucsr.course_specific_role.name)
-        next if new_csr.nil?
-
-        new_ucsr = ucsr.dup
-        new_ucsr.course_specific_role = new_csr
-        new_project.user_course_specific_roles.push new_ucsr
-      end
+      copy_recurrent_course_specific_roles(course_edition, new_project, validation_attribute, validation_object)
 
       User.with_role(:client, self).each do |user|
         user.add_role(:client, new_project)
       end
+
+      shared_offerer_projects.each do |shared|
+        new_project.shared_offerer_projects.create(offerer_id: shared.offerer_id)
+      end
     end
 
     new_project
@@ -453,4 +458,33 @@ class Project < ApplicationRecord
   def unset_approved_at
     self.approved_at = nil
   end
+
+  private
+
+  def copy_recurrent_course_specific_roles(course_edition, new_project, validation_attribute, validation_object)
+    user_course_specific_roles.each do |ucsr|
+      new_csr = course_edition.course_specific_roles.find_by(name: ucsr.course_specific_role.name)
+      if new_csr.nil?
+        validation_object.errors.add validation_attribute,
+                                     "'#{course_edition.display_name}' does not have course-specific role " \
+                                       "'#{ucsr.course_specific_role.name}', which is assigned in " \
+                                       "the '#{display_name}' project"
+        next
+      end
+
+      new_ucsr = ucsr.dup
+      new_ucsr.course_specific_role = new_csr
+      new_project.user_course_specific_roles.push new_ucsr
+    end
+
+    course_edition.course_specific_roles.each do |csr|
+      next unless csr.assignment_rule == 'required'
+      next if user_course_specific_roles.any? { |ucsr| ucsr.course_specific_role.name == csr.name }
+
+      validation_object.errors.add validation_attribute,
+                                   "'#{course_edition.display_name}' has a required course-specific role " \
+                                     "'#{csr.name}' which is not assigned in " \
+                                     "the '#{display_name}' project"
+    end
+  end
 end
diff --git a/app/models/shared_offerer_project.rb b/app/models/shared_offerer_project.rb
new file mode 100644
index 0000000000000000000000000000000000000000..de65ae6b68a0cea83f08b1d390ab854b7a5bb723
--- /dev/null
+++ b/app/models/shared_offerer_project.rb
@@ -0,0 +1,4 @@
+class SharedOffererProject < ApplicationRecord
+  belongs_to :offerer
+  belongs_to :project
+end
diff --git a/app/views/admin/experiment_preference_dashboard/index/_filters.html.erb b/app/views/admin/experiment_preference_dashboard/index/_filters.html.erb
index d6e4b9403272d9ff09c8db4e6c888459a33fcb56..2d090bbd1c0a5aea4b0f2f3226fab0d21ae9c7e9 100644
--- a/app/views/admin/experiment_preference_dashboard/index/_filters.html.erb
+++ b/app/views/admin/experiment_preference_dashboard/index/_filters.html.erb
@@ -12,5 +12,19 @@
                 multiple: true, class: 'selectize', placeholder: 'All student types' %>
   </div>
 
+  <div class="form-group">
+    <%= label_tag 'experiment_projects[course_edition]', ExperimentProject.human_attribute_name(:course_edition) %>
+    <%  selected = @filter_params[:experiment_projects].present? ? @filter_params[:experiment_projects][:course_edition] : nil %>
+    <%= select_tag 'experiment_projects[course_edition]',
+                   options_for_select(CourseEdition.supporting_experiment_projects.sort_by_name.map { |c| { c.display_name => c.id } }.inject({}, &:merge), selected),
+                   multiple: true, class: 'selectize', placeholder: 'All course editions' %>
+  </div>
+
+  <div class="form-group">
+    <%= label_tag 'experiment_projects[round]', ExperimentProject.human_attribute_name(:round) %>
+    <%  selected = @filter_params[:experiment_projects].present? ? @filter_params[:experiment_projects][:round] : nil %>
+    <%= select_tag 'experiment_projects[round]', options_for_select((1..20), selected),
+                   multiple: true, class: 'selectize', placeholder: 'All rounds' %>
+  </div>
   
 <% end %>
diff --git a/app/views/admin/experiment_profiles/index.csv.erb b/app/views/admin/experiment_profiles/index.csv.erb
index 98790f6c076eb80e8b4aa5fb66f46cc5b35d7c2a..ecc41614c25a198406121ae57e193b22a780a7fd 100644
--- a/app/views/admin/experiment_profiles/index.csv.erb
+++ b/app/views/admin/experiment_profiles/index.csv.erb
@@ -1,7 +1,7 @@
 <%- headers = [
-  ExperimentProfile.human_attribute_name(:id),
+  SsoProfile.human_attribute_name(:student_number),
   ExperimentProfile.human_attribute_name(:user1),
-  ExperimentProfile.human_attribute_name(:id),
+  SsoProfile.human_attribute_name(:student_number),
   ExperimentProfile.human_attribute_name(:user2),
   ExperimentProject.model_name.human,
   Department.model_name.human,
diff --git a/app/views/admin/experiment_profiles/index.xlsx.axlsx b/app/views/admin/experiment_profiles/index.xlsx.axlsx
index 685ac82bdef5c7f011a2a06814cce609c81fd7dc..08ead63b3fadecec07609ca66e1225b2030ae986 100644
--- a/app/views/admin/experiment_profiles/index.xlsx.axlsx
+++ b/app/views/admin/experiment_profiles/index.xlsx.axlsx
@@ -3,9 +3,9 @@ wb.add_worksheet(name: 'profiles') do |sheet|
   styles = add_styles_to sheet
 
   sheet.add_row [
-    ExperimentProfile.human_attribute_name(:id),
+    SsoProfile.human_attribute_name(:student_number),
     ExperimentProfile.human_attribute_name(:user1),
-    ExperimentProfile.human_attribute_name(:id),
+    SsoProfile.human_attribute_name(:student_number),
     ExperimentProfile.human_attribute_name(:user2),
     ExperimentProject.model_name.human,
     Department.model_name.human,
diff --git a/app/views/admin/experiment_profiles/index/_filters.html.erb b/app/views/admin/experiment_profiles/index/_filters.html.erb
index 8e3dd6fba2a19771af4f5140dbe471aff02f1b11..862471f65613a371e1cfcb3aea979c391f6a7d47 100644
--- a/app/views/admin/experiment_profiles/index/_filters.html.erb
+++ b/app/views/admin/experiment_profiles/index/_filters.html.erb
@@ -20,6 +20,14 @@
                    multiple: true, class: 'selectize', placeholder: 'All departments' %>
   </div>
 
+  <div class="form-group">
+    <%= label_tag 'experiment_projects[course_edition]', ExperimentProject.human_attribute_name(:course_edition) %>
+    <%  selected = @filter_params[:experiment_projects].present? ? @filter_params[:experiment_projects][:course_edition] : nil %>
+    <%= select_tag 'experiment_projects[course_edition]',
+                   options_for_select(CourseEdition.supporting_experiment_projects.sort_by_name.map { |c| { c.display_name => c.id } }.inject({}, &:merge), selected),
+                   multiple: true, class: 'selectize', placeholder: 'All course editions' %>
+  </div>
+
   <div class="form-group">
     <%= label_tag 'experiment_projects[round]', ExperimentProject.human_attribute_name(:round) %>
     <%  selected = @filter_params[:experiment_projects].present? ? @filter_params[:experiment_projects][:round] : nil %>
diff --git a/app/views/admin/experiment_profiles/index/_table.html.erb b/app/views/admin/experiment_profiles/index/_table.html.erb
index fbef8bbeca2dc8c18282f461457578bef6aaf267..acee1fda9f86634b0869f2fa9050bcf383d3baa9 100644
--- a/app/views/admin/experiment_profiles/index/_table.html.erb
+++ b/app/views/admin/experiment_profiles/index/_table.html.erb
@@ -3,10 +3,10 @@
     <thead>
       <tr>
         <th><%= sort_link @q, :id %></th>
-        <th><%= User.human_attribute_name :full_name %></th>
-        <th><%= User.human_attribute_name :full_name %></th>
-        <th><%= sort_link @q, :experiment_project_name %></th>
-        <th><%= sort_link @q, :experiment_project_department_name, default_order: :asc %></th>
+        <th>Student 1 <%= User.human_attribute_name :full_name %></th>
+        <th>Student 2 <%= User.human_attribute_name :full_name %></th>
+        <th><%= sort_link @q, :experiment_project_name, ExperimentProject.model_name.human %></th>
+        <th><%= sort_link @q, :experiment_project_department_name, Department.model_name.human, default_order: :asc %></th>
         <th><%= sort_link @q, :experiment_project_round %></th>
       </tr>
     </thead>
diff --git a/app/views/admin/projects/_shared_offerer_project_fields.html.erb b/app/views/admin/projects/_shared_offerer_project_fields.html.erb
new file mode 100644
index 0000000000000000000000000000000000000000..66c9a0bde39f1123335483a80596538086edd709
--- /dev/null
+++ b/app/views/admin/projects/_shared_offerer_project_fields.html.erb
@@ -0,0 +1,20 @@
+<div class="nested-fields list-group-item">
+  <div class="row">
+    <div class='col-sm-11'>
+      <% types = [ResearchGroup.model_name, Company.model_name, User.model_name] %>
+      <% human_types = types.map { |type| t("projects.form.offerer.types.#{type.param_key}.name") } %>
+      <% offerers = Offerer.sorted_for_collection(types: types.map(&:name), elements: %i[id name email]) %>
+      <%= f.grouped_collection_select :offerer_id,
+                                      [0, 1, 2],
+                                      ->(type) { offerers[type] },
+                                      ->(type) { human_types[type] },
+                                      :first, ->(o) { [o.second, o.third] },
+                                      { required: true },
+                                      class: 'offerer-dropdown', placeholder: t('projects.form.offerer.types_placeholder') %>
+    </div>
+    <div class='col-sm-1'>
+      <%= cocoon_remove_link f %>
+    </div>
+  </div>
+</div>
+<script>offererDropdownInit()</script>
diff --git a/app/views/admin/projects/edit/_project_form.html.erb b/app/views/admin/projects/edit/_project_form.html.erb
index 5ccadfc9ddbf857e2ca0f91090dbcc5c409c3221..c5ad009eb836fbce735e6df5a81ad9e789334a31 100644
--- a/app/views/admin/projects/edit/_project_form.html.erb
+++ b/app/views/admin/projects/edit/_project_form.html.erb
@@ -33,6 +33,41 @@
         %>
       </td>
     </tr>
+
+    <script type="text/javascript">
+        function offererDropdownInit() {
+            let renderFunction = function (data, escape) {
+                let u = JSON.parse(data.text);
+                return '<div class="option">' +
+                    '<span>' + escape(u[0]) + '</span><br>' +
+                    '<span class="text-muted">' + escape(u[1]) + '</span>' +
+                    '</div>';
+            };
+
+
+            $('select.offerer-dropdown').each(function () {
+                if (this.selectize === undefined) {
+                    $(this).selectize({
+                        sortField: 'text',
+                        render: {
+                            item: renderFunction,
+                            option: renderFunction
+                        }
+                    });
+                }
+            });
+        }
+
+        $(document).on('turbolinks:load', offererDropdownInit);
+
+        $(document).on('turbolinks:before-cache', function () {
+            $('.offerer-dropdown').each(function () {
+                if (this.selectize !== undefined) {
+                    this.selectize.destroy();
+                }
+            });
+        });
+    </script>
     <tr>
       <td>
         <%# This code here may seem complex, but it had to be optimized due to ridiculous loading time of the edit page. %>
@@ -45,35 +80,31 @@
                                         ->(type) { human_types[type] },
                                         :first, ->(o) { [o.second, o.third] },
                                         { required: true, selected: f.object.offerer_id },
-                                        placeholder: t('projects.form.offerer.types_placeholder') %>
-
-        <script type="text/javascript">
-            $(document).on('turbolinks:load', function () {
-                let renderFunction = function (data, escape) {
-                    let u = JSON.parse(data.text);
-                    return '<div class="option">' +
-                        '<span>' + escape(u[0]) + '</span><br>' +
-                        '<span class="text-muted">' + escape(u[1]) + '</span>' +
-                        '</div>';
-                };
-
-                $('#generic_project_offerer_id').selectize({
-                    sortField: 'text',
-                    render: {
-                        item: renderFunction,
-                        option: renderFunction
-                    }
-                });
-            });
+                                        class: 'offerer-dropdown', placeholder: t('projects.form.offerer.types_placeholder') %>
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <div class="form-group row">
+          <div class="col-sm-2">
+            <%= f.label :shared_offerer_projects %>
+          </div>
+          <div class="col-sm-10">
+            <div class="list-group cocoon">
+              <%= f.fields_for :shared_offerer_projects do |shared_offerer| %>
+                <%= render 'shared_offerer_project_fields', f: shared_offerer %>
+              <% end %>
 
-            $(document).on('turbolinks:before-cache', function () {
-                $('#generic_project_offerer_id').each(function () {
-                    if (this.selectize !== undefined) {
-                        this.selectize.destroy();
-                    }
-                });
-            });
-        </script>
+              <%= link_to_add_association(
+                    glyphicon_text('plus-sign', "Add another offerer"),
+                    f,
+                    :shared_offerer_projects,
+                    class: 'list-group-item list-group-item--button',
+                    'data-association-insertion-node' => 'this'
+                  ) %>
+            </div>
+          </div>
+        </div>
       </td>
     </tr>
     <tr>
diff --git a/app/views/admin/projects/show/_information.html.erb b/app/views/admin/projects/show/_information.html.erb
index 9c836fbc70c484df59bd511925969a3b0349dc86..73905ad6e2161f0116e55c5e108ff7677ddba2b5 100644
--- a/app/views/admin/projects/show/_information.html.erb
+++ b/app/views/admin/projects/show/_information.html.erb
@@ -174,6 +174,20 @@
         </div>
       </td>
     </tr>
+    <tr>
+      <td><strong> <%= Project.human_attribute_name :shared_offerer_projects %> </strong></td>
+      <td>
+        <% @project.shared_offerers.each do |shared_offerer| %>
+          <div class="mbs">
+            <%= link_to shared_offerer.name, admin_offerer_path(shared_offerer) %>
+            <div class="text-muted">
+              <%= shared_offerer.actable_type %>,
+              <%= shared_offerer.email %>
+            </div>
+          </div>
+        <% end %>
+      </td>
+    </tr>
     <tr>
       <td><strong> <%= Project.human_attribute_name :course_edition %> </strong></td>
       <td>
diff --git a/app/views/admin/thesis_projects/index/_filters.html.erb b/app/views/admin/thesis_projects/index/_filters.html.erb
index e6da90c2333fd0345b1d70584277c8f4acb445de..da361de243e03c6a03c8f46c5e1f180896775448 100644
--- a/app/views/admin/thesis_projects/index/_filters.html.erb
+++ b/app/views/admin/thesis_projects/index/_filters.html.erb
@@ -12,6 +12,10 @@
     <%= label_tag :research_group, ResearchGroup.model_name.human %>
     <%= select_tag :research_group, options_for_select(@research_group_options.map { |c| { c.name => c.id } }.inject({}, &:merge), @filter_params[:research_group]),
                    multiple: true, class: 'selectize', placeholder: 'All research groups' %>
+
+    <%= label_tag :archived, ThesisProject.human_attribute_name(:archived) %>
+    <%= select_tag :archived, options_for_select([['Visible', false], ['Archived', true]], @filter_params[:archived]),
+                   multiple: true, class: 'selectize', placeholder: 'All statuses' %>
   </div>
 
 <% end %>
diff --git a/app/views/admin/thesis_projects/index/_table.html.erb b/app/views/admin/thesis_projects/index/_table.html.erb
index 63fb33e3ec1428af930d459051dd9dad9689a897..845cc7c2a56b064e6be367ada6fa69ddb9871e2f 100644
--- a/app/views/admin/thesis_projects/index/_table.html.erb
+++ b/app/views/admin/thesis_projects/index/_table.html.erb
@@ -12,7 +12,15 @@
       <% @thesis_projects.each do |thesis_project| %>
         <%= table_row_link_to_if_rights thesis_project, admin_thesis_project_path(thesis_project) do %>
           <td><%= thesis_project.id %></td>
-          <td><strong><%= thesis_project.name %></strong></td>
+          <td>
+            <strong>
+              <% if thesis_project.archived %>
+                <i><%= thesis_project.name %> (Archived)</i>
+              <% else %>
+                <%= thesis_project.name %>
+              <% end %>
+            </strong>
+          </td>
           <td><strong><%= thesis_project.theme.name %></strong></td>
           <td><strong><%= thesis_project.research_group.name %></strong></td>
         <% end %>
diff --git a/app/views/companies/index/_companies_list.html.erb b/app/views/companies/index/_companies_list.html.erb
index 4d6c8e2edd22ae978bbb747515dba97519480dbb..b0c7250905e5ce1134e7cbcd8316f414b4da3397 100644
--- a/app/views/companies/index/_companies_list.html.erb
+++ b/app/views/companies/index/_companies_list.html.erb
@@ -4,16 +4,18 @@
   </div>
   <div class="list-group">
     <% @companies.each do |company| %>
-      <%= link_to_if_rights company.acting_as,
-                            current_user.has_role?(:unconfirmed_employee, company) ?
-                              raw(CGI.escapeHTML(company.name) +
-                                    colored_label(:danger, 'Unconfirmed', 'mls label-medium') +
-                                    popover("You do not have access to all of the company's #{projects_name} as " +
-                                              'you are not a confirmed employee of this company. Another employee ' +
-                                              'can confirm your status on the company page on ProjectForum.',
-                                            class: 'mls')) :
-                              company.name,
-                            offerer_path(company.acting_as), class: 'list-group-item' %>
+      <% if current_user.has_role?(:employee, company) %>
+        <%= link_to company.name, offerer_path(company.acting_as), class: 'list-group-item' %>
+      <% else %>
+        <span class="list-group-item">
+          <%= company.name %>
+          <%= colored_label(:danger, 'Unconfirmed', 'mls label-medium') %>
+          <%= popover("You do not have access to all of the company's #{projects_name} as " +
+                        'you are not a confirmed employee of this company. Another employee ' +
+                        'can confirm your status on the company page on ProjectForum.',
+                      class: 'mls') %>
+        </span>
+      <% end %>
     <% end %>
   </div>
 </div>
diff --git a/app/views/generic_projects/_recurrence_navigation_menu.html.erb b/app/views/generic_projects/_recurrence_navigation_menu.html.erb
index 512aa9d3121bd357443efe30be3cc533ee219f86..304db2f2f230e3b8315c846fc9ad6ce849175553 100644
--- a/app/views/generic_projects/_recurrence_navigation_menu.html.erb
+++ b/app/views/generic_projects/_recurrence_navigation_menu.html.erb
@@ -56,7 +56,12 @@
               <% end %>
             </span>
             <strong><%= recurrent_project.display_name %></strong>
-            <%= project_status_tag recurrent_project %><br>
+            <% if can?(:read_detailed, recurrent_project) %>
+              <%= project_status_tag recurrent_project %>
+            <% else %>
+              <%= colored_label :warning, 'No access' %>
+            <% end %>
+            <br>
             (base version to copy)
           </a>
           <% descendent_projects.each do |descendent_project| %>
@@ -65,7 +70,11 @@
 
             <a href="<%= url_for(id: descendent_project.specific) %>" class="list-group-item plx <%= @project.id == descendent_project.id ? active_color : '' %>">
               <strong><%= descendent_project.display_name %></strong>
-              <%= project_status_tag descendent_project %>
+              <% if can?(:read_detailed, descendent_project) %>
+                <%= project_status_tag descendent_project %>
+              <% else %>
+                <%= colored_label :warning, 'No access' %>
+              <% end %>
               <br>
               in <%= render 'generic_projects/course_edition_short_details', course_edition: descendent_project.course_edition %>
             </a>
diff --git a/app/views/generic_projects/edit.html.erb b/app/views/generic_projects/edit.html.erb
index 3512c853973d647cad638f6b87464f020023bf46..82fbc2f6cb149a0133dc83cb70da75c5e634e873 100644
--- a/app/views/generic_projects/edit.html.erb
+++ b/app/views/generic_projects/edit.html.erb
@@ -21,4 +21,4 @@
   </div>
 </div>
 
-<%= render 'generic_projects/edit/delete_project' %>
+<%= render 'generic_projects/edit/delete_project' if can? :attempt_to_destroy, @project %>
diff --git a/app/views/generic_projects/show.html.erb b/app/views/generic_projects/show.html.erb
index cb251ec472c9655994e68d8cfb2d98f20c3649e3..7407d42255f557f359bc40476fc076c60428ae49 100644
--- a/app/views/generic_projects/show.html.erb
+++ b/app/views/generic_projects/show.html.erb
@@ -73,6 +73,8 @@
     <% if @project.status != 'deactivated' %>
       <%= glyphicon_link_to :pencil, 'Edit Proposal', edit_project_path(@project), class: 'btn btn-primary' %>
     <% end %>
+  <% end %>
+  <% if can? :attempt_to_destroy, @project %>
     <% if @project.status != 'deactivated' || @project.course_edition.recurrent %>
       <%= render 'delete_project_modal_with_button' %>
     <% end %>
@@ -83,6 +85,11 @@
 <%= render 'generic_projects/show/information' %>
 <%= render 'generic_projects/show/images' %>
 
+<%# Show shared offerers only if the user can see the project details (sensitive information) %>
+<% if can? :read_detailed, @project %>
+  <%= render 'generic_projects/show/shared_offerers' %>
+<% end %>
+
 <%# Show group details only if the user can see the project details (sensitive information) %>
 <% if can? :read_detailed, @project %>
   <%= render 'generic_projects/show/groups' %>
diff --git a/app/views/generic_projects/show/_shared_offerers.html.erb b/app/views/generic_projects/show/_shared_offerers.html.erb
new file mode 100644
index 0000000000000000000000000000000000000000..2776e2d052cb14c84c5382a44b28553e9b999be1
--- /dev/null
+++ b/app/views/generic_projects/show/_shared_offerers.html.erb
@@ -0,0 +1,144 @@
+<div class="panel panel-info">
+  <div class="panel-heading">
+    <%= t 'activerecord.attributes.generic_project.shared_offerer_projects' %>
+  </div>
+  <div class="panel-body">
+    <% if can? :add_shared_offerer, @project %>
+      <p>
+        You can allow another <%= company_name %>, user, or TU Delft research group to have full access to
+        this <%= project_name %>.
+        This is useful if two <%= companies_name %> are involved in it, for example.
+      </p>
+      <p>
+        Any organisation or user listed here will be able to do almost anything you can, including editing the
+        <%= project_name %>, approving or rejecting <%= groups_name %>, assigning supervisors, etc. However,
+        they will not be able to delete the <%= project_name %> or share it with more organisations or users
+        using this menu.
+      </p>
+      <% if @project.offerer.company? || @project.offerer.research_group? %>
+        <p>
+          It is not necessary to add other members of
+          <span class="txt-italic"><%= @project.offerer.display_name %></span>
+          here, as they automatically have full access to the <%= project_name %>.
+        </p>
+      <% end %>
+    <% end %>
+    <% if @project.shared_offerers.present? %>
+      <p>This <%= project_name %> is shared with the following organisations/users:</p>
+      <div class="list-group">
+        <% @project.shared_offerer_projects.each do |shared_offerer_project| %>
+          <% shared_offerer = shared_offerer_project.offerer %>
+          <div class="list-group-item">
+            <% if can? :remove_shared_offerer, @project %>
+              <%= modal_with_link('Revoke access', "remove-shared-offerer-#{shared_offerer_project.id}",
+                                  'Revoke access', class: 'btn btn-danger btn-xs pull-right') do %>
+                <%= modal_body do %>
+                  Are you sure you want to revoke access for this user/organisation?
+                <% end %>
+                <%= modal_footer do %>
+                  <%= form_with url: remove_shared_offerer_generic_project_path, method: 'post' do |form| %>
+                    <%= form.submit "Revoke access", class: 'btn btn-danger' %>
+                    <%= form.hidden_field :shared_offerer_project_id, value: shared_offerer_project.id %>
+                    <%= modal_cancel %>
+                  <% end %>
+                <% end %>
+              <% end %>
+            <% end %>
+
+            <%= shared_offerer.user? ? shared_offerer.email : shared_offerer.display_name %>
+          </div>
+        <% end %>
+      </div>
+    <% else %>
+      <p class="txt-italic">
+        This <%= project_name %> is not shared with other organisations or users.
+      </p>
+    <% end %>
+
+    <% if can? :add_shared_offerer, @project %>
+      <%= modal_with_button 'Add Access',
+                            "add-shared-offerer",
+                            raw("#{glyphicon :plus} Add Access"),
+                            class: "btn btn-success" do %>
+        <%= modal_body do %>
+          <div style="min-height: 30vh;">
+            <div class="list-group-item">
+              <ul class="nav nav-pills nav-justified mbm mtm" role="tablist">
+                <li role="presentation">
+                  <a href="#add-access-company"
+                     aria-controls="add-access-company" role="tab" data-toggle="tab">
+                    <%= company_name.capitalize %>
+                  </a>
+                </li>
+                <li role="presentation">
+                  <a href="#add-access-user"
+                     aria-controls="add-access-user" role="tab" data-toggle="tab">
+                    User
+                  </a>
+                </li>
+                <li role="presentation">
+                  <a href="#add-access-research-group"
+                     aria-controls="add-access-research-group" role="tab" data-toggle="tab">
+                    TU Delft Research Group
+                  </a>
+                </li>
+              </ul>
+
+              <div class="tab-content mtl">
+                <div role="tabpanel" class="tab-pane fade" id="add-access-company">
+                  <%= bootstrap_form_tag url: add_shared_offerer_generic_project_path, method: :post do |f| %>
+                    <div class="row">
+                      <div class="col-md-9">
+                        <%= f.collection_select :offerer_id,
+                                                Offerer.companies.sort_by_name,
+                                                :id,
+                                                :name,
+                                                { prompt: true, placeholder: "Select #{company_name}", skip_label: true },
+                                                { class: 'selectize', required: true } %>
+                      </div>
+                      <div class="col-md-3">
+                        <%= f.submit "Grant Access", class: 'btn btn-primary' %>
+                      </div>
+                    </div>
+                  <% end %>
+                </div>
+                <div role="tabpanel" class="tab-pane fade" id="add-access-user">
+                  <%= bootstrap_form_tag url: add_shared_offerer_generic_project_path, method: :post do |f| %>
+                    <div class="row">
+                      <div class="col-md-9">
+                        <%= f.email_field :user_email, placeholder: 'someone@example.com', skip_label: true, required: true %>
+                      </div>
+                      <div class="col-md-3">
+                        <%= f.submit "Grant Access", class: 'btn btn-primary' %>
+                      </div>
+                    </div>
+                  <% end %>
+                </div>
+                <div role="tabpanel" class="tab-pane fade" id="add-access-research-group">
+                  <%= bootstrap_form_tag url: add_shared_offerer_generic_project_path, method: :post do |f| %>
+                    <div class="row">
+                      <div class="col-md-9">
+                        <%= f.collection_select :offerer_id,
+                                                Offerer.research_groups.sort_by_name,
+                                                :id,
+                                                :name,
+                                                { prompt: true, placeholder: "Select Research Group", skip_label: true },
+                                                { class: 'selectize', required: true } %>
+                      </div>
+                      <div class="col-md-3">
+                        <%= f.submit "Grant Access", class: 'btn btn-primary' %>
+                      </div>
+                    </div>
+                  <% end %>
+                </div>
+              </div>
+            </div>
+          </div>
+        <% end %>
+        <%= modal_footer do %>
+          <%= button_tag 'Cancel', class: 'btn btn-default', data: { dismiss: 'modal' } %>
+        <% end %>
+      <% end %>
+    <% end %>
+  </div>
+</div>
diff --git a/app/views/offerers/show/_employees.html.erb b/app/views/offerers/show/_employees.html.erb
index def2d5bd4b66655959acf0366c8299438ee9443a..dd2a420f4d6b5320242561649d7a4b0d77ac257d 100644
--- a/app/views/offerers/show/_employees.html.erb
+++ b/app/views/offerers/show/_employees.html.erb
@@ -26,14 +26,12 @@
             </td>
             <td> <%= employee.email %> </td>
             <% if @specific_offerer.is_a?(Company) %>
-              <td>
+              <td class="text-right">
                 <% if employee.has_role?(:unconfirmed_employee, @specific_offerer) %>
                 <%= bootstrap_form_for [@specific_offerer, RoleInvitation.new] do |f| %>
                     <%= f.hidden_field :email, value: employee.email %>
                     <%= f.hidden_field :resource_id, value: @specific_offerer.id %>
-                    <%= button_tag class: 'btn btn-success btn-block' do %>
-                      Confirm
-                    <% end %>
+                    <%= button_tag icon(:fas, :'user-check', 'Confirm'), class: 'btn btn-success' %>
                   <% end %>
                 <% end %>
               </td>
@@ -47,17 +45,15 @@
       <% if invitations.any? %>
         <table class="table table-condensed">
           <thead>
-            <th>Name</th>
             <th>E-mail</th>
-            <th>Action</th>
+            <th class="text-right">Action</th>
           </thead>
           <tbody>
             <% invitations.each do |invitation| %>
                 <% user = invitation.user %>
                 <tr>
-                  <td> <%= user.try(:name) %> </td>
                   <td> <%= user.try(:email) || invitation.email %> </td>
-                  <td>
+                  <td class="text-right">
                     <% if can? :edit, @specific_offerer  %>
                     <%= glyphicon_link_to :remove, 'Cancel Invitation',
                                           company_role_invitation_path(
@@ -65,7 +61,7 @@
                                               invitation
                                           ),
                                           method: :delete,
-                                          class: 'btn btn-info' %>
+                                          class: 'btn btn-sm btn-danger' %>
                       <% end %>
                   </td>
                 </tr>
diff --git a/base.Dockerfile b/base.Dockerfile
index 2b1235a9139118e5ee19fc290ef26717ae61e05f..1d1f752891b474adad72596e77e83ec647bf60b2 100644
--- a/base.Dockerfile
+++ b/base.Dockerfile
@@ -16,16 +16,13 @@ RUN mkdir chromedriver \
   && unzip chromedriver/chromedriver* -d /usr/local/bin \
   && rm -rf chromedriver
 
-# Switch to the app workdir
-WORKDIR "/projectforum"
-
 # Copy the gemfile
-COPY Gemfile Gemfile.lock /projectforum/
-COPY vendor /projectforum/vendor
+COPY Gemfile .
+COPY Gemfile.lock .
+COPY vendor vendor
 
 # Install packages
 RUN gem install bundler \
-  && bundle config path vendor \
   && bundle config set without 'production' \
   && bundle config set system 'true' \
   && bundle install
diff --git a/branch.Dockerfile b/branch.Dockerfile
index 897ba9b8b21c3e2a194bc4fefdf9cf76c890e894..fe64c164962c11b6938e06b1a20e9aeeb7cf7b5f 100644
--- a/branch.Dockerfile
+++ b/branch.Dockerfile
@@ -1,14 +1,10 @@
 
-# Switch to the app workdir
-WORKDIR "/projectforum"
-
 # Copy the gemfile
-COPY Gemfile Gemfile.lock /projectforum/
-COPY vendor /projectforum/vendor
+COPY Gemfile .
+COPY Gemfile.lock .
+COPY vendor vendor
 
 # Install packages
-RUN bundle config path vendor \
-  && bundle config set without 'production' \
+RUN bundle config set without 'production' \
   && bundle config set system 'true' \
-  && bundle install \
-  && bundle clean
+  && bundle install
diff --git a/config/database.ci.yml b/config/database.ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..fd546a7cf9153094b563de00f228cea69b666c50
--- /dev/null
+++ b/config/database.ci.yml
@@ -0,0 +1,21 @@
+default: &default
+  adapter: mysql2
+  encoding: utf8mb4
+  collation: utf8mb4_unicode_ci
+  host: mariadb
+  port: 3306
+  database: projectforum
+  username: root
+  password: root
+
+development:
+  <<: *default
+
+test:
+  <<: *default
+
+production:
+  <<: *default
+
+staging:
+  <<: *default
diff --git a/config/initializers/log_on_startup.rb b/config/initializers/log_on_startup.rb
index 4c9352f92b7d634062b9cff4c8a21bca8edd08cd..e3da3455d423f2f072b2da7b949fba682e53fdfb 100644
--- a/config/initializers/log_on_startup.rb
+++ b/config/initializers/log_on_startup.rb
@@ -1,5 +1,5 @@
 if Rails.env.development? || Rails.env.test?
-  Project_Forum::Application.load_tasks
+  Project_Forum::Application.load_tasks unless Rake::Task.task_defined?('log:clear')
   Rake::Task['log:clear'].invoke
 end
 
diff --git a/config/locales/models/generic_project/en.yml b/config/locales/models/generic_project/en.yml
index 678ad538edc9ec06cdbab397316907c80b103470..c0fdb2f022b30c217f33a9d1c9b7c40f1fa4ae2c 100644
--- a/config/locales/models/generic_project/en.yml
+++ b/config/locales/models/generic_project/en.yml
@@ -48,6 +48,7 @@ en:
         offerer: Offerer
         offerer_id: Offerer
         images: Images
+        shared_offerer_projects: Shared Access
 
         # Specific to this project type:
         requires_nda: Requires signing of Non-Disclosure Agreement
diff --git a/config/locales/models/generic_project/nl.yml b/config/locales/models/generic_project/nl.yml
index b779a8b79fee7055e14e69722d305493d1e73649..93999da8964f2c2fa4433189e6c7399759f9bcbc 100644
--- a/config/locales/models/generic_project/nl.yml
+++ b/config/locales/models/generic_project/nl.yml
@@ -48,6 +48,7 @@ nl:
         offerer: Aanbieder
         offerer_id: Aanbieder
         images: Afbeeldingen
+        shared_offerer_projects: Gedeelde toegang
 
         # Specific to this project type:
         requires_nda: Vereist tekenen van een geheimhoudingsverklaring
diff --git a/config/locales/models/project/en.yml b/config/locales/models/project/en.yml
index 780de1d8b6846c1f4243ecaaa272ca8177759a9b..f3539abe6705067f839c49aa2ccf5ff3419e2d5f 100644
--- a/config/locales/models/project/en.yml
+++ b/config/locales/models/project/en.yml
@@ -46,6 +46,7 @@ en:
         offerer_id: Offerer
         images: Images
         interested_coaches_count: Interested supervisors
+        shared_offerer_projects: Shared Access
 
     flashes:
       project:
diff --git a/config/locales/models/project/nl.yml b/config/locales/models/project/nl.yml
index 932b997790ed759cc7d685596efdf8195665b72c..d31610d7438dd502349f7715c14d8b81b166cdb4 100644
--- a/config/locales/models/project/nl.yml
+++ b/config/locales/models/project/nl.yml
@@ -46,6 +46,7 @@ nl:
         offerer_id: Aanbieder
         images: Afbeeldingen
         interested_coaches_count: Geïnteresseerde coaches
+        shared_offerer_projects: Gedeelde toegang
 
     flashes:
       project:
diff --git a/config/routes/normal.rb b/config/routes/normal.rb
index c99b8424a994f816b05c17509d3449be66669467..006dd68b528f6709553a49c8ddb0c77b2aac0adf 100644
--- a/config/routes/normal.rb
+++ b/config/routes/normal.rb
@@ -15,6 +15,8 @@ resources :generic_projects, path: 'projects' do
   member do
     post 'pause_recurrence'
     post 'resume_recurrence'
+    post 'add_shared_offerer'
+    post 'remove_shared_offerer'
   end
 end
 
diff --git a/db/migrate/20220827161203_add_shared_offerers.rb b/db/migrate/20220827161203_add_shared_offerers.rb
new file mode 100644
index 0000000000000000000000000000000000000000..6876da63aedc74d09f129de3628a457b9294d927
--- /dev/null
+++ b/db/migrate/20220827161203_add_shared_offerers.rb
@@ -0,0 +1,8 @@
+class AddSharedOfferers < ActiveRecord::Migration[6.1]
+  def change
+    create_table :shared_offerer_projects do |t|
+      t.belongs_to :offerer, index: true
+      t.belongs_to :project, index: true
+    end
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0f740f746a0ef11f247641b096512a7828d47ccb..5dcdc03eaf3dacd3ef1b0474b17b10d36eedecba 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -15,8 +15,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "active_storage_attachments", force: :cascade do |t|
     t.string "name", null: false
     t.string "record_type", null: false
-    t.integer "record_id", null: false
-    t.integer "blob_id", null: false
+    t.bigint "record_id", null: false
+    t.bigint "blob_id", null: false
     t.datetime "created_at", null: false
     t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
     t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
@@ -35,7 +35,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "active_storage_variant_records", force: :cascade do |t|
-    t.integer "blob_id", null: false
+    t.bigint "blob_id", null: false
     t.string "variation_digest", null: false
     t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
   end
@@ -43,7 +43,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "algorithm_param_sets", force: :cascade do |t|
     t.string "name"
     t.string "description"
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.integer "experiment_pref_matching"
     t.float "low_pref_couple", default: 5.0
     t.float "high_pref_couple", default: 100.0
@@ -57,17 +57,17 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.string "file_content_type"
     t.integer "file_file_size"
     t.datetime "file_updated_at"
-    t.integer "user_id", null: false
+    t.bigint "user_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
-    t.integer "group_id", null: false
+    t.bigint "group_id", null: false
     t.integer "file_type", default: 0
     t.index ["user_id"], name: "index_attachments_on_user_id"
   end
 
   create_table "availabilities", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "course_edition_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "course_edition_id", null: false
     t.integer "maximum"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
@@ -92,7 +92,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "company_user_email_suffixes", force: :cascade do |t|
-    t.integer "company_id"
+    t.bigint "company_id"
     t.string "suffix", null: false
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
@@ -106,7 +106,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.integer "max_number_of_groups", default: 1, null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.boolean "allow_internal", default: true
     t.boolean "allow_external", default: true
     t.text "project_description_template"
@@ -129,8 +129,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "course_edition_exclusivity_groups", force: :cascade do |t|
-    t.integer "course_edition_id", null: false
-    t.integer "exclusivity_group_id", null: false
+    t.bigint "course_edition_id", null: false
+    t.bigint "exclusivity_group_id", null: false
     t.index ["course_edition_id", "exclusivity_group_id"], name: "index_course_edition_exgroups_on_course_ed_id_and_ex_group_id"
     t.index ["course_edition_id"], name: "index_course_edition_exgroups_on_course_edition_id"
     t.index ["exclusivity_group_id"], name: "index_course_edition_exgroups_on_exclusivity_group_id"
@@ -138,7 +138,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "course_editions", force: :cascade do |t|
     t.string "name"
-    t.integer "course_id", null: false
+    t.bigint "course_id", null: false
     t.integer "status", default: 0
     t.date "starts_at"
     t.date "ends_at"
@@ -157,9 +157,9 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.text "proposal_template", default: ""
     t.text "information_for_supervisors"
     t.boolean "projects_public", default: false, null: false
-    t.integer "active_period_id"
+    t.bigint "active_period_id"
     t.boolean "recurrent", default: false, null: false
-    t.integer "recurrent_edition_id"
+    t.bigint "recurrent_edition_id"
     t.index ["active_period_id"], name: "index_course_editions_on_active_period_id"
     t.index ["course_id"], name: "index_course_editions_on_course_id"
     t.index ["recurrent_edition_id"], name: "index_course_editions_on_recurrent_edition_id"
@@ -171,15 +171,15 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.string "file_content_type"
     t.integer "file_file_size"
     t.datetime "file_updated_at"
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
-    t.integer "user_id", null: false
+    t.bigint "user_id", null: false
     t.index ["course_edition_id"], name: "index_course_files_on_course_edition_id"
   end
 
   create_table "course_participation_requests", force: :cascade do |t|
-    t.integer "course_participation_id", null: false
+    t.bigint "course_participation_id", null: false
     t.text "description"
     t.text "circumstances"
     t.text "planning"
@@ -189,13 +189,13 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "course_participations", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "course_edition_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "course_edition_id", null: false
     t.integer "status", default: 0, null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.text "status_motivation"
-    t.integer "programme_director_id"
+    t.bigint "programme_director_id"
     t.index ["course_edition_id"], name: "index_course_participations_on_course_edition_id"
     t.index ["programme_director_id"], name: "index_course_participations_on_programme_director_id"
     t.index ["user_id", "course_edition_id"], name: "index_course_participations_on_user_id_and_course_edition_id"
@@ -203,8 +203,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "course_programmes", force: :cascade do |t|
-    t.integer "course_id"
-    t.integer "programme_id"
+    t.bigint "course_id"
+    t.bigint "programme_id"
     t.index ["course_id"], name: "index_course_programmes_on_course_id"
     t.index ["programme_id"], name: "index_course_programmes_on_programme_id"
   end
@@ -213,7 +213,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.string "name", limit: 32, null: false
     t.text "description"
     t.integer "role_type", default: 0
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
     t.integer "assignment_rule", default: 0, null: false
@@ -231,7 +231,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "deadlines", force: :cascade do |t|
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.string "name"
     t.text "description"
     t.datetime "soft_at"
@@ -243,16 +243,16 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "departments", force: :cascade do |t|
     t.string "name", null: false
-    t.integer "faculty_id", null: false
+    t.bigint "faculty_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["faculty_id"], name: "index_departments_on_faculty_id"
   end
 
   create_table "event_resources", force: :cascade do |t|
-    t.integer "event_id", null: false
+    t.bigint "event_id", null: false
     t.string "resource_type", null: false
-    t.integer "resource_id", null: false
+    t.bigint "resource_id", null: false
     t.string "label"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
@@ -261,8 +261,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "events", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "resource_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "resource_id", null: false
     t.string "resource_type", null: false
     t.text "message_parameters"
     t.datetime "created_at", null: false
@@ -279,8 +279,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "experiment_preferences", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "experiment_project_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "experiment_project_id", null: false
     t.integer "priority"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
@@ -289,9 +289,9 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "experiment_profiles", force: :cascade do |t|
-    t.integer "user1_id"
-    t.integer "user2_id"
-    t.integer "experiment_project_id", null: false
+    t.bigint "user1_id"
+    t.bigint "user2_id"
+    t.bigint "experiment_project_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["experiment_project_id"], name: "index_experiment_profiles_on_experiment_project_id"
@@ -303,15 +303,15 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.string "name", null: false
     t.text "description"
     t.boolean "active", default: true
-    t.integer "department_id"
-    t.integer "course_edition_id", null: false
+    t.bigint "department_id"
+    t.bigint "course_edition_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.integer "round", default: 1, null: false
     t.integer "max_couples", default: 4, null: false
     t.integer "min_couples", default: 0
     t.boolean "theoretical", default: false
-    t.integer "original_experiment_project_id"
+    t.bigint "original_experiment_project_id"
     t.index ["course_edition_id"], name: "index_experiment_projects_on_course_edition_id"
     t.index ["department_id"], name: "index_experiment_projects_on_department_id"
     t.index ["original_experiment_project_id"], name: "index_experiment_projects_on_original_experiment_project_id"
@@ -331,7 +331,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "groups", force: :cascade do |t|
     t.integer "status", default: 0
-    t.integer "project_id", null: false
+    t.bigint "project_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.string "name", default: "Group"
@@ -342,7 +342,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "images", force: :cascade do |t|
     t.string "title"
-    t.integer "imageable_id"
+    t.bigint "imageable_id"
     t.string "imageable_type"
     t.string "file_file_name"
     t.string "file_content_type"
@@ -353,13 +353,13 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "import_entries", force: :cascade do |t|
-    t.integer "import_id"
+    t.bigint "import_id"
     t.integer "user_identifier_type", default: 0, null: false
     t.string "user_identifier_value"
     t.integer "participation_status", default: 0, null: false
-    t.integer "course_edition_id"
-    t.integer "user_id"
-    t.integer "course_participation_id"
+    t.bigint "course_edition_id"
+    t.bigint "user_id"
+    t.bigint "course_participation_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["course_edition_id"], name: "index_import_entries_on_course_edition_id"
@@ -370,7 +370,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "imports", force: :cascade do |t|
     t.string "name"
-    t.integer "course_edition_id"
+    t.bigint "course_edition_id"
     t.integer "status", default: 0, null: false
     t.text "text"
     t.integer "user_identifier_type", default: 0, null: false
@@ -382,8 +382,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "memberships", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "group_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "group_id", null: false
     t.integer "role", default: 0
     t.integer "status"
     t.datetime "created_at", null: false
@@ -393,8 +393,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "notes", force: :cascade do |t|
-    t.integer "group_id", null: false
-    t.integer "user_id", null: false
+    t.bigint "group_id", null: false
+    t.bigint "user_id", null: false
     t.text "content"
     t.integer "access_level", default: 0, null: false
     t.datetime "created_at", null: false
@@ -404,7 +404,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "notification_preferences", force: :cascade do |t|
-    t.integer "user_id", null: false
+    t.bigint "user_id", null: false
     t.string "resource_type", limit: 32
     t.string "action", limit: 32
     t.string "key", limit: 32
@@ -417,8 +417,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "notifications", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "event_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "event_id", null: false
     t.boolean "read", default: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
@@ -431,13 +431,13 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "offerers", force: :cascade do |t|
     t.integer "projects_count"
     t.string "actable_type"
-    t.integer "actable_id"
+    t.bigint "actable_id"
     t.index ["actable_type", "actable_id"], name: "index_offerers_on_actable"
   end
 
   create_table "periods", force: :cascade do |t|
     t.string "name"
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.integer "start_month", null: false
     t.integer "end_month", null: false
     t.index ["course_edition_id"], name: "index_periods_on_course_edition_id"
@@ -458,7 +458,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.string "group_name", default: "group", null: false
     t.string "project_name", default: "project", null: false
     t.string "company_name", default: "company", null: false
-    t.integer "programme_id", null: false
+    t.bigint "programme_id", null: false
     t.string "student_group_name", default: "project", null: false
     t.index ["programme_id"], name: "index_programme_configurations_on_programme_id"
   end
@@ -472,8 +472,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "project_interests", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "project_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "project_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["project_id"], name: "index_project_interests_on_project_id"
@@ -484,16 +484,16 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "project_periods", force: :cascade do |t|
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
-    t.integer "project_id", null: false
-    t.integer "period_id", null: false
+    t.bigint "project_id", null: false
+    t.bigint "period_id", null: false
     t.index ["period_id"], name: "index_project_periods_on_period_id"
     t.index ["project_id"], name: "index_project_periods_on_project_id"
   end
 
   create_table "project_preferences", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "project_id", null: false
-    t.integer "course_edition_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "project_id", null: false
+    t.bigint "course_edition_id", null: false
     t.integer "priority"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
@@ -507,16 +507,16 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.string "name"
     t.text "description"
     t.integer "status", default: 0
-    t.integer "course_edition_id", null: false
+    t.bigint "course_edition_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.text "other_information"
-    t.integer "original_project_id"
+    t.bigint "original_project_id"
     t.text "coordinator_message"
     t.text "status_message"
     t.string "actable_type"
-    t.integer "actable_id"
-    t.integer "offerer_id"
+    t.bigint "actable_id"
+    t.bigint "offerer_id"
     t.datetime "approved_at"
     t.text "project_abstract"
     t.index ["actable_type", "actable_id"], name: "index_projects_on_actable"
@@ -526,15 +526,15 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "research_group_programmes", force: :cascade do |t|
-    t.integer "research_group_id", null: false
-    t.integer "programme_id", null: false
+    t.bigint "research_group_id", null: false
+    t.bigint "programme_id", null: false
     t.index ["programme_id"], name: "index_research_group_programmes_on_programme_id"
     t.index ["research_group_id"], name: "index_research_group_programmes_on_research_group_id"
   end
 
   create_table "research_groups", force: :cascade do |t|
     t.string "name", null: false
-    t.integer "department_id"
+    t.bigint "department_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.text "description"
@@ -547,14 +547,14 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "role_invitations", force: :cascade do |t|
     t.string "name"
     t.integer "status", default: 0, null: false
-    t.integer "user_id"
+    t.bigint "user_id"
     t.string "resource_type", null: false
-    t.integer "resource_id", null: false
+    t.bigint "resource_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.string "email"
     t.string "associated_role_resource_type", limit: 64
-    t.integer "associated_role_resource_id"
+    t.bigint "associated_role_resource_id"
     t.index ["name", "resource_type", "resource_id"], name: "index_role_invitation_name_resource_id_and_type"
     t.index ["name"], name: "index_role_invitations_on_name"
     t.index ["resource_id"], name: "index_role_invitations_on_resource_id"
@@ -565,7 +565,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "roles", force: :cascade do |t|
     t.string "name"
     t.string "resource_type"
-    t.integer "resource_id"
+    t.bigint "resource_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
@@ -573,8 +573,15 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
     t.index ["resource_type", "resource_id"], name: "index_roles_on_resource_type_and_resource_id"
   end
 
+  create_table "shared_offerer_projects", force: :cascade do |t|
+    t.integer "offerer_id"
+    t.integer "project_id"
+    t.index ["offerer_id"], name: "index_shared_offerer_projects_on_offerer_id"
+    t.index ["project_id"], name: "index_shared_offerer_projects_on_project_id"
+  end
+
   create_table "sso_profiles", force: :cascade do |t|
-    t.integer "user_id", null: false
+    t.bigint "user_id", null: false
     t.string "netid"
     t.integer "student_number"
     t.datetime "created_at", null: false
@@ -585,9 +592,9 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "student_preferences", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "student_id", null: false
-    t.integer "course_edition_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "student_id", null: false
+    t.bigint "course_edition_id", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["course_edition_id"], name: "index_student_preferences_on_course_edition_id"
@@ -596,9 +603,9 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "taggings", force: :cascade do |t|
-    t.integer "tag_id", null: false
+    t.bigint "tag_id", null: false
     t.string "taggable_type", null: false
-    t.integer "taggable_id", null: false
+    t.bigint "taggable_id", null: false
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
     t.index ["tag_id"], name: "index_taggings_on_tag_id"
@@ -614,7 +621,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "temps", force: :cascade do |t|
     t.string "resource_type", null: false
-    t.integer "resource_id", null: false
+    t.bigint "resource_id", null: false
     t.string "temp_type", null: false
     t.text "value", limit: 4194304
     t.datetime "expires_at", null: false
@@ -624,8 +631,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "theme_associated_users", force: :cascade do |t|
-    t.integer "theme_id", null: false
-    t.integer "user_id", null: false
+    t.bigint "theme_id", null: false
+    t.bigint "user_id", null: false
     t.boolean "email"
     t.boolean "show"
     t.boolean "search"
@@ -636,12 +643,12 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "theme_interests", force: :cascade do |t|
-    t.integer "user_id"
-    t.integer "theme_id"
+    t.bigint "user_id"
+    t.bigint "theme_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.text "message"
-    t.integer "source_course_edition_id", null: false
+    t.bigint "source_course_edition_id", null: false
     t.date "thesis_start"
     t.boolean "archived", default: false, null: false
     t.index ["theme_id"], name: "index_theme_interests_on_theme_id"
@@ -650,7 +657,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "themes", force: :cascade do |t|
     t.string "name", null: false
-    t.integer "research_group_id"
+    t.bigint "research_group_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.text "description"
@@ -659,8 +666,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "thesis_project_associated_users", force: :cascade do |t|
-    t.integer "thesis_project_id", null: false
-    t.integer "user_id", null: false
+    t.bigint "thesis_project_id", null: false
+    t.bigint "user_id", null: false
     t.boolean "email"
     t.boolean "show"
     t.boolean "search"
@@ -671,15 +678,15 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "thesis_project_course_editions", force: :cascade do |t|
-    t.integer "thesis_project_id"
-    t.integer "course_edition_id"
+    t.bigint "thesis_project_id"
+    t.bigint "course_edition_id"
     t.index ["course_edition_id"], name: "index_thesis_project_course_editions_on_course_edition_id"
     t.index ["thesis_project_id"], name: "index_thesis_project_course_editions_on_thesis_project_id"
   end
 
   create_table "thesis_project_interests", force: :cascade do |t|
-    t.integer "user_id"
-    t.integer "thesis_project_id"
+    t.bigint "user_id"
+    t.bigint "thesis_project_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.text "message"
@@ -693,12 +700,12 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   create_table "thesis_projects", force: :cascade do |t|
     t.string "name", null: false
     t.text "description"
-    t.integer "course_edition_id"
-    t.integer "theme_id", null: false
-    t.integer "original_id"
+    t.bigint "course_edition_id"
+    t.bigint "theme_id", null: false
+    t.bigint "original_id"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
-    t.integer "creator_id", null: false
+    t.bigint "creator_id", null: false
     t.boolean "archived", default: false, null: false
     t.index ["creator_id"], name: "index_thesis_projects_on_creator_id"
     t.index ["original_id"], name: "index_thesis_projects_on_original_id"
@@ -706,10 +713,10 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "user_course_specific_roles", force: :cascade do |t|
-    t.integer "user_id"
-    t.integer "course_specific_role_id", null: false
+    t.bigint "user_id"
+    t.bigint "course_specific_role_id", null: false
     t.string "resource_type", null: false
-    t.integer "resource_id", null: false
+    t.bigint "resource_id", null: false
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
     t.string "unregistered_name"
@@ -720,8 +727,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "user_programmes", force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "programme_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "programme_id", null: false
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
     t.index ["programme_id"], name: "index_user_programmes_on_programme_id"
@@ -764,8 +771,8 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
   end
 
   create_table "users_roles", id: false, force: :cascade do |t|
-    t.integer "user_id", null: false
-    t.integer "role_id", null: false
+    t.bigint "user_id", null: false
+    t.bigint "role_id", null: false
     t.index ["role_id"], name: "index_users_roles_on_role_id"
     t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id", unique: true
     t.index ["user_id"], name: "index_users_roles_on_user_id"
@@ -773,7 +780,7 @@ ActiveRecord::Schema.define(version: 2022_08_30_133912) do
 
   create_table "versions", force: :cascade do |t|
     t.string "item_type", null: false
-    t.integer "item_id", null: false
+    t.bigint "item_id", null: false
     t.string "event", null: false
     t.string "whodunnit"
     t.text "object", limit: 1073741823
diff --git a/test/controllers/admin/companies_controller_test.rb b/test/controllers/admin/companies_controller_test.rb
index d90e2802056d3a455cc8d0d876efdf5bb9092dae..6834163c95bb6be4fb9f194ef1d2e5898641e2d9 100644
--- a/test/controllers/admin/companies_controller_test.rb
+++ b/test/controllers/admin/companies_controller_test.rb
@@ -3,7 +3,6 @@ require 'test_helper'
 module Admin
   class CompaniesControllerTest < ActionDispatch::IntegrationTest
     def setup
-      refresh_elasticsearch(Company)
       sign_in users(:admin)
     end
 
diff --git a/test/controllers/admin/course_editions_controller_test.rb b/test/controllers/admin/course_editions_controller_test.rb
index b69e947b40a85129ba85718f7f6c74752d4c67d4..bc1b0beb862f3d1a6580437a3d90c1e0dcd71394 100644
--- a/test/controllers/admin/course_editions_controller_test.rb
+++ b/test/controllers/admin/course_editions_controller_test.rb
@@ -93,8 +93,6 @@ module Admin
     end
 
     test 'duplicating recurrent course edition' do
-      refresh_elasticsearch(Project)
-
       course = courses(:internship_practicum)
       edition = course_editions(:internship_practicum_recurrent)
 
diff --git a/test/controllers/admin/generic_projects_controller_test.rb b/test/controllers/admin/generic_projects_controller_test.rb
index c5fc878d8999ca50bd59ced156ffa36b61662426..a6d60c4327835e0731224a7895dbcd8e3fb9b937 100644
--- a/test/controllers/admin/generic_projects_controller_test.rb
+++ b/test/controllers/admin/generic_projects_controller_test.rb
@@ -31,8 +31,6 @@ module Admin
     end
 
     test 'approving recurrent project copies it to existing matching editions' do
-      refresh_elasticsearch(Project)
-
       course = courses(:internship_practicum)
       recurrent_edition = course_editions(:internship_practicum_recurrent)
 
diff --git a/test/controllers/admin/theme_associated_users_controller_test.rb b/test/controllers/admin/theme_associated_users_controller_test.rb
index b093ad41d9c27a2c8df38e240d9c520f98754bfe..759fb144598b0f982455b84f3113c879194aca94 100644
--- a/test/controllers/admin/theme_associated_users_controller_test.rb
+++ b/test/controllers/admin/theme_associated_users_controller_test.rb
@@ -3,7 +3,6 @@ require 'test_helper'
 module Admin
   class ThemeAssociatedUsersControllerTest < ActionDispatch::IntegrationTest
     setup do
-      refresh_elasticsearch(Theme)
       sign_in users(:research_group_member_2)
 
       @theme = themes(:visualization)
diff --git a/test/controllers/admin/themes_controller_test.rb b/test/controllers/admin/themes_controller_test.rb
index 81ed9748729aa43b4ed543ff5ef74c979846fd69..33c3e761870581dfd025dff16039ea1806fbfd54 100644
--- a/test/controllers/admin/themes_controller_test.rb
+++ b/test/controllers/admin/themes_controller_test.rb
@@ -3,8 +3,6 @@ require 'test_helper'
 module Admin
   class ThemesControllerTest < ActionDispatch::IntegrationTest
     setup do
-      refresh_elasticsearch(Theme)
-
       @user = users(:research_group_member_2)
       sign_in @user
 
diff --git a/test/controllers/admin/thesis_project_associated_users_controller_test.rb b/test/controllers/admin/thesis_project_associated_users_controller_test.rb
index d3ba14429c6875046933bf42cf4e9bf09f0006b4..7665c1935a0004b6b62b5ac8add6c1651bbd6b2e 100644
--- a/test/controllers/admin/thesis_project_associated_users_controller_test.rb
+++ b/test/controllers/admin/thesis_project_associated_users_controller_test.rb
@@ -3,7 +3,6 @@ require 'test_helper'
 module Admin
   class ThesisProjectAssociatedUsersControllerTest < ActionDispatch::IntegrationTest
     setup do
-      refresh_elasticsearch(ThesisProject)
       sign_in users(:research_group_member_2)
 
       @thesis_project = thesis_projects(:rendering2)
diff --git a/test/controllers/admin/thesis_projects_controller_test.rb b/test/controllers/admin/thesis_projects_controller_test.rb
index 39d8dbc5c2bf0ab30122c589dc7aff4954472ae1..2e698c6abe7bc1993a6e7f91969952448bb0e828 100644
--- a/test/controllers/admin/thesis_projects_controller_test.rb
+++ b/test/controllers/admin/thesis_projects_controller_test.rb
@@ -3,8 +3,6 @@ require 'test_helper'
 module Admin
   class ThesisProjectsControllerTest < ActionDispatch::IntegrationTest
     setup do
-      refresh_elasticsearch(ThesisProject)
-
       @user = users(:research_group_member_2)
       sign_in @user
 
diff --git a/test/controllers/course_editions/projects_controller_test.rb b/test/controllers/course_editions/projects_controller_test.rb
index bd2d64ea813e215fdded21ab374069ed8ac38a90..d3642c68261caf10215adac222faf06a2310de3f 100644
--- a/test/controllers/course_editions/projects_controller_test.rb
+++ b/test/controllers/course_editions/projects_controller_test.rb
@@ -15,7 +15,6 @@ module CourseEditions
 
     test 'user can search for projects in course edition 1' do
       @project = projects(:search_project_1)
-      refresh_elasticsearch(Project)
       get course_edition_projects_path(@course_edition, query: @project.name)
       assert_response :success
 
@@ -27,7 +26,6 @@ module CourseEditions
     test 'user can search for projects in course edition 2' do
       @project = projects(:search_project_2)
       @project2 = projects(:search_project_3)
-      refresh_elasticsearch(Project)
       get course_edition_projects_path(@course_edition, query: @project.name)
       assert_response :success
 
diff --git a/test/controllers/course_editions/themes_controller_test.rb b/test/controllers/course_editions/themes_controller_test.rb
index a32bfd7ef32024735333b29c8b1aa1a58c3f6ff3..c6878396c783bc82641a0ec9d1d6b6557c47d03b 100644
--- a/test/controllers/course_editions/themes_controller_test.rb
+++ b/test/controllers/course_editions/themes_controller_test.rb
@@ -20,8 +20,6 @@ module CourseEditions
     end
 
     test 'enrolled student can search themes' do
-      refresh_elasticsearch(Theme)
-
       get course_edition_themes_path(@course_edition), params: {
         query: [@theme_spoofax.name]
       }
diff --git a/test/controllers/course_editions/thesis_projects_controller_test.rb b/test/controllers/course_editions/thesis_projects_controller_test.rb
index 41b68c5b85af9e41fef97b8104abe8eb389d7164..2a444d6547605065aff5b9a14ac3290bb859fafc 100644
--- a/test/controllers/course_editions/thesis_projects_controller_test.rb
+++ b/test/controllers/course_editions/thesis_projects_controller_test.rb
@@ -21,8 +21,6 @@ module CourseEditions
     # end
     #
     # test 'enrolled student can search thesis projects' do
-    #   refresh_elasticsearch(ThesisProject)
-    #
     #   get course_edition_thesis_projects_path(@course_edition), params: {
     #     query: [@thesis_project_statix.name]
     #   }
diff --git a/test/controllers/generic_projects_controller_test.rb b/test/controllers/generic_projects_controller_test.rb
index a824b9fc15f5840fd511ef330f7fabf595d776c7..8601a02af95be9520c93502ee0dbf50f3cbf95d0 100644
--- a/test/controllers/generic_projects_controller_test.rb
+++ b/test/controllers/generic_projects_controller_test.rb
@@ -1,10 +1,6 @@
 require 'test_helper'
 
 class GenericProjectsControllerTest < ActionDispatch::IntegrationTest
-  def setup
-    refresh_elasticsearch(Project)
-  end
-
   test 'student can go to show page' do
     @project = projects(:bepsys)
     sign_in users(:student)
@@ -82,4 +78,89 @@ class GenericProjectsControllerTest < ActionDispatch::IntegrationTest
       delete generic_project_path(@project)
     end
   end
+
+  # offerers accessing own projects
+
+  test 'company offerer can edit own shared project' do
+    @project = projects(:company_project_with_shared_offerer_user)
+    sign_in users(:external)
+    get edit_generic_project_path(@project)
+    assert_response :success
+  end
+
+  test 'user offerer can edit own shared project' do
+    @project = projects(:user_project_with_shared_offerer_company)
+    sign_in users(:external_beta)
+    get edit_generic_project_path(@project)
+    assert_response :success
+  end
+
+  test 'research group offerer can edit own shared project' do
+    @project = projects(:research_group_project_with_shared_offerer_company)
+    sign_in users(:research_group_member)
+    get edit_generic_project_path(@project)
+    assert_response :success
+  end
+
+  # shared offerers accessing shared projects
+
+  test 'company shared offerer can edit shared project' do
+    @project = projects(:company_project_with_shared_offerer_company)
+    sign_in users(:external)
+    get edit_generic_project_path(@project)
+    assert_response :success
+  end
+
+  test 'user shared offerer can edit shared project' do
+    @project = projects(:company_project_with_shared_offerer_user)
+    sign_in users(:external_beta)
+    get edit_generic_project_path(@project)
+    assert_response :success
+  end
+
+  test 'research group shared offerer can edit shared project' do
+    @project = projects(:company_project_with_shared_offerer_research_group)
+    sign_in users(:research_group_member)
+    get edit_generic_project_path(@project)
+    assert_response :success
+  end
+
+  test 'company shared offerer cannot delete shared project' do
+    @project = projects(:company_project_with_shared_offerer_company)
+    sign_in users(:external)
+    assert_no_difference('Project.count') do
+      delete generic_project_path(@project)
+    end
+    assert_response :forbidden
+  end
+
+  test 'company employee cannot edit project shared with another company' do
+    @project = projects(:user_project_with_shared_offerer_company)
+    sign_in users(:external)
+    get edit_generic_project_path(@project)
+    assert_response :forbidden
+  end
+
+  test 'user cannot edit project shared with another user' do
+    @project = projects(:company_project_with_shared_offerer_user)
+    sign_in users(:staff)
+    get edit_generic_project_path(@project)
+    assert_response :forbidden
+  end
+
+  test 'company employee cannot delete project shared with another company' do
+    @project = projects(:user_project_with_shared_offerer_company)
+    sign_in users(:external)
+    assert_no_difference('Project.count') do
+      delete generic_project_path(@project)
+    end
+    assert_response :forbidden
+  end
+
+  test 'company employee cannot edit non-shared project of company they share other projects with' do
+    @project = projects(:project_second_offerer)
+    sign_in users(:external)
+    get edit_generic_project_path(@project)
+    assert_response :forbidden
+  end
 end
diff --git a/test/fixtures/generic_projects.yml b/test/fixtures/generic_projects.yml
index aa5e1b295fda333afa886c16866817a7bfe4cf1c..ae85484e2ccba8d37b2e40f3700792e724808852 100644
--- a/test/fixtures/generic_projects.yml
+++ b/test/fixtures/generic_projects.yml
@@ -76,6 +76,24 @@ recurring_edition_project_not_approved:
 recurring_edition_project_rejected:
   requires_nda: false
 
+# projects with shared offerers
+company_project_with_shared_offerer_research_group:
+  requires_nda: false
+
+research_group_project_with_shared_offerer_company:
+  requires_nda: false
+
+company_project_with_shared_offerer_user:
+  requires_nda: false
+
+user_project_with_shared_offerer_company:
+  requires_nda: false
+
+company_project_with_shared_offerer_company:
+  requires_nda: false
+
+project_second_offerer:
+  requires_nda: false
 
 # Projects for testing the cleanup_after_approval course configuration functionality.
 cleanup_after_client_approval_1:
diff --git a/test/fixtures/offerers.yml b/test/fixtures/offerers.yml
index 706bc4d35a3eb520d84b15d000a23e37b3dedd09..bc54df21ac3029d67ae4df6c598ec1d580f0a1ba 100644
--- a/test/fixtures/offerers.yml
+++ b/test/fixtures/offerers.yml
@@ -7,3 +7,15 @@ offerer:
 offerer_second:
   actable: company_second
   actable_type: 'Company'
+
+research_group_offerer:
+  actable: algorithmics
+  actable_type: ResearchGroup
+
+user_personal_offerer:
+  actable: external_beta
+  actable_type: User
+
+user_personal_offerer_internal:
+  actable: staff
+  actable_type: User
diff --git a/test/fixtures/projects.yml b/test/fixtures/projects.yml
index 4a4f20306245cc083efb7888228c966bb6f86846..3030b543fa69bea072d4c6a2b504aca11f9c6923 100644
--- a/test/fixtures/projects.yml
+++ b/test/fixtures/projects.yml
@@ -214,6 +214,54 @@ recurring_edition_project_not_approved:
   offerer: offerer
   actable: $LABEL (GenericProject)
 
+# projects with shared offerers
+company_project_with_shared_offerer_research_group:
+  name: Company project with research group shared offerer
+  status: pending
+  course_edition: internship_practicum_recurrent
+  offerer: offerer
+  shared_offerers: research_group_offerer
+  actable: $LABEL (GenericProject)
+
+research_group_project_with_shared_offerer_company:
+  name: Research group project with company shared offerer
+  status: pending
+  course_edition: internship_practicum_recurrent
+  offerer: research_group_offerer
+  shared_offerers: offerer_second
+  actable: $LABEL (GenericProject)
+
+company_project_with_shared_offerer_user:
+  name: Company project with user shared offerer
+  status: pending
+  course_edition: internship_practicum_recurrent
+  offerer: offerer
+  shared_offerers: user_personal_offerer
+  actable: $LABEL (GenericProject)
+
+user_project_with_shared_offerer_company:
+  name: User project with company shared offerer
+  status: pending
+  course_edition: internship_practicum_recurrent
+  offerer: user_personal_offerer
+  shared_offerers: offerer_second
+  actable: $LABEL (GenericProject)
+
+company_project_with_shared_offerer_company:
+  name: Company project with company shared offerer
+  status: pending
+  course_edition: internship_practicum_recurrent
+  offerer: offerer_second
+  shared_offerers: offerer
+  actable: $LABEL (GenericProject)
+
+project_second_offerer:
+  name: Dummy project second offerer
+  status: pending
+  course_edition: internship_practicum_recurrent
+  offerer: offerer_second
+  actable: $LABEL (GenericProject)
+
 recurring_edition_project_rejected:
   name: Recurring rejected
   status: rejected
diff --git a/test/rights/admin/basic_admin_rights_test.rb b/test/rights/admin/basic_admin_rights_test.rb
index 811c8ea0d7c9efc7bbcb99abab3c89ebcc6fe290..524ac29b0889a3a3d5d496a20f2ec691683d949c 100644
--- a/test/rights/admin/basic_admin_rights_test.rb
+++ b/test/rights/admin/basic_admin_rights_test.rb
@@ -28,8 +28,6 @@ module Admin
       end
 
       test 'ADMIN: [Basic Right] user can update their own thesis projects' do
-        refresh_elasticsearch(ThesisProject)
-
         @current_user.associated_thesis_projects.each do |thesis_project|
           new_description = "#{thesis_project.description} Modified"
           patch admin_thesis_project_path(thesis_project), params: {
@@ -41,8 +39,6 @@ module Admin
           thesis_project.reload
           assert_equal new_description, thesis_project.description
         end
-
-        refresh_elasticsearch(ThesisProject)
       end
 
       test 'ADMIN: [Basic Right] user can show their own themes' do
@@ -60,8 +56,6 @@ module Admin
       end
 
       test 'ADMIN: [Basic Right] user can update their own themes' do
-        refresh_elasticsearch(Theme)
-
         @current_user.associated_themes.each do |theme|
           new_description = "#{theme.description} Modified"
           patch admin_theme_path(theme), params: {
@@ -72,8 +66,6 @@ module Admin
           theme.reload
           assert_equal new_description, theme.description
         end
-
-        refresh_elasticsearch(Theme)
       end
     end
   end
diff --git a/test/rights/admin/department_coordinator_rights_test.rb b/test/rights/admin/department_coordinator_rights_test.rb
index c2f93dace0e6b49cfa97c61c62a5490edf2f57ba..41e76f4fa755cde2ffcd593e1eff828dd536c782 100644
--- a/test/rights/admin/department_coordinator_rights_test.rb
+++ b/test/rights/admin/department_coordinator_rights_test.rb
@@ -3,8 +3,6 @@ require 'test_helper'
 module Admin
   class DepartmentCoordinatorRightsTest < ActionDispatch::IntegrationTest
     def setup
-      refresh_elasticsearch(ResearchGroup)
-
       @current_user = users(:department_coordinator)
       sign_in @current_user
       @department = departments(:st)
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 0bb4c1b8fbc3f26ee9b4c4f14d8940019b5e5389..9140ac750cad51b9a3468ded5269704b968232c2 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -22,14 +22,18 @@ unless ENV['RM_INFO']
   ]
 end
 
-# Setup elasticsearch
-puts 'Setting up ElasticSearch...'
-ResearchGroup.__elasticsearch__.import(force: true)
-Theme.__elasticsearch__.import(force: true)
-ThesisProject.__elasticsearch__.import(force: true)
-Project.__elasticsearch__.import(force: true)
-Company.__elasticsearch__.import(force: true)
-puts 'Finished setting up ElasticSearch'
+puts 'Creating ElasticSearch indices...'
+ResearchGroup.__elasticsearch__.create_index! force: true
+ResearchGroup.__elasticsearch__.refresh_index!
+Theme.__elasticsearch__.create_index! force: true
+Theme.__elasticsearch__.refresh_index!
+ThesisProject.__elasticsearch__.create_index! force: true
+ThesisProject.__elasticsearch__.refresh_index!
+Project.__elasticsearch__.create_index! force: true
+Project.__elasticsearch__.refresh_index!
+Company.__elasticsearch__.create_index! force: true
+Company.__elasticsearch__.refresh_index!
+puts 'Created ElasticSearch indices'
 
 module ActiveSupport
   class TestCase
@@ -42,16 +46,24 @@ module ActiveSupport
     # Fixes project paths
     include ActableHelper
 
-    # Add more helper methods to be used by all tests here...
-    #
-    # @param models [Class<ActiveRecord::Base>, Array] the model or models to refresh the indices from
-    def refresh_elasticsearch(models)
-      if models.is_a?(Array)
-        models.each { |model| refresh_elasticsearch(model) }
-      else
-        models.__elasticsearch__.import(force: true)
-        models.__elasticsearch__.refresh_index!
-      end
+    @@synced_elasticsearch = false
+
+    setup do
+      resync_elasticsearch unless @@synced_elasticsearch
+    end
+
+    # Resyncs elasticsearch with the information in the database.
+    # Intended to be called only once (before all tests after fixtures are loaded),
+    # but can be used to force a resync.
+    def resync_elasticsearch
+      puts 'Syncing ElasticSearch with Fixtures...'
+      ResearchGroup.__elasticsearch__.import(force: true)
+      Theme.__elasticsearch__.import(force: true)
+      ThesisProject.__elasticsearch__.import(force: true)
+      Project.__elasticsearch__.import(force: true)
+      Company.__elasticsearch__.import(force: true)
+      @@synced_elasticsearch = true
+      puts 'Finished synching ElasticSearch'
     end
 
     # Asserts that the given event occurs.