diff --git a/changelog/unreleased/prevent-access-to-disabled-space.md b/changelog/unreleased/prevent-access-to-disabled-space.md new file mode 100644 index 00000000000..8d22249d4ed --- /dev/null +++ b/changelog/unreleased/prevent-access-to-disabled-space.md @@ -0,0 +1,6 @@ +Change: Prevent access to disabled space + +Previously managers where allowed to edit the space even when it is disabled +This is no longer possible + +https://github.com/owncloud/ocis/pull/3779 diff --git a/changelog/unreleased/update-reva.md b/changelog/unreleased/update-reva.md index 3b500a76d99..41e626d89ef 100644 --- a/changelog/unreleased/update-reva.md +++ b/changelog/unreleased/update-reva.md @@ -4,3 +4,4 @@ bumps reva version https://github.com/owncloud/ocis/pull/3746 https://github.com/owncloud/ocis/pull/3771 +https://github.com/owncloud/ocis/pull/3778 diff --git a/extensions/graph/pkg/service/v0/drives.go b/extensions/graph/pkg/service/v0/drives.go index 6fde3c5a002..0b3993d01fa 100644 --- a/extensions/graph/pkg/service/v0/drives.go +++ b/extensions/graph/pkg/service/v0/drives.go @@ -401,10 +401,14 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces if err != nil { return nil, err } - res.Special = g.GetExtendedSpaceProperties(ctx, baseURL, storageSpace) - res.Quota, err = g.getDriveQuota(ctx, storageSpace) - if err != nil { - return nil, err + + // 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) + if err != nil { + return nil, err + } } responses = append(responses, res) } diff --git a/go.mod b/go.mod index bfcf4811abf..52f6bed48a6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.1 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde - github.com/cs3org/reva/v2 v2.3.2-0.20220511140414-9205e8486b72 + github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6 github.com/disintegration/imaging v1.6.2 github.com/go-chi/chi/v5 v5.0.7 github.com/go-chi/cors v1.2.1 diff --git a/go.sum b/go.sum index 94597b17de9..577328e1e96 100644 --- a/go.sum +++ b/go.sum @@ -296,8 +296,8 @@ github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD9 github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0eBzpzVBIuczDhqVq50Nmjc7PGHHA9Y= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.3.2-0.20220511140414-9205e8486b72 h1:V46ZlmNARoJ8b46lvQeO3CdCY6GAhzxpWHFxV8SX88U= -github.com/cs3org/reva/v2 v2.3.2-0.20220511140414-9205e8486b72/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= +github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6 h1:SsL8/Uu/h8fYxi44iEg8MbziujeyVMZdwZECeaoMBww= +github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index eae806c58a7..7ce27c67ffd 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -19,6 +19,3 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiArchiver/downloadById.feature:134](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L134) - [apiArchiver/downloadById.feature:135](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L135) -#### [Overwriting a file in the space within the allowed quota does not work](https://github.com/owncloud/ocis/issues/2829) -- [apiSpaces/quota.feature:56](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/quota.feature#L56) -