diff --git a/changelog/unreleased/allow-update-ocm-shares.md b/changelog/unreleased/allow-update-ocm-shares.md new file mode 100644 index 0000000000..3660978584 --- /dev/null +++ b/changelog/unreleased/allow-update-ocm-shares.md @@ -0,0 +1,6 @@ +Bugfix: Allow update of ocm shares + +We fixed a bug that prevented ocm shares to be updated or removed. + +https://github.com/owncloud/ocis/pull/9980 +https://github.com/owncloud/ocis/issues/9926 diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index 093e0b5f43..3a457310cd 100644 --- a/changelog/unreleased/bump-reva.md +++ b/changelog/unreleased/bump-reva.md @@ -2,6 +2,8 @@ Enhancement: Bump reva Bumps reva version +https://github.com/owncloud/ocis/pull/9980 +https://github.com/owncloud/ocis/pull/9981 https://github.com/owncloud/ocis/pull/9981 https://github.com/owncloud/ocis/pull/9920 https://github.com/owncloud/ocis/pull/9879 diff --git a/go.mod b/go.mod index 1351b7e9de..c9a1c57fd4 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.11.0 github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb - github.com/cs3org/reva/v2 v2.23.1-0.20240909172158-5fd1e89e1557 + github.com/cs3org/reva/v2 v2.24.1-0.20240911132317-de8cea1f9e72 github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 diff --git a/go.sum b/go.sum index d253454ff3..b611901a63 100644 --- a/go.sum +++ b/go.sum @@ -255,8 +255,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c= github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME= github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb h1:KmYZDReplv/yfwc1LNYpDcVhVujC3Pasv6WjXx1haSU= github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb/go.mod h1:yyP8PRo0EZou3nSH7H4qjlzQwaydPeIRNgX50npQHpE= -github.com/cs3org/reva/v2 v2.23.1-0.20240909172158-5fd1e89e1557 h1:ZVjUBlOU4jfRVSW3xCc0GKxXsYJzwZ7LTfKlqnWvXMw= -github.com/cs3org/reva/v2 v2.23.1-0.20240909172158-5fd1e89e1557/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= +github.com/cs3org/reva/v2 v2.24.1-0.20240911132317-de8cea1f9e72 h1:J1CCIbBOKVGEqEng3OwZzeX5jVLb8iTzM251D2C8oyo= +github.com/cs3org/reva/v2 v2.24.1-0.20240911132317-de8cea1f9e72/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/services/graph/pkg/service/v0/base.go b/services/graph/pkg/service/v0/base.go index dcbb3bf2bd..6992a2e994 100644 --- a/services/graph/pkg/service/v0/base.go +++ b/services/graph/pkg/service/v0/base.go @@ -925,7 +925,7 @@ func (g BaseGraphService) updateOCMPermission(ctx context.Context, permissionID return nil, err } - condition, err := roleConditionForResourceType(resourceInfo) + condition, err := federatedRoleConditionForResourceType(resourceInfo) if err != nil { return nil, err } @@ -1030,10 +1030,12 @@ func (g BaseGraphService) updateUserShare(ctx context.Context, permissionID stri if err != nil { return nil, err } + condition, err := roleConditionForResourceType(resourceInfo) if err != nil { return nil, err } + var cs3UpdateShareReq collaboration.UpdateShareRequest // When updating a space root we need to reference the share by resourceId and grantee if IsSpaceRoot(itemID) { diff --git a/services/graph/pkg/unifiedrole/roles.go b/services/graph/pkg/unifiedrole/roles.go index 27d9af8aa9..12cf070473 100644 --- a/services/graph/pkg/unifiedrole/roles.go +++ b/services/graph/pkg/unifiedrole/roles.go @@ -38,10 +38,6 @@ const ( UnifiedRoleManagerID = "312c0871-5ef7-4b3a-85b6-0e4074c64049" // UnifiedRoleSecureViewerID Unified role secure viewer id. UnifiedRoleSecureViewerID = "aa97fe03-7980-45ac-9e50-b325749fd7e6" - // UnifiedRoleFederatedViewerID Unified role federated viewer id. - UnifiedRoleFederatedViewerID = "be531789-063c-48bf-a9fe-857e6fbee7da" - // UnifiedRoleFederatedEditorID Unified role federated editor id. - UnifiedRoleFederatedEditorID = "36279a93-e4e3-4bbb-8a23-53b05b560963" // Wile the below conditions follow the SDDL syntax, they are not parsed anywhere. We use them as strings to // represent the constraints that a role definition applies to. For the actual syntax, see the SDDL documentation diff --git a/services/web/pkg/theme/theme.go b/services/web/pkg/theme/theme.go index 0477be28e9..35f8422062 100644 --- a/services/web/pkg/theme/theme.go +++ b/services/web/pkg/theme/theme.go @@ -65,14 +65,6 @@ var themeDefaults = KV{ "label": "UnifiedRoleSecureView", "iconName": "shield", }, - unifiedrole.UnifiedRoleFederatedViewerID: KV{ - "label": "UnifiedRoleFederatedViewer", - "iconName": "eye", - }, - unifiedrole.UnifiedRoleFederatedEditorID: KV{ - "label": "UnifiedRoleFederatedEditor", - "iconName": "pencil", - }, }, }, } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/ocm/share/repository/json/json.go b/vendor/github.com/cs3org/reva/v2/pkg/ocm/share/repository/json/json.go index 234b76553a..007022cd51 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/ocm/share/repository/json/json.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/ocm/share/repository/json/json.go @@ -31,14 +31,15 @@ import ( ocm "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" typespb "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" + "github.com/google/uuid" + "github.com/pkg/errors" + "google.golang.org/genproto/protobuf/field_mask" + "github.com/cs3org/reva/v2/pkg/errtypes" "github.com/cs3org/reva/v2/pkg/ocm/share" "github.com/cs3org/reva/v2/pkg/ocm/share/repository/registry" "github.com/cs3org/reva/v2/pkg/utils" "github.com/cs3org/reva/v2/pkg/utils/cfg" - "github.com/google/uuid" - "github.com/pkg/errors" - "google.golang.org/genproto/protobuf/field_mask" ) func init() { @@ -466,7 +467,17 @@ func (m *mgr) UpdateShare(ctx context.Context, user *userpb.User, ref *ocm.Share } } - return s, nil + clone, err := cloneShare(s) + if err != nil { + return nil, err + } + m.model.Shares[s.Id.OpaqueId] = clone + + if err := m.save(); err != nil { + return nil, errors.Wrap(err, "error saving share") + } + + return clone, nil } } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 004a2f5218..61544bf28a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -367,7 +367,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.23.1-0.20240909172158-5fd1e89e1557 +# github.com/cs3org/reva/v2 v2.24.1-0.20240911132317-de8cea1f9e72 ## explicit; go 1.21 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime