Repository: owncloud/ocis
Pull request #5417 (2023-01-17 16:47:00)

[test-only] ApiTest. deleteTag test. increase coverage
- added test for deleting tags

update-docs[bot]: Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis/blob/master/changelog/README.md) item based on your changes.

ownclouders: :boom: Acceptance test [<strong>localApiTests-apiSpaces-ocis</strong>](https://drone.owncloud.com/owncloud/ocis/18331/45/1) failed. Further test are cancelled...
<!-- id: pr-5417 -->


Patch:
diff --git a/.drone.star b/.drone.star
index 38e51c05712..23214b14739 100644
--- a/.drone.star
+++ b/.drone.star
@@ -889,7 +889,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac
                              "UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0,
                          },
                          "commands": [
-                             "make -C %s test-acceptance-core-api" % (dirs["base"]),
+                             "make -C %s test-acceptance-from-core-api" % (dirs["base"]),
                          ],
                      },
                  ] + failEarly(ctx, early_fail),
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4c1a3dd2904..78f64c73034 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The following sections list the changes for unreleased.
 * Bugfix - Disassociate users from deleted school: [#5343](https://github.com/owncloud/ocis/pull/5343)
 * Bugfix - Fix Postprocessing events: [#5269](https://github.com/owncloud/ocis/pull/5269)
 * Bugfix - Fix Search tag indexing: [#5405](https://github.com/owncloud/ocis/pull/5405)
+* Bugfix - Populate expanded properties: [#5421](https://github.com/owncloud/ocis/pull/5421)
 * Enhancement - Add global env variable extractor: [#5164](https://github.com/owncloud/ocis/pull/5164)
 * Enhancement - Async Postprocessing: [#5207](https://github.com/owncloud/ocis/pull/5207)
 * Enhancement - Bump libre-graph-api-go: [#5309](https://github.com/owncloud/ocis/pull/5309)
diff --git a/Makefile b/Makefile
index d9e993d8ea1..61c4ef3820e 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ help:
 	@echo -e "${GREEN}Testing with test suite natively installed:${RESET}\n"
 	@echo -e "${PURPLE}\tdocs: https://owncloud.dev/ocis/development/testing/#testing-with-test-suite-natively-installed${RESET}\n"
 	@echo -e "\tmake test-acceptance-api\t\t${BLUE}run API acceptance tests${RESET}"
-	@echo -e "\tmake test-acceptance-core-api\t\t${BLUE}run core API acceptance tests${RESET}"
+	@echo -e "\tmake test-acceptance-from-core-api\t\t${BLUE}run core API acceptance tests${RESET}"
 	@echo -e "\tmake test-paralleldeployment-api\t${BLUE}run API acceptance tests for parallel deployment${RESET}"
 	@echo -e "\tmake clean-tests\t\t\t${BLUE}delete API tests framework dependencies${RESET}"
 	@echo
@@ -111,8 +111,8 @@ CORE_BEHAT_YML=tests/acceptance/config/behat-core.yml
 test-acceptance-api: vendor-bin/behat/vendor
 	BEHAT_BIN=$(BEHAT_BIN) $(PWD)/tests/acceptance/run.sh --type api
 
-.PHONY: test-acceptance-core-api
-test-acceptance-core-api: vendor-bin/behat/vendor
+.PHONY: test-acceptance-from-core-api
+test-acceptance-from-core-api: vendor-bin/behat/vendor
 	BEHAT_BIN=$(BEHAT_BIN) BEHAT_YML=$(CORE_BEHAT_YML) $(PWD)/tests/acceptance/run.sh --type core-api
 
 .PHONY: test-paralleldeployment-api
diff --git a/changelog/unreleased/populate-expanded-properties.md b/changelog/unreleased/populate-expanded-properties.md
new file mode 100644
index 00000000000..b3ea06a4357
--- /dev/null
+++ b/changelog/unreleased/populate-expanded-properties.md
@@ -0,0 +1,6 @@
+Bugfix: Populate expanded properties
+
+We now return an empty array when an expanded relation has no entries. This makes consuming the responses a little easier.
+
+https://github.com/owncloud/ocis/pull/5421
+https://github.com/owncloud/ocis/issues/5419
\ No newline at end of file
diff --git a/services/graph/pkg/config/config.go b/services/graph/pkg/config/config.go
index 5b2f00e5189..dc90b8ef4bd 100644
--- a/services/graph/pkg/config/config.go
+++ b/services/graph/pkg/config/config.go
@@ -92,7 +92,8 @@ type Identity struct {
 
 // API represents API configuration parameters.
 type API struct {
-	GroupMembersPatchLimit int `yaml:"group_members_patch_limit" env:"GRAPH_GROUP_MEMBERS_PATCH_LIMIT" desc:"The amount of group members allowed to be added with a single patch request."`
+	GroupMembersPatchLimit int    `yaml:"group_members_patch_limit" env:"GRAPH_GROUP_MEMBERS_PATCH_LIMIT" desc:"The amount of group members allowed to be added with a single patch request."`
+	UsernameMatch          string `yaml:"graph_username_match" env:"GRAPH_USERNAME_MATCH" desc:"Option to allow legacy usernames. Supported options are 'default' and 'none'."`
 }
 
 // Events combines the configuration options for the event bus.
diff --git a/services/graph/pkg/config/defaults/defaultconfig.go b/services/graph/pkg/config/defaults/defaultconfig.go
index 023efe04939..1c494566ef1 100644
--- a/services/graph/pkg/config/defaults/defaultconfig.go
+++ b/services/graph/pkg/config/defaults/defaultconfig.go
@@ -36,6 +36,7 @@ func DefaultConfig() *config.Config {
 		},
 		API: config.API{
 			GroupMembersPatchLimit: 20,
+			UsernameMatch:          "default",
 		},
 		Reva: shared.DefaultRevaConfig(),
 		Spaces: config.Spaces{
diff --git a/services/graph/pkg/config/parser/parse.go b/services/graph/pkg/config/parser/parse.go
index ffd91247ea8..6f48d5c4833 100644
--- a/services/graph/pkg/config/parser/parse.go
+++ b/services/graph/pkg/config/parser/parse.go
@@ -52,5 +52,15 @@ func Validate(cfg *config.Config) error {
 			"graph", defaults2.BaseConfigPath())
 	}
 
+	switch cfg.API.UsernameMatch {
+	case "default", "none":
+	default:
+		return fmt.Errorf("The username match validator is invalid for %s. "+
+			"Make sure your %s config contains the proper values "+
+			"(e.g. by running ocis init or setting it manually in "+
+			"the config/corresponding environment variable).",
+			"graph", defaults2.BaseConfigPath())
+	}
+
 	return nil
 }
diff --git a/services/graph/pkg/identity/ldap.go b/services/graph/pkg/identity/ldap.go
index a7a34ec932d..ade4a9e2d04 100644
--- a/services/graph/pkg/identity/ldap.go
+++ b/services/graph/pkg/identity/ldap.go
@@ -387,10 +387,7 @@ func (i *LDAP) GetUser(ctx context.Context, nameOrID string, queryParam url.Valu
 		if err != nil {
 			return nil, err
 		}
-		if len(userGroups) > 0 {
-			groups := i.groupsFromLDAPEntries(userGroups)
-			u.MemberOf = groups
-		}
+		u.MemberOf = i.groupsFromLDAPEntries(userGroups)
 	}
 	return u, nil
 }
@@ -454,14 +451,7 @@ func (i *LDAP) GetUsers(ctx context.Context, queryParam url.Values) ([]*libregra
 			if err != nil {
 				return nil, err
 			}
-			if len(userGroups) > 0 {
-				expand := ldap.EscapeFilter(queryParam.Get("expand"))
-				if expand == "" {
-					expand = "false"
-				}
-				groups := i.groupsFromLDAPEntries(userGroups)
-				u.MemberOf = groups
-			}
+			u.MemberOf = i.groupsFromLDAPEntries(userGroups)
 		}
 		users = append(users, u)
 	}
diff --git a/services/graph/pkg/identity/ldap_group.go b/services/graph/pkg/identity/ldap_group.go
index 49a0d1e6399..70027ed1f6b 100644
--- a/services/graph/pkg/identity/ldap_group.go
+++ b/services/graph/pkg/identity/ldap_group.go
@@ -41,14 +41,13 @@ func (i *LDAP) GetGroup(ctx context.Context, nameOrID string, queryParam url.Val
 		if err != nil {
 			return nil, err
 		}
+		g.Members = make([]libregraph.User, 0, len(members))
 		if len(members) > 0 {
-			m := make([]libregraph.User, 0, len(members))
 			for _, ue := range members {
 				if u := i.createUserModelFromLDAP(ue); u != nil {
-					m = append(m, *u)
+					g.Members = append(g.Members, *u)
 				}
 			}
-			g.Members = m
 		}
 	}
 	return g, nil
@@ -120,14 +119,13 @@ func (i *LDAP) GetGroups(ctx context.Context, queryParam url.Values) ([]*libregr
 			if err != nil {
 				return nil, err
 			}
+			g.Members = make([]libregraph.User, 0, len(members))
 			if len(members) > 0 {
-				m := make([]libregraph.User, 0, len(members))
 				for _, ue := range members {
 					if u := i.createUserModelFromLDAP(ue); u != nil {
-						m = append(m, *u)
+						g.Members = append(g.Members, *u)
 					}
 				}
-				g.Members = m
 			}
 		}
 		groups = append(groups, g)
diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go
index c106d2ed781..29a4e27ad8b 100644
--- a/services/graph/pkg/service/v0/drives.go
+++ b/services/graph/pkg/service/v0/drives.go
@@ -478,8 +478,10 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces
 		// can't access disabled space
 		if utils.ReadPlainFromOpaque(storageSpace.Opaque, "trashed") != "trashed" {
 			res.Special = g.getExtendedSpaceProperties(ctx, baseURL, storageSpace)
-			res.Quota, err = g.getDriveQuota(ctx, storageSpace)
+			quota, err := g.getDriveQuota(ctx, storageSpace)
+			res.Quota = &quota
 			if err != nil {
+				//logger.Debug().Err(err).Interface("id", sp.Id).Msg("error calling get quota on drive")
 				return nil, err
 			}
 		}
@@ -718,6 +720,8 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
 		lastModified := cs3TimestampToTime(space.Mtime)
 		drive.LastModifiedDateTime = &lastModified
 	}
+
+	drive.Quota = &libregraph.Quota{}
 	if space.Quota != nil {
 		var t int64
 		if space.Quota.QuotaMaxBytes > math.MaxInt64 {
@@ -725,15 +729,13 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
 		} else {
 			t = int64(space.Quota.QuotaMaxBytes)
 		}
-		drive.Quota = &libregraph.Quota{
-			Total: &t,
-		}
+		drive.Quota.Total = &t
 	}
 
 	return drive, nil
 }
 
-func (g Graph) getDriveQuota(ctx context.Context, space *storageprovider.StorageSpace) (*libregraph.Quota, error) {
+func (g Graph) getDriveQuota(ctx context.Context, space *storageprovider.StorageSpace) (libregraph.Quota, error) {
 	logger := g.logger.SubloggerWithRequestID(ctx)
 	client := g.GetGatewayClient()
 
@@ -747,13 +749,13 @@ func (g Graph) getDriveQuota(ctx context.Context, space *storageprovider.Storage
 	switch {
 	case err != nil:
 		logger.Error().Err(err).Interface("ref", req.Ref).Msg("could not call GetQuota: transport error")
-		return nil, nil
+		return libregraph.Quota{}, nil
 	case res.GetStatus().GetCode() == cs3rpc.Code_CODE_UNIMPLEMENTED:
 		logger.Debug().Msg("get quota is not implemented on the storage driver")
-		return nil, nil
+		return libregraph.Quota{}, nil
 	case res.GetStatus().GetCode() != cs3rpc.Code_CODE_OK:
 		logger.Debug().Str("grpc", res.GetStatus().GetMessage()).Msg("error sending get quota grpc request")
-		return nil, errors.New(res.GetStatus().GetMessage())
+		return libregraph.Quota{}, errors.New(res.GetStatus().GetMessage())
 	}
 
 	var remaining int64
@@ -783,7 +785,7 @@ func (g Graph) getDriveQuota(ctx context.Context, space *storageprovider.Storage
 	state := calculateQuotaState(t, used)
 	qta.State = &state
 
-	return &qta, nil
+	return qta, nil
 }
 
 func calculateQuotaState(total int64, used int64) (state string) {
diff --git a/services/graph/pkg/service/v0/educationuser.go b/services/graph/pkg/service/v0/educationuser.go
index 611a3d38935..1ce9dae2a24 100644
--- a/services/graph/pkg/service/v0/educationuser.go
+++ b/services/graph/pkg/service/v0/educationuser.go
@@ -112,7 +112,7 @@ func (g Graph) PostEducationUser(w http.ResponseWriter, r *http.Request) {
 	}
 
 	if accountName, ok := u.GetOnPremisesSamAccountNameOk(); ok {
-		if !isValidUsername(*accountName) {
+		if !g.isValidUsername(*accountName) {
 			logger.Debug().Str("username", *accountName).Msg("could not create education user: username must be at least the local part of an email")
 			errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, fmt.Sprintf("username %s must be at least the local part of an email", *u.OnPremisesSamAccountName))
 			return
@@ -257,7 +257,7 @@ func (g Graph) GetEducationUser(w http.ResponseWriter, r *http.Request) {
 			if err != nil {
 				logger.Debug().Err(err).Interface("id", sp.Id).Msg("error calling get quota on drive")
 			}
-			d.Quota = quota
+			d.Quota = &quota
 			if slices.Contains(sel, "drive") || slices.Contains(exp, "drive") {
 				if *d.DriveType == _spaceTypePersonal {
 					user.Drive = d
diff --git a/services/graph/pkg/service/v0/users.go b/services/graph/pkg/service/v0/users.go
index b37180b12d5..c0bddc77752 100644
--- a/services/graph/pkg/service/v0/users.go
+++ b/services/graph/pkg/service/v0/users.go
@@ -1,6 +1,7 @@
 package svc
 
 import (
+	"context"
 	"encoding/json"
 	"errors"
 	"fmt"
@@ -57,13 +58,15 @@ func (g Graph) GetMe(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		if me.MemberOf == nil {
+			me.MemberOf = []libregraph.Group{}
+		}
 	}
 
 	// expand appRoleAssignments if requested
 	if slices.Contains(exp, "appRoleAssignments") {
-		lrar, err := g.roleService.ListRoleAssignments(r.Context(), &settings.ListRoleAssignmentsRequest{
-			AccountUuid: me.GetId(),
-		})
+		var err error
+		me.AppRoleAssignments, err = g.fetchAppRoleAssignments(r.Context(), me.GetId())
 		if err != nil {
 			logger.Debug().Err(err).Str("userid", me.GetId()).Msg("could not get appRoleAssignments for self")
 			var errcode errorcode.Error
@@ -74,18 +77,27 @@ func (g Graph) GetMe(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
-
-		values := make([]libregraph.AppRoleAssignment, 0, len(lrar.GetAssignments()))
-		for _, assignment := range lrar.GetAssignments() {
-			values = append(values, g.assignmentToAppRoleAssignment(assignment))
-		}
-		me.AppRoleAssignments = values
 	}
 
 	render.Status(r, http.StatusOK)
 	render.JSON(w, r, me)
 }
 
+func (g Graph) fetchAppRoleAssignments(ctx context.Context, accountuuid string) ([]libregraph.AppRoleAssignment, error) {
+	lrar, err := g.roleService.ListRoleAssignments(ctx, &settings.ListRoleAssignmentsRequest{
+		AccountUuid: accountuuid,
+	})
+	if err != nil {
+		return []libregraph.AppRoleAssignment{}, err
+	}
+
+	values := make([]libregraph.AppRoleAssignment, 0, len(lrar.Assignments))
+	for _, assignment := range lrar.GetAssignments() {
+		values = append(values, g.assignmentToAppRoleAssignment(assignment))
+	}
+	return values, nil
+}
+
 // GetUsers implements the Service interface.
 func (g Graph) GetUsers(w http.ResponseWriter, r *http.Request) {
 	logger := g.logger.SubloggerWithRequestID(r.Context())
@@ -113,21 +125,21 @@ func (g Graph) GetUsers(w http.ResponseWriter, r *http.Request) {
 
 	// expand appRoleAssignments if requested
 	exp := strings.Split(r.URL.Query().Get("$expand"), ",")
-	if slices.Contains(exp, "appRoleAssignments") {
-		for _, u := range users {
-			lrar, err := g.roleService.ListRoleAssignments(r.Context(), &settings.ListRoleAssignmentsRequest{
-				AccountUuid: u.GetId(),
-			})
+	expandAppRoleAssignments := slices.Contains(exp, "appRoleAssignments")
+	expandMemberOf := slices.Contains(exp, "memberOf")
+	for _, u := range users {
+		if expandAppRoleAssignments {
+			u.AppRoleAssignments, err = g.fetchAppRoleAssignments(r.Context(), u.GetId())
 			if err != nil {
+				// TODO I think we should not continue here, see http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand
+				// > The $expand system query option indicates the related entities and stream values that MUST be represented inline. The service MUST return the specified content, and MAY choose to return additional information.
 				logger.Debug().Err(err).Str("userid", u.GetId()).Msg("could not get appRoleAssignments when listing user")
-				continue
 			}
-
-			values := make([]libregraph.AppRoleAssignment, 0, len(lrar.GetAssignments()))
-			for _, assignment := range lrar.GetAssignments() {
-				values = append(values, g.assignmentToAppRoleAssignment(assignment))
+		}
+		if expandMemberOf {
+			if u.MemberOf == nil {
+				u.MemberOf = []libregraph.Group{}
 			}
-			u.AppRoleAssignments = values
 		}
 	}
 
@@ -159,7 +171,7 @@ func (g Graph) PostUser(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 	if accountName, ok := u.GetOnPremisesSamAccountNameOk(); ok {
-		if !isValidUsername(*accountName) {
+		if !g.isValidUsername(*accountName) {
 			logger.Debug().Str("username", *accountName).Msg("could not create user: username must be at least the local part of an email")
 			errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, fmt.Sprintf("username %s must be at least the local part of an email", *u.OnPremisesSamAccountName))
 			return
@@ -307,7 +319,7 @@ func (g Graph) GetUser(w http.ResponseWriter, r *http.Request) {
 			if err != nil {
 				logger.Debug().Err(err).Interface("id", sp.Id).Msg("error calling get quota on drive")
 			}
-			d.Quota = quota
+			d.Quota = &quota
 			if slices.Contains(sel, "drive") || slices.Contains(exp, "drive") {
 				if *d.DriveType == "personal" {
 					user.Drive = d
@@ -320,10 +332,7 @@ func (g Graph) GetUser(w http.ResponseWriter, r *http.Request) {
 	}
 	// expand appRoleAssignments if requested
 	if slices.Contains(exp, "appRoleAssignments") {
-
-		lrar, err := g.roleService.ListRoleAssignments(r.Context(), &settings.ListRoleAssignmentsRequest{
-			AccountUuid: user.GetId(),
-		})
+		user.AppRoleAssignments, err = g.fetchAppRoleAssignments(r.Context(), user.GetId())
 		if err != nil {
 			logger.Debug().Err(err).Str("userid", user.GetId()).Msg("could not get appRoleAssignments for user")
 			var errcode errorcode.Error
@@ -334,12 +343,6 @@ func (g Graph) GetUser(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
-
-		values := make([]libregraph.AppRoleAssignment, 0, len(lrar.GetAssignments()))
-		for _, assignment := range lrar.GetAssignments() {
-			values = append(values, g.assignmentToAppRoleAssignment(assignment))
-		}
-		user.AppRoleAssignments = values
 	}
 
 	render.Status(r, http.StatusOK)
@@ -530,16 +533,28 @@ func (g Graph) PatchUser(w http.ResponseWriter, r *http.Request) {
 
 }
 
-// We want to allow email addresses as usernames so they show up when using them in ACLs on storages that allow integration with our glauth LDAP service
-// so we are adding a few restrictions from https://stackoverflow.com/questions/6949667/what-are-the-real-rules-for-linux-usernames-on-centos-6-and-rhel-6
-// names should not start with numbers
-var usernameRegex = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*(@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*$")
+const (
+	usernameMatchDefault = "default"
+	usernameMatchNone    = "none"
+)
+
+var usernameRegexes = map[string]*regexp.Regexp{
+	// We want to allow email addresses as usernames so they show up when using them in ACLs on storages that allow integration with our glauth LDAP service
+	// so we are adding a few restrictions from https://stackoverflow.com/questions/6949667/what-are-the-real-rules-for-linux-usernames-on-centos-6-and-rhel-6
+	// names should not start with numbers
+	usernameMatchDefault: regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*(@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*$"),
 
-func isValidUsername(e string) bool {
+	// In some cases users will be provisioned from an existing system, which may or may not have strange usernames. Because of this we want to "trust" the
+	// upstream system and allow weird usernames, so relying on the used identity provider to complain if a username is violating its restrictions.
+	usernameMatchNone: regexp.MustCompile(".*"),
+}
+
+func (g Graph) isValidUsername(e string) bool {
 	if len(e) < 1 && len(e) > 254 {
 		return false
 	}
-	return usernameRegex.MatchString(e)
+
+	return usernameRegexes[g.config.API.UsernameMatch].MatchString(e)
 }
 
 // regex from https://www.w3.org/TR/2016/REC-html51-20161101/sec-forms.html#valid-e-mail-address


Test patch:
diff --git a/docs/ocis/development/testing.md b/docs/ocis/development/testing.md
index b3fa042e9c9..3d80ca640fc 100644
--- a/docs/ocis/development/testing.md
+++ b/docs/ocis/development/testing.md
@@ -89,15 +89,12 @@ make -C tests/acceptance/docker clean
 
 ## Testing with test suite natively installed
 
-We are using the ownCloud 10 acceptance test suite against oCIS.
+We have two sets of tests:
+- `test-acceptance-from-core-api` set was transferred from [core](https://github.com/owncloud/core) repository 
+The suite name of all tests transferred from the core starts with "core"
 
-### Getting the tests
+- `test-acceptance-api` set was created for ocis. Mainly for testing spaces features
 
-All you need to do to get the acceptance tests is check out the core repo:
-
-```bash
-git clone https://github.com/owncloud/core.git
-```
 
 ### Run ocis
 
@@ -106,47 +103,49 @@ Create an up-to-date ocis binary by [building oCIS]({{< ref "build" >}})
 To start ocis:
 
 ```bash
-IDM_ADMIN_PASSWORD=admin ocis/bin/ocis init --insecure true
-OCIS_INSECURE=true PROXY_ENABLE_BASIC_AUTH=true ocis/bin/ocis server
+IDM_ADMIN_PASSWORD=admin \
+ocis/bin/ocis init --insecure true
+
+OCIS_INSECURE=true PROXY_ENABLE_BASIC_AUTH=true \
+ocis/bin/ocis server
 ```
 
 `PROXY_ENABLE_BASIC_AUTH` will allow the acceptance tests to make requests against the provisioning api (and other endpoints) using basic auth.
 
-### Run the acceptance tests
-
-First we will need to clone the testing app in owncloud which contains the skeleton files required for running the tests.
-In the ownCloud 10 core clone the testing app with the following command:
+### Run the test-acceptance-from-core-api tests
 
 ```bash
-git clone https://github.com/owncloud/testing apps/testing
+make test-acceptance-from-core-api \
+TEST_SERVER_URL=https://localhost:9200 \
+TEST_WITH_GRAPH_API=true \
+TEST_OCIS=true \
 ```
+Note: This command only works for suites that start with core
 
-Then run the api acceptance tests with the following command from the root of the ownCloud 10 core repository:
+### Run the test-acceptance-api tests
 
 ```bash
 make test-acceptance-api \
 TEST_SERVER_URL=https://localhost:9200 \
 TEST_WITH_GRAPH_API=true \
-PATH_TO_OCIS=/var/www/ocis \
-PATH_TO_CORE=. \
 TEST_OCIS=true \
-STORAGE_DRIVER=OCIS \
-SKELETON_DIR=apps/testing/data/apiSkeleton \
-BEHAT_FILTER_TAGS='~@notToImplementOnOCIS&&~@toImplementOnOCIS'
 ```
 
-Make sure to adjust the settings `TEST_SERVER_URL` and `PATH_TO_OCIS` according to your environment.
+Make sure to adjust the settings `TEST_SERVER_URL` according to your environment.
 
-This will run all tests that are relevant to oCIS.
-
-To run a single feature add `BEHAT_FEATURE=<feature file>`
+To run a single feature add `BEHAT_FEATURE=<feature file>` 
+example: `BEHAT_SUITE=tests/acceptance/features/apiGraph/createUser.feature`
+To run a single test add `BEHAT_FEATURE=<file.feature:(line number)>`
+example: `BEHAT_SUITE=tests/acceptance/features/apiGraph/createUser.feature:12`
+To run a single suite add `BEHAT_SUITE=<test suite>`
+example: `BEHAT_SUITE=apiGraph`
 
 To run tests with a different storage driver set `STORAGE_DRIVER` to the correct value. It can be set to `OCIS` or `OWNCLOUD` and uses `OWNCLOUD` as the default value.
 
 ### use existing tests for BDD
 
-As a lot of scenarios are written for oC10, we can use those tests for Behaviour driven development in ocis.
-Every scenario that does not work in oCIS with "ocis" storage, is listed in `tests/acceptance/expected-failures-on-OCIS-storage.md` with a link to the related issue.
+As a lot of scenarios from `test-acceptance-from-core-api` are written for oC10, we can use those tests for Behaviour driven development in ocis.
+Every scenario that does not work in oCIS with "ocis" storage, is listed in `tests/acceptance/expected-failures-API-on-OCIS-storage.md` with a link to the related issue.
 
 Those scenarios are run in the ordinary acceptance test pipeline in CI. The scenarios that fail are checked against the
 expected failures. If there are any differences then the CI pipeline fails.
@@ -155,30 +154,24 @@ The tests are not currently run in CI with the OWNCLOUD or EOS storage drivers,
 
 If you want to work on a specific issue
 
-1. adjust the core commit id to the latest commit in core so that CI will run the latest test code and scenarios from core.
-    For that change `CORE_COMMITID` in `.drone.env`:
-
-        # The test runner source for API tests
-        CORE_COMMITID=38c91e5cf5fc4ffdc0536ba1d147a2a618ef83b5
-        CORE_BRANCH=master
-
-2. locally run each of the tests marked with that issue in the expected failures file.
+1. locally run each of the tests marked with that issue in the expected failures file.
 
     E.g.:
 
     ```bash
-    make test-acceptance-api \
+    make test-acceptance-from-core-api \
     TEST_SERVER_URL=https://localhost:9200 \
     TEST_OCIS=true \
+    TEST_WITH_GRAPH_API=true \
     STORAGE_DRIVER=OCIS \
-    BEHAT_FEATURE='tests/acceptance/features/apiComments/comments.feature:123'
+    BEHAT_FEATURE='tests/acceptance/features/coreApiVersions/fileVersions.feature:147'
     ```
 
-3. the tests will fail, try to understand how and why they are failing
-4. fix the code
-5. go back to 2. and repeat till the tests are passing.
-6. remove those tests from the expected failures file
-7. make a PR that has the fixed code, and the relevant lines removed from the expected failures file.
+2. the tests will fail, try to understand how and why they are failing
+3. fix the code
+4. go back to 1. and repeat till the tests are passing.
+5. remove those tests from the expected failures file
+6. make a PR that has the fixed code, and the relevant lines removed from the expected failures file.
 
 ## Running tests for parallel deployment
 
diff --git a/services/graph/pkg/service/v0/drives_test.go b/services/graph/pkg/service/v0/drives_test.go
index 28bcb7cf56e..9abacf8403d 100644
--- a/services/graph/pkg/service/v0/drives_test.go
+++ b/services/graph/pkg/service/v0/drives_test.go
@@ -111,7 +111,7 @@ var sortTests = []sortTest{
 }
 
 func drive(ID string, dType string, name string, lastModified *time.Time) *libregraph.Drive {
-	return &libregraph.Drive{Id: libregraph.PtrString(ID), DriveType: libregraph.PtrString(dType), Name: name, LastModifiedDateTime: lastModified}
+	return &libregraph.Drive{Id: libregraph.PtrString(ID), DriveType: libregraph.PtrString(dType), Name: name, LastModifiedDateTime: lastModified, Quota: &libregraph.Quota{}}
 }
 
 // TestSort tests the available orderby queries
diff --git a/services/graph/pkg/service/v0/graph_test.go b/services/graph/pkg/service/v0/graph_test.go
index 82a896c282b..e7e6d86fe5e 100644
--- a/services/graph/pkg/service/v0/graph_test.go
+++ b/services/graph/pkg/service/v0/graph_test.go
@@ -143,6 +143,7 @@ var _ = Describe("Graph", func() {
 						"driveType":"aspacetype",
 						"id":"pro-1$sameID",
 						"name":"aspacename",
+						"quota": {},
 						"root":{
 							"id":"pro-1$sameID",
 							"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$sameID"
@@ -213,6 +214,7 @@ var _ = Describe("Graph", func() {
 						"driveType":"aspacetype",
 						"id":"pro-1$asameID",
 						"name":"aspacename",
+						"quota": {},
 						"root":{
 							"eTag":"101112131415",
 							"id":"pro-1$asameID",
@@ -225,6 +227,7 @@ var _ = Describe("Graph", func() {
 						"driveType":"bspacetype",
 						"id":"pro-1$bsameID",
 						"name":"bspacename",
+						"quota": {},
 						"root":{
 							"eTag":"123456789",
 							"id":"pro-1$bsameID",
diff --git a/services/graph/pkg/service/v0/users_test.go b/services/graph/pkg/service/v0/users_test.go
index 34958e9af6c..d516782534b 100644
--- a/services/graph/pkg/service/v0/users_test.go
+++ b/services/graph/pkg/service/v0/users_test.go
@@ -539,6 +539,63 @@ var _ = Describe("Users", func() {
 
 			Expect(rr.Code).To(Equal(http.StatusOK))
 		})
+
+		Describe("Handling usernames with spaces", func() {
+			var (
+				newSvc = func(usernameMatch string) service.Service {
+					localCfg := defaults.FullDefaultConfig()
+					localCfg.Identity.LDAP.CACert = "" // skip the startup checks, we don't use LDAP at all in this tests
+					localCfg.TokenManager.JWTSecret = "loremipsum"
+					localCfg.Commons = &shared.Commons{}
+					localCfg.GRPCClientTLS = &shared.GRPCClientTLS{}
+
+					localCfg.API.UsernameMatch = usernameMatch
+
+					_ = ogrpc.Configure(ogrpc.GetClientOptions(cfg.GRPCClientTLS)...)
+					localSvc, _ := service.NewService(
+						service.Config(localCfg),
+						service.WithGatewayClient(gatewayClient),
+						service.EventsPublisher(&eventsPublisher),
+						service.WithIdentityBackend(identityBackend),
+						service.WithRoleService(roleService),
+					)
+
+					return localSvc
+				}
+			)
+
+			BeforeEach(func() {
+				user.SetOnPremisesSamAccountName("username with spaces")
+			})
+
+			It("rejects a username with spaces if match regex is default", func() {
+				userJson, err := json.Marshal(user)
+				Expect(err).ToNot(HaveOccurred())
+
+				r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/me/users", bytes.NewBuffer(userJson))
+				r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
+
+				newSvc("default").PostUser(rr, r)
+				Expect(rr.Code).To(Equal(http.StatusBadRequest))
+			})
+
+			It("creates a user with spaces in username if regex is none", func() {
+				roleService.On("AssignRoleToUser", mock.Anything, mock.Anything).Return(&settings.AssignRoleToUserResponse{}, nil)
+				identityBackend.On("CreateUser", mock.Anything, mock.Anything).Return(func(ctx context.Context, user libregraph.User) *libregraph.User {
+					user.SetId("/users/user")
+					return &user
+				}, nil)
+				userJson, err := json.Marshal(user)
+				Expect(err).ToNot(HaveOccurred())
+
+				r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/me/users", bytes.NewBuffer(userJson))
+				r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
+				newSvc("none").PostUser(rr, r)
+
+				Expect(rr.Code).To(Equal(http.StatusOK))
+			})
+		})
+
 	})
 
 	Describe("DeleteUser", func() {
diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md
index a5f191d9552..98181dba5c8 100644
--- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md
+++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md
@@ -35,15 +35,19 @@ _ocdav: double-check the webdav property parsing when custom namespaces are used
 
 #### [file versions do not report the version author](https://github.com/owncloud/ocis/issues/2914)
 
-- [coreApiVersions/fileVersionAuthor.feature:14](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L14)
-- [coreApiVersions/fileVersionAuthor.feature:37](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L37)
-- [coreApiVersions/fileVersionAuthor.feature:58](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L58)
-- [coreApiVersions/fileVersionAuthor.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L78)
-- [coreApiVersions/fileVersionAuthor.feature:104](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L104)
-- [coreApiVersions/fileVersionAuthor.feature:129](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L129)
-- [coreApiVersions/fileVersionAuthor.feature:154](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L154)
-- [coreApiVersions/fileVersionAuthor.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L180)
+- [coreApiVersions/fileVersionAuthor.feature:13](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L13)
+- [coreApiVersions/fileVersionAuthor.feature:44](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L44)
+- [coreApiVersions/fileVersionAuthor.feature:71](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L71)
+- [coreApiVersions/fileVersionAuthor.feature:97](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L97)
+- [coreApiVersions/fileVersionAuthor.feature:130](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L130)
+- [coreApiVersions/fileVersionAuthor.feature:157](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L157)
+- [coreApiVersions/fileVersionAuthor.feature:188](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L188)
 - [coreApiVersions/fileVersionAuthor.feature:223](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L223)
+- [coreApiVersions/fileVersionAuthor.feature:275](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L275)
+- [coreApiVersions/fileVersionAuthor.feature:324](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L324)
+- [coreApiVersions/fileVersionAuthor.feature:345](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L345)
+- [coreApiVersions/fileVersionAuthor.feature:365](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L365)
+- [coreApiVersions/fileVersionAuthor.feature:390](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature#L390)
 
 ### Sync
 
@@ -307,8 +311,6 @@ cannot share a folder with create permission
 - [coreApiShareOperationsToShares1/changingFilesShare.feature:131](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L131)
 - [coreApiShareOperationsToShares1/changingFilesShare.feature:132](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareOperationsToShares1/changingFilesShare.feature#L132)
 - [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:538](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L538)
-- [coreApiVersions/fileVersionsSharingToShares.feature:220](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature#L220)
-- [coreApiVersions/fileVersionsSharingToShares.feature:221](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature#L221)
 - [coreApiWebdavMove2/moveShareOnOcis.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L30)
 - [coreApiWebdavMove2/moveShareOnOcis.feature:32](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L32)
 - [coreApiWebdavMove2/moveShareOnOcis.feature:98](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveShareOnOcis.feature#L98)
@@ -465,7 +467,7 @@ cannot share a folder with create permission
 
 #### [user can access version metadata of a received share before accepting it](https://github.com/owncloud/ocis/issues/760)
 
-- [coreApiVersions/fileVersionsSharingToShares.feature:283](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature#L283)
+- [coreApiVersions/fileVersions.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L487)
 
 #### [Share lists deleted user as 'user'](https://github.com/owncloud/ocis/issues/903)
 
diff --git a/tests/acceptance/features/apiSpaces/tag.feature b/tests/acceptance/features/apiSpaces/tag.feature
index a628935f122..c452072a819 100644
--- a/tests/acceptance/features/apiSpaces/tag.feature
+++ b/tests/acceptance/features/apiSpaces/tag.feature
@@ -78,3 +78,166 @@ Feature: Tag
       | important                     |
       | fileTag                       |
       | tag with symbol @^$#^%$@%!_+) |
+
+
+  Scenario Outline: Member of the space tries to create tag
+    Given user "Alice" has shared a space "use-tag" to user "Brian" with role "<role>"
+    When user "Brian" creates the following tags for folder "folderMain/insideTheFolder.txt" of space "use-tag":
+      | tag level#1                    |
+      | tag with symbols @^$#^%$@%!_+) |
+    Then the HTTP status code should be "<code>"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response <shouldOrNot> contain following tags:
+      | tag level#1                    |
+      | tag with symbols @^$#^%$@%!_+) |
+    Examples:
+      | role    | code | shouldOrNot |
+      | viewer  | 403  | should not  |
+      | editor  | 200  | should      |
+      | manager | 200  | should      |
+
+
+  Scenario: The recipient has a created tags if share is accepted
+    Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
+      | folderTag |
+      | marketing |
+    And user "Alice" has shared the following entity "folderMain" inside of space "use-tag" with user "Brian" with role "viewer"
+    When user "Brian" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should not contain following tags:
+      | folderTag |
+      | marketing |
+    When user "Brian" accepts share "/folderMain" offered by user "Alice" using the sharing API
+    And user "Brian" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should contain following tags:
+      | folderTag |
+      | marketing |
+
+
+  Scenario Outline: The recipient of the shared resource tries to create a tag
+    Given user "Alice" has shared the following entity "folderMain" inside of space "use-tag" with user "Brian" with role "<role>"
+    And user "Brian" has accepted share "/folderMain" offered by user "Alice"
+    When user "Brian" creates the following tags for <resource> "<resourceName>" of space "Shares":
+      | tag in a shared resource |
+      | second tag               |
+    Then the HTTP status code should be "<code>"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response <shouldOrNot> contain following tags:
+      | tag in a shared resource |
+      | second tag               |
+    Examples:
+      | role    | resource | resourceName                   | code | shouldOrNot |
+      | viewer  | file     | folderMain/insideTheFolder.txt | 403  | should not  |
+      | editor  | file     | folderMain/insideTheFolder.txt | 200  | should      |
+      | manager | file     | folderMain/insideTheFolder.txt | 200  | should      |
+      | viewer  | folder   | folderMain                     | 403  | should not  |
+      | editor  | folder   | folderMain                     | 200  | should      |
+      | manager | folder   | folderMain                     | 200  | should      |
+
+
+  Scenario Outline: The recipient of the shared resource tries to remove a tag
+    Given user "Alice" has shared the following entity "folderMain" inside of space "use-tag" with user "Brian" with role "<role>"
+    And user "Alice" has created the following tags for <resource> "<resourceName>" of the space "use-tag":
+      | tag in a shared resource |
+      | second tag               |
+    And user "Brian" has accepted share "/folderMain" offered by user "Alice"
+    When user "Brian" removes the following tags for <resource> "<resourceName>" of space "Shares":
+      | tag in a shared resource |
+      | second tag               |
+    Then the HTTP status code should be "<code>"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response <shouldOrNot> contain following tags:
+      | tag in a shared resource |
+      | second tag               |
+    Examples:
+      | role    | resource | resourceName                   | code | shouldOrNot |
+      | viewer  | file     | folderMain/insideTheFolder.txt | 403  | should      |
+      | editor  | file     | folderMain/insideTheFolder.txt | 200  | should not  |
+      | manager | file     | folderMain/insideTheFolder.txt | 200  | should not  |
+      | viewer  | folder   | folderMain                     | 403  | should      |
+      | editor  | folder   | folderMain                     | 200  | should not  |
+      | manager | folder   | folderMain                     | 200  | should not  |
+
+
+  Scenario: User removes folder tags
+    Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
+      | folderTag   |
+      | marketing   |
+      | development |
+    When user "Alice" removes the following tags for folder "folderMain" of space "use-tag":
+      | folderTag |
+      | marketing |
+    And user "Alice" sends PROPFIND request from the space "use-tag" to the resource "folderMain" using the WebDAV API
+    Then the HTTP status code should be "207"
+    And the "PROPFIND" response should contain a space "use-tag" with these key and value pairs:
+      | key     | value       |
+      | oc:tags | development |
+
+
+  Scenario: User lists tags after deleting some folder tags
+    Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
+      | folderTag   |
+      | marketing   |
+      | development |
+    When user "Alice" removes the following tags for folder "folderMain" of space "use-tag":
+      | folderTag |
+      | marketing |
+    Then the HTTP status code should be "200"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should contain following tags:
+      | development |
+    And the response should not contain following tags:
+      | folderTag |
+      | marketing |
+
+
+  Scenario: User lists the tags after deleting a folder
+    Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
+      | folderTag |
+      | marketing |
+    When user "Alice" removes the folder "folderMain" from space "use-tag"
+    Then the HTTP status code should be "204"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should not contain following tags:
+      | folderTag |
+      | marketing |
+
+
+  Scenario: User lists the tags after deleting a space
+    Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
+      | folderTag |
+      | marketing |
+    When user "Alice" disables a space "use-tag"
+    Then the HTTP status code should be "204"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should contain following tags:
+      | folderTag |
+      | marketing |
+    When user "Alice" deletes a space "use-tag"
+    Then the HTTP status code should be "204"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should not contain following tags:
+      | folderTag |
+      | marketing |
+
+
+  Scenario: User lists the tags after restoring a deleted folder
+    Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
+      | folderTag |
+      | marketing |
+    And user "Alice" has removed the folder "folderMain" from space "use-tag"
+    When user "Alice" restores the folder "folderMain" from the trash of the space "use-tag" to "/folderMain"
+    Then the HTTP status code should be "201"
+    When user "Alice" lists all available tags via the GraphApi
+    Then the HTTP status code should be "200"
+    And the response should contain following tags:
+      | folderTag |
+      | marketing |
diff --git a/tests/acceptance/features/bootstrap/TagContext.php b/tests/acceptance/features/bootstrap/TagContext.php
index 60dd67e2bdd..f8610b01771 100644
--- a/tests/acceptance/features/bootstrap/TagContext.php
+++ b/tests/acceptance/features/bootstrap/TagContext.php
@@ -101,7 +101,7 @@ class TagContext implements Context {
 	}
 
 	/**
-	 * @Given /^user "([^"]*)" has created the following tags a (folder|file)\s?"([^"]*)" of the space "([^"]*)":$/
+	 * @Given /^user "([^"]*)" has created the following tags for (folder|file)\s?"([^"]*)" of the space "([^"]*)":$/
 	 *
 	 * @param string $user
 	 * @param string $fileOrFolder   (file|folder)
@@ -126,6 +126,8 @@ class TagContext implements Context {
 	 * @throws Exception
 	 */
 	public function theUserGetsAllAvailableTags(string $user):void {
+		// after creating or deleting tags, in some cases tags do not appear or disappear immediately, so we use waiting
+		sleep(1);
 		$this->featureContext->setResponse(
 			GraphHelper::getTags(
 				$this->featureContext->getBaseUrl(),
@@ -136,18 +138,58 @@ class TagContext implements Context {
 	}
 
 	/**
-	 * @Then the response should contain following tag(s):
+	 * @Then /^the response should (not|)\s?contain following tag(s):$/
 	 *
+	 * @param string    $shouldOrNot   (not|)
 	 * @param TableNode $table
 	 *
 	 * @return void
 	 * @throws Exception
 	 */
-	public function theFollowingTagsShouldExistForUser(TableNode $table):void {
+	public function theFollowingTagsShouldExistForUser(string $shouldOrNot, TableNode $table):void {
 		$rows = $table->getRows();
 		foreach ($rows as $row) {
 			$responseArray = $this->featureContext->getJsonDecodedResponse($this->featureContext->getResponse())['value'];
-			Assert::assertTrue(\in_array($row[0], $responseArray), "the response does not contain the tag $row[0]");
+			if ($shouldOrNot === "not") {
+				Assert::assertFalse(\in_array($row[0], $responseArray), "the response should not contain the tag $row[0]");
+			} else {
+				Assert::assertTrue(\in_array($row[0], $responseArray), "the response does not contain the tag $row[0]");
+			}
 		}
 	}
+
+	/**
+	 * @When /^user "([^"]*)" removes the following tags for (folder|file)\s?"([^"]*)" of space "([^"]*)":$/
+	 *
+	 * @param string $user
+	 * @param string $fileOrFolder   (file|folder)
+	 * @param string $resource
+	 * @param string $space
+	 * @param TableNode $table
+	 *
+	 * @return void
+	 * @throws Exception
+	 */
+	public function userRemovesTagsFromResourceOfTheSpace(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void {
+		$tagNameArray = [];
+		foreach ($table->getRows() as $value) {
+			array_push($tagNameArray, $value[0]);
+		}
+
+		if ($fileOrFolder === 'folder') {
+			$resourceId = $this->spacesContext->getFolderId($user, $space, $resource);
+		} else {
+			$resourceId = $this->spacesContext->getFileId($user, $space, $resource);
+		}
+
+		$response = GraphHelper::deleteTags(
+			$this->featureContext->getBaseUrl(),
+			$this->featureContext->getStepLineRef(),
+			$user,
+			$this->featureContext->getPasswordForUser($user),
+			$resourceId,
+			$tagNameArray
+		);
+		$this->featureContext->setResponse($response);
+	}
 }
diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php
index d966840cd86..af9a0b1212c 100644
--- a/tests/acceptance/features/bootstrap/WebDav.php
+++ b/tests/acceptance/features/bootstrap/WebDav.php
@@ -5497,13 +5497,23 @@ trait WebDav {
 		}
 
 		// the username should be in oc:meta-version-edited-by
-		$xmlPart = $resXml->xpath("//oc:meta-version-edited-by//text()");
-		if (!isset($xmlPart[$index - 1])) {
+		$xmlPart = $resXml->xpath("//oc:meta-version-edited-by");
+		$authors = [];
+		foreach ($xmlPart as $idx => $author) {
+			// The first element is the root path element which is not a version
+			// So skipping it
+			if ($idx !== 0) {
+				$authors[] = $author->__toString();
+			}
+		}
+		// reverse the array to get the latest version first
+		\array_reverse($authors);
+		if (!isset($authors[$index - 1])) {
 			Assert::fail(
 				'could not find version with index "' . $index . '" for oc:meta-version-edited-by property in response to user "' . $this->responseUser . '"'
 			);
 		}
-		$actualUser = $xmlPart[$index - 1][0];
+		$actualUser = $authors[$index - 1];
 		Assert::assertEquals(
 			$expectedUsername,
 			$actualUser,
@@ -5511,17 +5521,27 @@ trait WebDav {
 		);
 
 		// the user's display name should be in oc:meta-version-edited-by-name
-		$xmlPart = $resXml->xpath("//oc:meta-version-edited-by-name//text()");
-		if (!isset($xmlPart[$index - 1])) {
+		$xmlPart = $resXml->xpath("//oc:meta-version-edited-by-name");
+		$displaynames = [];
+		foreach ($xmlPart as $idx => $displayname) {
+			// The first element is the root path element which is not a version
+			// So skipping it
+			if ($idx !== 0) {
+				$displaynames[] = $displayname->__toString();
+			}
+		}
+		// reverse the array to get the latest version first
+		\array_reverse($displaynames);
+		if (!isset($displaynames[$index - 1])) {
 			Assert::fail(
 				'could not find version with index "' . $index . '" for oc:meta-version-edited-by-name property in response to user "' . $this->responseUser . '"'
 			);
 		}
-		$actualUserDisplayName = $xmlPart[$index - 1][0];
+		$actualUserDisplayName = $displaynames[$index - 1];
 		Assert::assertEquals(
 			$expectedUserDisplayName,
 			$actualUserDisplayName,
-			"Expected display name of version with index $index in response to user '$this->responseUser' was '$expectedUsername', but got '$actualUser'"
+			"Expected display name of version with index $index in response to user '$this->responseUser' was '$expectedUserDisplayName', but got '$actualUserDisplayName'"
 		);
 	}
 }
diff --git a/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShare.feature
index f1dc0b51f57..848da56477d 100644
--- a/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShare.feature
+++ b/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShare.feature
@@ -610,3 +610,28 @@ Feature: update a public link share
       | dav-path | ocs_api_version | ocs_status_code |
       | spaces   | 1               | 100             |
       | spaces   | 2               | 200             |
+
+
+  Scenario Outline: Updating the role of a public link to internal
+    Given using OCS API version "<ocs_api_version>"
+    And using <dav-path> DAV path
+    And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile.txt"
+    And user "Alice" has created a public link share with settings
+      | path        | /textfile.txt |
+      | permissions | read          |
+    When user "Alice" updates the last public link share using the sharing API with
+      | permissions | 0 |
+    Then the OCS status code should be "<ocs_status_code>"
+    And the HTTP status code should be "200"
+    Examples:
+      | dav-path | ocs_api_version | ocs_status_code |
+      | old      | 1               | 100             |
+      | old      | 2               | 200             |
+      | new      | 1               | 100             |
+      | new      | 2               | 200             |
+
+    @personalSpace
+    Examples:
+      | dav-path | ocs_api_version | ocs_status_code |
+      | spaces   | 1               | 100             |
+      | spaces   | 2               | 200             |
diff --git a/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature b/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature
index dd04dbbaecc..d04ffcbf743 100644
--- a/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature
+++ b/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature
@@ -1,5 +1,4 @@
-@api @files_versions-app-required @issue-ocis-reva-275
-
+@api @issue-2914
 Feature: file versions remember the author of each version
 
   Background:
@@ -10,30 +9,38 @@ Feature: file versions remember the author of each version
     And user "Carol" has been created with default attributes and without skeleton files
     And the administrator has enabled the file version storage feature
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes from multiple users
     Given user "David" has been created with default attributes and without skeleton files
     And user "Alice" has created folder "/test"
     And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
     And user "Alice" has shared folder "/test" with user "Carol" with permissions "all"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
     And user "Alice" has shared folder "/test" with user "David" with permissions "all"
+    And user "David" has accepted share "/test" offered by user "Alice"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt"
-    And user "David" has uploaded file with content "uploaded content david" to "/test/textfile0.txt"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt"
+    And user "David" has uploaded file with content "uploaded content david" to "/Shares/test/textfile0.txt"
     When user "Alice" gets the number of versions of file "/test/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "3"
     And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol"
     And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,Brian,Carol,David" the authors of the versions of file "/test/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Brian  |
+      | 3     | Alice  |
+    And as users "Brian,Carol,David" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
       | 3     | Alice  |
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes from multiple users for shared folder in the group
     Given user "Alice" has created folder "/test"
     And group "grp1" has been created
@@ -41,20 +48,26 @@ Feature: file versions remember the author of each version
     And user "Brian" has been added to group "grp1"
     And user "Carol" has been added to group "grp1"
     And user "Alice" has shared folder "/test" with group "grp1"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt"
     When user "Alice" gets the number of versions of file "/test/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "2"
     And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,Brian,Carol" the authors of the versions of file "/test/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+      | 2     | Alice  |
+    And as users "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
       | index | author |
       | 1     | Brian  |
       | 2     | Alice  |
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes from multiple users for shared file in the group
     Given group "grp1" has been created
     And user "Alice" has been added to group "grp1"
@@ -62,19 +75,25 @@ Feature: file versions remember the author of each version
     And user "Carol" has been added to group "grp1"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt"
     And user "Alice" has shared file "/textfile0.txt" with group "grp1"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/textfile0.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/textfile0.txt"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
+    And user "Carol" has accepted share "/textfile0.txt" offered by user "Alice"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/textfile0.txt"
     When user "Alice" gets the number of versions of file "textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "2"
     And the content of version index "1" of file "/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "2" of file "/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,Brian,Carol" the authors of the versions of file "/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/textfile0.txt" should be:
       | index | author |
       | 1     | Brian  |
       | 2     | Alice  |
+    And as users "Brian,Carol" the authors of the versions of file "/Shares/textfile0.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+      | 2     | Alice  |
+
 
-  @skip_on_objectstore @skipOnEncryption @issue-encryption-321
   Scenario: enable file versioning and check the history of changes from multiple users while moving file in/out of a subfolder
     Given user "Alice" has created folder "/test"
     And group "grp1" has been created
@@ -82,25 +101,32 @@ Feature: file versions remember the author of each version
     And user "Brian" has been added to group "grp1"
     And user "Carol" has been added to group "grp1"
     And user "Alice" has shared folder "/test" with group "grp1"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt"
-    And user "Brian" has moved file "/test/textfile0.txt" to "/textfile0.txt"
-    And user "Brian" has uploaded file with content "uploaded content brian after moving file outside subfolder" to "/textfile0.txt"
-    And user "Brian" has moved file "/textfile0.txt" to "/test/textfile0.txt"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt"
+    And user "Alice" has moved file "/test/textfile0.txt" to "/textfile0.txt"
+    And user "Alice" has uploaded file with content "uploaded content alice after moving file outside subfolder" to "/textfile0.txt"
+    And user "Alice" has moved file "/textfile0.txt" to "/test/textfile0.txt"
     When user "Alice" gets the number of versions of file "/test/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "3"
     And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol"
     And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,Brian,Carol" the authors of the versions of file "/test/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
       | 3     | Alice  |
+    And as users "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Brian  |
+      | 3     | Alice  |
+
 
-  @skip_on_objectstore
   Scenario: enable file versioning and check the history of changes from multiple users after renaming file by sharer
     Given group "grp1" has been created
     And user "Alice" has been added to group "grp1"
@@ -108,8 +134,10 @@ Feature: file versions remember the author of each version
     And user "Carol" has been added to group "grp1"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/exist.txt"
     And user "Alice" has shared file "/exist.txt" with group "grp1"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/exist.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/exist.txt"
+    And user "Brian" has accepted share "/exist.txt" offered by user "Alice"
+    And user "Carol" has accepted share "/exist.txt" offered by user "Alice"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/exist.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/exist.txt"
     And user "Alice" has moved file "/exist.txt" to "/textfile0.txt"
     When user "Alice" gets the number of versions of file "textfile0.txt"
     Then the HTTP status code should be "207"
@@ -120,12 +148,12 @@ Feature: file versions remember the author of each version
       | index | author |
       | 1     | Brian  |
       | 2     | Alice  |
-    And as users "Brian,Carol" the authors of the versions of file "/exist.txt" should be:
+    And as users "Brian,Carol" the authors of the versions of file "/Shares/exist.txt" should be:
       | index | author |
       | 1     | Brian  |
       | 2     | Alice  |
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes in sharer after renaming file by sharee
     Given group "grp1" has been created
     And user "Alice" has been added to group "grp1"
@@ -133,24 +161,30 @@ Feature: file versions remember the author of each version
     And user "Carol" has been added to group "grp1"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/exist.txt"
     And user "Alice" has shared file "/exist.txt" with group "grp1"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/exist.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/exist.txt"
-    And user "Brian" has moved file "/exist.txt" to "/textfile0.txt"
+    And user "Brian" has accepted share "/exist.txt" offered by user "Alice"
+    And user "Carol" has accepted share "/exist.txt" offered by user "Alice"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/exist.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/exist.txt"
+    And user "Brian" has moved file "/Shares/exist.txt" to "/Shares/textfile0.txt"
     When user "Alice" gets the number of versions of file "exist.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "2"
     And the content of version index "1" of file "/exist.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "2" of file "/exist.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,Carol" the authors of the versions of file "/exist.txt" should be:
+    And as users "Alice" the authors of the versions of file "/exist.txt" should be:
       | index | author |
       | 1     | Brian  |
       | 2     | Alice  |
-    And as user "Brian" the authors of the versions of file "/textfile0.txt" should be:
+    And as users "Carol" the authors of the versions of file "/Shares/exist.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+      | 2     | Alice  |
+    And as user "Brian" the authors of the versions of file "/Shares/textfile0.txt" should be:
       | index | author |
       | 1     | Brian  |
       | 2     | Alice  |
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes from multiple users when reshared after unshared by sharer
     Given user "Alice" has created folder "/test"
     And group "grp1" has been created
@@ -158,52 +192,70 @@ Feature: file versions remember the author of each version
     And user "Brian" has been added to group "grp1"
     And user "Carol" has been added to group "grp1"
     And user "Alice" has shared folder "/test" with group "grp1"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/test/textfile0.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/test/textfile0.txt"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt"
     And user "Alice" has deleted the last share
     And user "Alice" has uploaded file with content "uploaded content alice after unshared folder" to "/test/textfile0.txt"
     And user "Alice" has shared folder "/test" with group "grp1"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
     When user "Alice" gets the number of versions of file "/test/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "3"
     And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol"
     And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,Brian,Carol" the authors of the versions of file "/test/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Brian  |
+      | 3     | Alice  |
+    And as users "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
       | 3     | Alice  |
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes from multiple users who have a matching folder/file
     Given user "David" has been created with default attributes and without skeleton files
     And user "Brian" has created folder "/test"
     And user "Brian" has uploaded file with content "duplicate brian" to "/test/textfile0.txt"
     And user "Brian" has uploaded file with content "overwrite brian" to "/test/textfile0.txt"
+    And user "Brian" has shared folder "/test" with user "Carol" with permissions "all"
+    And user "Carol" has accepted share "/test" offered by user "Brian"
+    And user "Brian" has shared folder "/test" with user "David" with permissions "all"
+    And user "David" has accepted share "/test" offered by user "Brian"
     And user "Carol" has created folder "/test"
     And user "Carol" has uploaded file with content "duplicate carol" to "/test/textfile0.txt"
+    And user "Carol" has shared folder "/test" with user "Brian" with permissions "all"
+    And user "Brian" has accepted share "/test" offered by user "Carol"
     And user "Alice" has created folder "/test"
     And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
     And user "Alice" has shared folder "/test" with user "Carol" with permissions "all"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
     And user "Alice" has shared folder "/test" with user "David" with permissions "all"
+    And user "David" has accepted share "/test" offered by user "Alice"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/test (2)/textfile0.txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/test (2)/textfile0.txt"
-    And user "David" has uploaded file with content "uploaded content david" to "/test/textfile0.txt"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test (1)/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test (1)/textfile0.txt"
+    And user "David" has uploaded file with content "uploaded content david" to "/Shares/test (1)/textfile0.txt"
     When user "Alice" gets the number of versions of file "/test/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "3"
     And the content of version index "1" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content carol"
     And the content of version index "2" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "3" of file "/test/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,David" the authors of the versions of file "/test/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
       | 3     | Alice  |
-    And as users "Brian,Carol" the authors of the versions of file "/test (2)/textfile0.txt" should be:
+    And as users "Brian,Carol,David" the authors of the versions of file "/Shares/test (1)/textfile0.txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
@@ -219,31 +271,40 @@ Feature: file versions remember the author of each version
     Then the HTTP status code should be "207"
     And the number of versions should be "0"
 
-  @skip_on_objectstore
+
   Scenario: enable file versioning and check the history of changes from multiple users who have a matching file
     Given user "David" has been created with default attributes and without skeleton files
     And user "Brian" has uploaded file with content "duplicate brian" to "/textfile0.txt"
     And user "Brian" has uploaded file with content "overwrite brian" to "/textfile0.txt"
+    And user "Brian" has shared file "/textfile0.txt" with user "Carol"
+    And user "Carol" has accepted share "/textfile0.txt" offered by user "Brian"
+    And user "Brian" has shared file "/textfile0.txt" with user "David"
+    And user "David" has accepted share "/textfile0.txt" offered by user "Brian"
     And user "Carol" has uploaded file with content "duplicate carol" to "/textfile0.txt"
+    And user "Carol" has shared file "/textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Carol"
     And user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt"
     And user "Alice" has shared file "/textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
     And user "Alice" has shared file "/textfile0.txt" with user "Carol"
+    And user "Carol" has accepted share "/textfile0.txt" offered by user "Alice"
     And user "Alice" has shared file "/textfile0.txt" with user "David"
-    And user "Brian" has uploaded file with content "uploaded content brian" to "/textfile0 (2).txt"
-    And user "Carol" has uploaded file with content "uploaded content carol" to "/textfile0 (2).txt"
-    And user "David" has uploaded file with content "uploaded content david" to "/textfile0.txt"
+    And user "David" has accepted share "/textfile0.txt" offered by user "Alice"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0 (1).txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/textfile0 (1).txt"
+    And user "David" has uploaded file with content "uploaded content david" to "/Shares/textfile0 (1).txt"
     When user "Alice" gets the number of versions of file "/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "3"
     And the content of version index "1" of file "/textfile0.txt" for user "Alice" should be "uploaded content carol"
     And the content of version index "2" of file "/textfile0.txt" for user "Alice" should be "uploaded content brian"
     And the content of version index "3" of file "/textfile0.txt" for user "Alice" should be "uploaded content alice"
-    And as users "Alice,David" the authors of the versions of file "/textfile0.txt" should be:
+    And as users "Alice" the authors of the versions of file "/textfile0.txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
       | 3     | Alice  |
-    And as users "Brian,Carol" the authors of the versions of file "/textfile0 (2).txt" should be:
+    And as users "Brian,Carol,David" the authors of the versions of file "/Shares/textfile0 (1).txt" should be:
       | index | author |
       | 1     | Carol  |
       | 2     | Brian  |
@@ -258,3 +319,95 @@ Feature: file versions remember the author of each version
     When user "Carol" gets the number of versions of file "/textfile0.txt"
     Then the HTTP status code should be "207"
     And the number of versions should be "0"
+
+
+  Scenario: enable file versioning and check the version author after restoring a version of a file inside a folder
+    Given user "Alice" has created folder "/test"
+    And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
+    And user "Alice" has shared folder "/test" with user "Carol" with permissions "all"
+    And user "Carol" has accepted share "/test" offered by user "Alice"
+    And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/test/textfile0.txt"
+    When user "Brian" restores version index "1" of file "/Shares/test/textfile0.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And as user "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Alice  |
+    And as user "Brian,Carol" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Alice  |
+
+
+  Scenario: enable file versioning and check the version author after restoring a version of a file
+    Given user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt"
+    And user "Alice" has shared file "/textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
+    And user "Alice" has shared file "/textfile0.txt" with user "Carol"
+    And user "Carol" has accepted share "/textfile0.txt" offered by user "Alice"
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0.txt"
+    And user "Carol" has uploaded file with content "uploaded content carol" to "/Shares/textfile0.txt"
+    When user "Brian" restores version index "1" of file "/Shares/textfile0.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And as user "Alice" the authors of the versions of file "/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Alice  |
+    And as user "Brian,Carol" the authors of the versions of file "/Shares/textfile0.txt" should be:
+      | index | author |
+      | 1     | Carol  |
+      | 2     | Alice  |
+
+
+  Scenario: check the author of the file version which was created before enabling the version storage
+    Given the administrator has disabled the file version storage feature
+    And user "Alice" has uploaded file with content "uploaded content alice" to "/textfile0.txt"
+    And user "Alice" has shared folder "/textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
+    And the administrator has enabled the file version storage feature
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/textfile0.txt"
+    When user "Brian" restores version index "1" of file "/Shares/textfile0.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And as user "Alice" the authors of the versions of file "/textfile0.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+    And as user "Brian" the authors of the versions of file "/Shares/textfile0.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+    When user "Brian" restores version index "1" of file "/Shares/textfile0.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And as user "Alice" the authors of the versions of file "/textfile0.txt" should be:
+      | index | author |
+      | 1     |        |
+    And as user "Brian" the authors of the versions of file "/Shares/textfile0.txt" should be:
+      | index | author |
+      | 1     |        |
+
+
+  Scenario: check the author of the file version (inside a folder) which was created before enabling the version storage
+    Given user "Alice" has created folder "/test"
+    And the administrator has disabled the file version storage feature
+    And user "Alice" has uploaded file with content "uploaded content alice" to "/test/textfile0.txt"
+    And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
+    And user "Brian" has accepted share "/test" offered by user "Alice"
+    And the administrator has enabled the file version storage feature
+    And user "Brian" has uploaded file with content "uploaded content brian" to "/Shares/test/textfile0.txt"
+    When user "Brian" restores version index "1" of file "/Shares/test/textfile0.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And as user "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+    And as user "Brian" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
+      | index | author |
+      | 1     | Brian  |
+    When user "Brian" restores version index "1" of file "/Shares/test/textfile0.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And as user "Alice" the authors of the versions of file "/test/textfile0.txt" should be:
+      | index | author |
+      | 1     |        |
+    And as user "Brian" the authors of the versions of file "/Shares/test/textfile0.txt" should be:
+      | index | author |
+      | 1     |        |
\ No newline at end of file
diff --git a/tests/acceptance/features/coreApiVersions/fileVersions.feature b/tests/acceptance/features/coreApiVersions/fileVersions.feature
index 38a5ef2a7aa..4d4f84ea667 100644
--- a/tests/acceptance/features/coreApiVersions/fileVersions.feature
+++ b/tests/acceptance/features/coreApiVersions/fileVersions.feature
@@ -21,19 +21,6 @@ Feature: dav-versions
     And the version folder of file "/davtest.txt-newdav-regular" for user "Alice" should contain "0" elements
     And the version folder of file "/davtest.txt-olddav-oldchunking" for user "Alice" should contain "0" elements
 
-  @issue-ocis-reva-17 @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321
-  Scenario: Upload file and no version is available using new chunking
-    When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API
-    Then the HTTP status code should be "201"
-    And the version folder of file "/davtest.txt" for user "Alice" should contain "0" elements
-
-  @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321
-  Scenario: Upload file and no version is available using async upload
-    Given the administrator has enabled async operations
-    When user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 3 chunks with new chunking and using the WebDAV API
-    Then the HTTP status code should be "202"
-    And the version folder of file "/davtest.txt" for user "Alice" should contain "0" elements
-
   @smokeTest
   Scenario: Upload a file twice and versions are available
     When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" using the WebDAV API
@@ -51,21 +38,6 @@ Feature: dav-versions
     And the version folder of file "/davtest.txt-newdav-regular" for user "Alice" should contain "1" element
     And the version folder of file "/davtest.txt-olddav-oldchunking" for user "Alice" should contain "1" element
 
-  @issue-ocis-reva-17 @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321
-  Scenario: Upload a file twice and versions are available using new chunking
-    When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API
-    And user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API
-    Then the HTTP status code of responses on each endpoint should be "201, 204" respectively
-    And the version folder of file "/davtest.txt" for user "Alice" should contain "1" element
-
-  @issue-ocis-reva-17 @issue-ocis-reva-56 @notToImplementOnOCIS @newChunking @issue-ocis-1321
-  Scenario: Upload a file twice and versions are available using async upload
-    Given the administrator has enabled async operations
-    When user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 2 chunks with new chunking and using the WebDAV API
-    And user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 3 chunks with new chunking and using the WebDAV API
-    Then the HTTP status code of responses on all endpoints should be "202"
-    And the version folder of file "/davtest.txt" for user "Alice" should contain "1" element
-
   @smokeTest
   Scenario: Remove a file
     Given user "Alice" has uploaded file "filesForUpload/davtest.txt" to "/davtest.txt"
@@ -109,21 +81,6 @@ Feature: dav-versions
     Examples:
       | dav-path | status-code |
       | old      | 201         |
-    @notToImplementOnOCIS @newChunking @issue-ocis-1321
-    Examples:
-      | dav-path | status-code |
-      | new      | 204         |
-
-  @skipOnStorage:ceph @files_primary_s3-issue-161 @notToImplementOnOCIS @newChunking @issue-ocis-1321 @issue-ocis-reva-17 @issue-ocis-reva-56 @skipOnStorage:scality
-  Scenario: Uploading a file asynchronously does create the correct version that can be restored
-    Given the administrator has enabled async operations
-    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
-    When user "Alice" uploads file "filesForUpload/davtest.txt" asynchronously to "textfile0.txt" in 2 chunks using the WebDAV API
-    And user "Alice" uploads file "filesForUpload/lorem.txt" asynchronously to "textfile0.txt" in 2 chunks using the WebDAV API
-    And user "Alice" restores version index "1" of file "/textfile0.txt" using the WebDAV API
-    Then the HTTP status code of responses on all endpoints should be "202"
-    And the version folder of file "/textfile0.txt" for user "Alice" should contain "2" elements
-    And the content of file "/textfile0.txt" for user "Alice" should be "Dav-Test"
 
   @skipOnStorage:ceph @skipOnStorage:scality @files_primary_s3-issue-156
   Scenario: Restore a file and check, if the content and correct checksum is now in the current file
@@ -143,246 +100,6 @@ Feature: dav-versions
     When user "Brian" sends HTTP method "PROPFIND" to URL "/remote.php/dav/meta/<<FILEID>>"
     Then the HTTP status code should be "400" or "404"
 
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: User can access meta folder of a file which is owned by somebody else but shared with that user
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "123" to "/davtest.txt"
-    And user "Alice" has uploaded file with content "456789" to "/davtest.txt"
-    And we save it into "FILEID"
-    When user "Alice" creates a share using the sharing API with settings
-      | path        | /davtest.txt |
-      | shareType   | user         |
-      | shareWith   | Brian        |
-      | permissions | read         |
-    Then the HTTP status code should be "200"
-    And the version folder of fileId "<<FILEID>>" for user "Brian" should contain "1" element
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharer of a file can see the old version information when the sharee changes the content of the file
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
-    And user "Alice" has shared file "sharefile.txt" with user "Brian"
-    When user "Brian" has uploaded file with content "Second content" to "/sharefile.txt"
-    Then the HTTP status code should be "204"
-    And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharer of a file can restore the original content of a shared file after the file has been modified by the sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
-    And user "Alice" has shared file "sharefile.txt" with user "Brian"
-    And user "Brian" has uploaded file with content "Second content" to "/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharer can restore a file inside a shared folder modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a file inside a shared folder modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a file inside a shared folder created by sharee and modified by sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer, when the folder has been moved by the sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has created folder "/received"
-    And user "Brian" has moved folder "/sharingfolder" to "/received/sharingfolder"
-    When user "Brian" restores version index "1" of file "/received/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/received/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is at the top level of the sharer)
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "old content" to "/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharefile.txt"
-    And user "Alice" has shared file "/sharefile.txt" with user "Brian"
-    And user "Brian" has created folder "/received"
-    And user "Brian" has moved file "/sharefile.txt" to "/received/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/received/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is inside a folder of the sharer)
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has shared file "/sharingfolder/sharefile.txt" with user "Brian"
-    And user "Brian" has created folder "/received"
-    And user "Brian" has moved file "/sharefile.txt" to "/received/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/received/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @issue-ocis-1289 @issue-ocis-1321 @notToImplementOnOCIS
-  Scenario: sharer can restore a file inside a group shared folder modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Carol" has been created with default attributes and without skeleton files
-    And group "grp1" has been created
-    And user "Brian" has been added to group "grp1"
-    And user "Carol" has been added to group "grp1"
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with group "grp1"
-    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    And user "Carol" has uploaded file with content "Third content" to "/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "2" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Carol" should be "First content"
-
-  @files_sharing-app-required @notToImplementOnOCIS @issue-ocis-1238
-  Scenario Outline: Moving a file (with versions) into a shared folder as the sharee and as the sharer
-    Given using <dav_version> DAV path
-    And user "Brian" has been created with default attributes and without skeleton files
-    And user "Brian" has created folder "/testshare"
-    And user "Brian" has created a share with settings
-      | path        | testshare |
-      | shareType   | user      |
-      | permissions | change    |
-      | shareWith   | Alice     |
-    And user "<mover>" has uploaded file with content "test data 1" to "/testfile.txt"
-    And user "<mover>" has uploaded file with content "test data 2" to "/testfile.txt"
-    And user "<mover>" has uploaded file with content "test data 3" to "/testfile.txt"
-    When user "<mover>" moves file "/testfile.txt" to "/testshare/testfile.txt" using the WebDAV API
-    Then the HTTP status code should be "201"
-    And the content of file "/testshare/testfile.txt" for user "Alice" should be "test data 3"
-    And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data 3"
-    And as "<mover>" file "/testfile.txt" should not exist
-    And the version folder of file "/testshare/testfile.txt" for user "Alice" should contain "2" elements
-    And the version folder of file "/testshare/testfile.txt" for user "Brian" should contain "2" elements
-    Examples:
-      | dav_version | mover |
-      | old         | Alice |
-      | new         | Alice |
-      | old         | Brian |
-      | new         | Brian |
-
-  @files_sharing-app-required @notToImplementOnOCIS @issue-ocis-1238
-  Scenario Outline: Moving a file (with versions) out of a shared folder as the sharee and as the sharer
-    Given using <dav_version> DAV path
-    And user "Brian" has been created with default attributes and without skeleton files
-    And user "Brian" has created folder "/testshare"
-    And user "Brian" has uploaded file with content "test data 1" to "/testshare/testfile.txt"
-    And user "Brian" has uploaded file with content "test data 2" to "/testshare/testfile.txt"
-    And user "Brian" has uploaded file with content "test data 3" to "/testshare/testfile.txt"
-    And user "Brian" has created a share with settings
-      | path        | testshare |
-      | shareType   | user      |
-      | permissions | change    |
-      | shareWith   | Alice     |
-    When user "<mover>" moves file "/testshare/testfile.txt" to "/testfile.txt" using the WebDAV API
-    Then the HTTP status code should be "201"
-    And the content of file "/testfile.txt" for user "<mover>" should be "test data 3"
-    And as "Alice" file "/testshare/testfile.txt" should not exist
-    And as "Brian" file "/testshare/testfile.txt" should not exist
-    And the version folder of file "/testfile.txt" for user "<mover>" should contain "2" elements
-    Examples:
-      | dav_version | mover |
-      | old         | Alice |
-      | new         | Alice |
-      | old         | Brian |
-      | new         | Brian |
-
-  @files_sharing-app-required @issue-ocis-1238 @notToImplementOnOCIS
-  Scenario: Receiver tries to get file versions of unshared file from the sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "textfile1" to "textfile1.txt"
-    And user "Alice" has shared file "textfile0.txt" with user "Brian"
-    When user "Brian" tries to get versions of file "textfile1.txt" from "Alice"
-    Then the HTTP status code should be "404"
-    And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
-
-  @skipOnStorage:ceph @files_primary_s3-issue-161 @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: Receiver tries get file versions of shared file from the sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 3" to "textfile0.txt"
-    And user "Alice" has shared file "textfile0.txt" with user "Brian"
-    When user "Brian" tries to get versions of file "textfile0.txt" from "Alice"
-    Then the HTTP status code should be "207"
-    And the number of versions should be "3"
-
 
   Scenario: User cannot access meta folder of a file which does not exist
     Given user "Brian" has been created with default attributes and without skeleton files
@@ -553,4 +270,259 @@ Feature: dav-versions
     And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API
     When user "Alice" restores version index "1" of file "/file.txt" using the WebDAV API
     Then the HTTP status code should be "204"
-    And the version folder of file "/file.txt" for user "Alice" should contain "0" element
\ No newline at end of file
+    And the version folder of file "/file.txt" for user "Alice" should contain "0" element
+
+  @files_sharing-app-required
+  Scenario: User can access meta folder of a file which is owned by somebody else but shared with that user
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "123" to "/davtest.txt"
+    And user "Alice" has uploaded file with content "456789" to "/davtest.txt"
+    And we save it into "FILEID"
+    And user "Alice" has created a share with settings
+      | path        | /davtest.txt |
+      | shareType   | user         |
+      | shareWith   | Brian        |
+      | permissions | read         |
+    When user "Brian" accepts share "/davtest.txt" offered by user "Alice" using the sharing API
+    Then the HTTP status code should be "200"
+    And the version folder of fileId "<<FILEID>>" for user "Brian" should contain "1" element
+
+  @files_sharing-app-required
+  Scenario: sharer of a file can see the old version information when the sharee changes the content of the file
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
+    And user "Alice" has shared file "sharefile.txt" with user "Brian"
+    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
+    When user "Brian" uploads file with content "Second content" to "/Shares/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element
+    And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element
+
+  @files_sharing-app-required
+  Scenario: sharer of a file can restore the original content of a shared file after the file has been modified by the sharee
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
+    And user "Alice" has shared file "sharefile.txt" with user "Brian"
+    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
+    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt"
+    When user "Alice" restores version index "1" of file "/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharefile.txt" for user "Alice" should be "First content"
+    And the content of file "/Shares/sharefile.txt" for user "Brian" should be "First content"
+
+  @files_sharing-app-required
+  Scenario: sharer can restore a file inside a shared folder modified by sharee
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
+    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt"
+    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
+
+  @files_sharing-app-required
+  Scenario: sharee can restore a file inside a shared folder modified by sharee
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
+    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt"
+    When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
+
+  @files_sharing-app-required
+  Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharer
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt"
+    And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
+    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
+
+  @files_sharing-app-required
+  Scenario: sharee can restore a file inside a shared folder created by sharee and modified by sharer
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt"
+    And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
+    When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
+
+  @files_sharing-app-required
+  Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharee
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Brian" has uploaded file with content "old content" to "/Shares/sharingfolder/sharefile.txt"
+    And user "Brian" has uploaded file with content "new content" to "/Shares/sharingfolder/sharefile.txt"
+    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
+
+  @files_sharing-app-required
+  Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
+    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
+    When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
+
+  @files_sharing-app-required @issue-ocis-reva-34
+  Scenario: sharer can restore a file inside a group shared folder modified by sharee
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Carol" has been created with default attributes and without skeleton files
+    And group "grp1" has been created
+    And user "Brian" has been added to group "grp1"
+    And user "Carol" has been added to group "grp1"
+    And user "Alice" has created folder "/sharingfolder"
+    And user "Alice" has shared folder "/sharingfolder" with group "grp1"
+    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Carol" has accepted share "/sharingfolder" offered by user "Alice"
+    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
+    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt"
+    And user "Carol" has uploaded file with content "Third content" to "/Shares/sharingfolder/sharefile.txt"
+    When user "Alice" restores version index "2" of file "/sharingfolder/sharefile.txt" using the WebDAV API
+    Then the HTTP status code should be "204"
+    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
+    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Carol" should be "First content"
+
+  @files_sharing-app-required @issue-ocis-reva-386
+  Scenario Outline: Moving a file (with versions) into a shared folder as the sharee and as the sharer
+    Given using <dav_version> DAV path
+    And user "Brian" has been created with default attributes and without skeleton files
+    And user "Brian" has created folder "/testshare"
+    And user "Brian" has created a share with settings
+      | path        | testshare |
+      | shareType   | user      |
+      | permissions | change    |
+      | shareWith   | Alice     |
+    And user "Alice" has accepted share "/testshare" offered by user "Brian"
+    And user "<mover>" has uploaded file with content "test data 1" to "/testfile.txt"
+    And user "<mover>" has uploaded file with content "test data 2" to "/testfile.txt"
+    And user "<mover>" has uploaded file with content "test data 3" to "/testfile.txt"
+    When user "<mover>" moves file "/testfile.txt" to "<dst-folder>/testfile.txt" using the WebDAV API
+    Then the HTTP status code should be "201"
+    And the content of file "/Shares/testshare/testfile.txt" for user "Alice" should be "test data 3"
+    And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data 3"
+    And as "<mover>" file "/testfile.txt" should not exist
+    And the version folder of file "/Shares/testshare/testfile.txt" for user "Alice" should contain "2" elements
+    And the version folder of file "/testshare/testfile.txt" for user "Brian" should contain "2" elements
+    Examples:
+      | dav_version | mover | dst-folder        |
+      | old         | Brian | /testshare        |
+      | new         | Brian | /testshare        |
+
+  @files_sharing-app-required @issue-ocis-reva-386
+  Scenario Outline: Moving a file (with versions) out of a shared folder as the sharee and as the sharer
+    Given using <dav_version> DAV path
+    And user "Brian" has been created with default attributes and without skeleton files
+    And user "Brian" has created folder "/testshare"
+    And user "Brian" has uploaded file with content "test data 1" to "/testshare/testfile.txt"
+    And user "Brian" has uploaded file with content "test data 2" to "/testshare/testfile.txt"
+    And user "Brian" has uploaded file with content "test data 3" to "/testshare/testfile.txt"
+    And user "Brian" has created a share with settings
+      | path        | testshare |
+      | shareType   | user      |
+      | permissions | change    |
+      | shareWith   | Alice     |
+    And user "Alice" has accepted share "/testshare" offered by user "Brian"
+    When user "<mover>" moves file "<src-folder>/testfile.txt" to "/testfile.txt" using the WebDAV API
+    Then the HTTP status code should be "201"
+    And the content of file "/testfile.txt" for user "<mover>" should be "test data 3"
+    And as "Alice" file "/Shares/testshare/testfile.txt" should not exist
+    And as "Brian" file "/testshare/testfile.txt" should not exist
+    And the version folder of file "/testfile.txt" for user "<mover>" should contain "2" elements
+    Examples:
+      | dav_version | mover | src-folder |
+      | old         | Brian | /testshare |
+      | new         | Brian | /testshare |
+
+  @files_sharing-app-required
+  Scenario: Receiver tries to get file versions of unshared file from the sharer
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "textfile1" to "textfile1.txt"
+    And user "Alice" has shared file "textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
+    When user "Brian" tries to get versions of file "textfile1.txt" from "Alice"
+    Then the HTTP status code should be "404"
+    And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
+
+  @skipOnStorage:ceph @files_primary_s3-issue-161 @files_sharing-app-required
+  Scenario: Receiver tries get file versions of shared file from the sharer
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 3" to "textfile0.txt"
+    And user "Alice" has shared file "textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
+    When user "Brian" tries to get versions of file "textfile0.txt" from "Alice"
+    Then the HTTP status code should be "207"
+    And the number of versions should be "3"
+
+  @issue-760
+  Scenario: Receiver tries get file versions of shared file before receiving it
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
+    And we save it into "FILEID"
+    And user "Alice" has shared file "textfile0.txt" with user "Brian"
+    When user "Brian" tries to get versions of file "textfile0.txt" from "Alice"
+    Then the HTTP status code should be "404"
+    And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
+
+
+  Scenario: sharer tries get file versions of shared file when the sharee changes the content of the file
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
+    And user "Alice" has shared file "sharefile.txt" with user "Brian"
+    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
+    When user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt"
+    Then the HTTP status code should be "204"
+    And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element
+    And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element
+
+
+  Scenario: download old versions of a shared file as share receiver
+    Given user "Brian" has been created with default attributes and without skeleton files
+    And user "Alice" has uploaded file with content "uploaded content" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
+    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
+    And user "Alice" has shared file "textfile0.txt" with user "Brian"
+    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
+    When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "1"
+    Then the HTTP status code should be "200"
+    And the following headers should be set
+      | header              | value                                                                |
+      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
+    And the downloaded content should be "version 1"
+    When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "2"
+    Then the HTTP status code should be "200"
+    And the following headers should be set
+      | header              | value                                                                |
+      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
+    And the downloaded content should be "uploaded content"
\ No newline at end of file
diff --git a/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature b/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature
deleted file mode 100644
index c53de028988..00000000000
--- a/tests/acceptance/features/coreApiVersions/fileVersionsSharingToShares.feature
+++ /dev/null
@@ -1,324 +0,0 @@
-@api @files_versions-app-required @issue-ocis-reva-275
-
-Feature: dav-versions
-
-  Background:
-    Given using OCS API version "2"
-    And using new DAV path
-    And the administrator has set the default folder for received shares to "Shares"
-    And auto-accept shares has been disabled
-    And user "Alice" has been created with default attributes and without skeleton files
-
-
-  Scenario: Upload file and no version is available
-    When user "Alice" uploads file "filesForUpload/davtest.txt" to "/davtest.txt" using the WebDAV API
-    Then the version folder of file "/davtest.txt" for user "Alice" should contain "0" elements
-
-  @files_sharing-app-required
-  Scenario: User can access meta folder of a file which is owned by somebody else but shared with that user
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "123" to "/davtest.txt"
-    And user "Alice" has uploaded file with content "456789" to "/davtest.txt"
-    And we save it into "FILEID"
-    And user "Alice" has created a share with settings
-      | path        | /davtest.txt |
-      | shareType   | user         |
-      | shareWith   | Brian        |
-      | permissions | read         |
-    When user "Brian" accepts share "/davtest.txt" offered by user "Alice" using the sharing API
-    Then the HTTP status code should be "200"
-    And the version folder of fileId "<<FILEID>>" for user "Brian" should contain "1" element
-
-  @files_sharing-app-required
-  Scenario: sharer of a file can see the old version information when the sharee changes the content of the file
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
-    And user "Alice" has shared file "sharefile.txt" with user "Brian"
-    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
-    When user "Brian" uploads file with content "Second content" to "/Shares/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element
-    And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element
-
-  @files_sharing-app-required
-  Scenario: sharer of a file can restore the original content of a shared file after the file has been modified by the sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
-    And user "Alice" has shared file "sharefile.txt" with user "Brian"
-    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
-    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/Shares/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required
-  Scenario: sharer can restore a file inside a shared folder modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required
-  Scenario: sharee can restore a file inside a shared folder modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required
-  Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required
-  Scenario: sharee can restore a file inside a shared folder created by sharee and modified by sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Brian" has uploaded file with content "First content" to "/Shares/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "Second content" to "/sharingfolder/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-
-  @files_sharing-app-required
-  Scenario: sharer can restore a file inside a shared folder created by sharee and modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Brian" has uploaded file with content "old content" to "/Shares/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "new content" to "/Shares/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "1" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required
-  Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/Shares/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a file inside a shared folder created by sharer and modified by sharer, when the folder has been moved by the sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with user "Brian"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has created folder "/received"
-    And user "Brian" has moved folder "/Shares/sharingfolder" to "/received/sharingfolder"
-    When user "Brian" restores version index "1" of file "/received/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/received/sharingfolder/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is at the top level of the sharer)
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "old content" to "/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharefile.txt"
-    And user "Alice" has shared file "/sharefile.txt" with user "Brian"
-    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
-    And user "Brian" has created folder "/received"
-    And user "Brian" has moved file "/Shares/sharefile.txt" to "/received/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/received/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @notToImplementOnOCIS
-  Scenario: sharee can restore a shared file created and modified by sharer, when the file has been moved by the sharee (file is inside a folder of the sharer)
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has uploaded file with content "old content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has uploaded file with content "new content" to "/sharingfolder/sharefile.txt"
-    And user "Alice" has shared file "/sharingfolder/sharefile.txt" with user "Brian"
-    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
-    And user "Brian" has created folder "/received"
-    And user "Brian" has moved file "/Shares/sharefile.txt" to "/received/sharefile.txt"
-    When user "Brian" restores version index "1" of file "/received/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "old content"
-    And the content of file "/received/sharefile.txt" for user "Brian" should be "old content"
-
-  @files_sharing-app-required @issue-ocis-reva-34
-  Scenario: sharer can restore a file inside a group shared folder modified by sharee
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Carol" has been created with default attributes and without skeleton files
-    And group "grp1" has been created
-    And user "Brian" has been added to group "grp1"
-    And user "Carol" has been added to group "grp1"
-    And user "Alice" has created folder "/sharingfolder"
-    And user "Alice" has shared folder "/sharingfolder" with group "grp1"
-    And user "Brian" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Carol" has accepted share "/sharingfolder" offered by user "Alice"
-    And user "Alice" has uploaded file with content "First content" to "/sharingfolder/sharefile.txt"
-    And user "Brian" has uploaded file with content "Second content" to "/Shares/sharingfolder/sharefile.txt"
-    And user "Carol" has uploaded file with content "Third content" to "/Shares/sharingfolder/sharefile.txt"
-    When user "Alice" restores version index "2" of file "/sharingfolder/sharefile.txt" using the WebDAV API
-    Then the HTTP status code should be "204"
-    And the content of file "/sharingfolder/sharefile.txt" for user "Alice" should be "First content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Brian" should be "First content"
-    And the content of file "/Shares/sharingfolder/sharefile.txt" for user "Carol" should be "First content"
-
-  @files_sharing-app-required @issue-ocis-reva-386
-  Scenario Outline: Moving a file (with versions) into a shared folder as the sharee and as the sharer
-    Given using <dav_version> DAV path
-    And user "Brian" has been created with default attributes and without skeleton files
-    And user "Brian" has created folder "/testshare"
-    And user "Brian" has created a share with settings
-      | path        | testshare |
-      | shareType   | user      |
-      | permissions | change    |
-      | shareWith   | Alice     |
-    And user "Alice" has accepted share "/testshare" offered by user "Brian"
-    And user "<mover>" has uploaded file with content "test data 1" to "/testfile.txt"
-    And user "<mover>" has uploaded file with content "test data 2" to "/testfile.txt"
-    And user "<mover>" has uploaded file with content "test data 3" to "/testfile.txt"
-    When user "<mover>" moves file "/testfile.txt" to "<dst-folder>/testfile.txt" using the WebDAV API
-    Then the HTTP status code should be "201"
-    And the content of file "/Shares/testshare/testfile.txt" for user "Alice" should be "test data 3"
-    And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data 3"
-    And as "<mover>" file "/testfile.txt" should not exist
-    And the version folder of file "/Shares/testshare/testfile.txt" for user "Alice" should contain "2" elements
-    And the version folder of file "/testshare/testfile.txt" for user "Brian" should contain "2" elements
-    Examples:
-      | dav_version | mover | dst-folder        |
-      | old         | Alice | /Shares/testshare |
-      | new         | Alice | /Shares/testshare |
-      | old         | Brian | /testshare        |
-      | new         | Brian | /testshare        |
-
-  @files_sharing-app-required @issue-ocis-reva-386
-  Scenario Outline: Moving a file (with versions) out of a shared folder as the sharee and as the sharer
-    Given using <dav_version> DAV path
-    And user "Brian" has been created with default attributes and without skeleton files
-    And user "Brian" has created folder "/testshare"
-    And user "Brian" has uploaded file with content "test data 1" to "/testshare/testfile.txt"
-    And user "Brian" has uploaded file with content "test data 2" to "/testshare/testfile.txt"
-    And user "Brian" has uploaded file with content "test data 3" to "/testshare/testfile.txt"
-    And user "Brian" has created a share with settings
-      | path        | testshare |
-      | shareType   | user      |
-      | permissions | change    |
-      | shareWith   | Alice     |
-    And user "Alice" has accepted share "/testshare" offered by user "Brian"
-    When user "<mover>" moves file "<src-folder>/testfile.txt" to "/testfile.txt" using the WebDAV API
-    Then the HTTP status code should be "201"
-    And the content of file "/testfile.txt" for user "<mover>" should be "test data 3"
-    And as "Alice" file "/Shares/testshare/testfile.txt" should not exist
-    And as "Brian" file "/testshare/testfile.txt" should not exist
-    And the version folder of file "/testfile.txt" for user "<mover>" should contain "2" elements
-
-    @notToImplementOnOCIS
-    Examples:
-      | dav_version | mover | src-folder        |
-      | old         | Alice | /Shares/testshare |
-      | new         | Alice | /Shares/testshare |
-
-
-    Examples:
-      | dav_version | mover | src-folder |
-      | old         | Brian | /testshare |
-      | new         | Brian | /testshare |
-
-  @files_sharing-app-required
-  Scenario: Receiver tries to get file versions of unshared file from the sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "textfile1" to "textfile1.txt"
-    And user "Alice" has shared file "textfile0.txt" with user "Brian"
-    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
-    When user "Brian" tries to get versions of file "textfile1.txt" from "Alice"
-    Then the HTTP status code should be "404"
-    And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
-
-  @skipOnStorage:ceph @files_primary_s3-issue-161 @files_sharing-app-required
-  Scenario: Receiver tries get file versions of shared file from the sharer
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 3" to "textfile0.txt"
-    And user "Alice" has shared file "textfile0.txt" with user "Brian"
-    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
-    When user "Brian" tries to get versions of file "textfile0.txt" from "Alice"
-    Then the HTTP status code should be "207"
-    And the number of versions should be "3"
-
-
-  Scenario: Receiver tries get file versions of shared file before receiving it
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "textfile0" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
-    And we save it into "FILEID"
-    And user "Alice" has shared file "textfile0.txt" with user "Brian"
-    When user "Brian" tries to get versions of file "textfile0.txt" from "Alice"
-    Then the HTTP status code should be "404"
-    And the value of the item "//s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
-
-
-  Scenario: sharer tries get file versions of shared file when the sharee changes the content of the file
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "First content" to "sharefile.txt"
-    And user "Alice" has shared file "sharefile.txt" with user "Brian"
-    And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice"
-    When user "Brian" has uploaded file with content "Second content" to "/Shares/sharefile.txt"
-    Then the HTTP status code should be "204"
-    And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element
-    And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element
-
-
-  Scenario: download old versions of a shared file as share receiver
-    Given user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has uploaded file with content "uploaded content" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 1" to "textfile0.txt"
-    And user "Alice" has uploaded file with content "version 2" to "textfile0.txt"
-    And user "Alice" has shared file "textfile0.txt" with user "Brian"
-    And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
-    When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "1"
-    Then the HTTP status code should be "200"
-    And the following headers should be set
-      | header              | value                                                                |
-      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
-    And the downloaded content should be "version 1"
-    When user "Brian" downloads the version of file "/Shares/textfile0.txt" with the index "2"
-    Then the HTTP status code should be "200"
-    And the following headers should be set
-      | header              | value                                                                |
-      | Content-Disposition | attachment; filename*=UTF-8''textfile0.txt; filename="textfile0.txt" |
-    And the downloaded content should be "uploaded content"