diff --git a/changelog/unreleased/implement-share_sharetype.md b/changelog/unreleased/implement-share_sharetype.md new file mode 100644 index 0000000000..e7c4ab171b --- /dev/null +++ b/changelog/unreleased/implement-share_sharetype.md @@ -0,0 +1,5 @@ +Enhancement: Implement cs3.sharing.collaboration.v1beta1.Share.ShareType + +Interface method Share() in pkg/ocm/share/share.go now has a share type parameter. + +https://github.com/cs3org/reva/pull/1563 \ No newline at end of file diff --git a/internal/grpc/services/ocmcore/ocmcore.go b/internal/grpc/services/ocmcore/ocmcore.go index 9d69fcd8b4..c6b814b8f0 100644 --- a/internal/grpc/services/ocmcore/ocmcore.go +++ b/internal/grpc/services/ocmcore/ocmcore.go @@ -171,7 +171,7 @@ func (s *service) CreateOCMCoreShare(ctx context.Context, req *ocmcore.CreateOCM }, } - share, err := s.sm.Share(ctx, resource, grant, req.Name, nil, "", req.Owner, token) + share, err := s.sm.Share(ctx, resource, grant, req.Name, nil, "", req.Owner, token, ocm.Share_SHARE_TYPE_REGULAR) if err != nil { return &ocmcore.CreateOCMCoreShareResponse{ Status: status.NewInternal(ctx, err, "error creating ocm core share"), diff --git a/internal/grpc/services/ocmshareprovider/ocmshareprovider.go b/internal/grpc/services/ocmshareprovider/ocmshareprovider.go index 15fd779bb5..6512c4acd1 100644 --- a/internal/grpc/services/ocmshareprovider/ocmshareprovider.go +++ b/internal/grpc/services/ocmshareprovider/ocmshareprovider.go @@ -144,7 +144,7 @@ func (s *service) CreateOCMShare(ctx context.Context, req *ocm.CreateOCMShareReq }, nil } - share, err := s.sm.Share(ctx, req.ResourceId, req.Grant, name, req.RecipientMeshProvider, permissions, nil, "") + share, err := s.sm.Share(ctx, req.ResourceId, req.Grant, name, req.RecipientMeshProvider, permissions, nil, "", ocm.Share_SHARE_TYPE_REGULAR) if err != nil { return &ocm.CreateOCMShareResponse{ Status: status.NewInternal(ctx, err, "error creating share"), diff --git a/pkg/ocm/share/manager/json/json.go b/pkg/ocm/share/manager/json/json.go index 850dc712a7..b37e0f5450 100644 --- a/pkg/ocm/share/manager/json/json.go +++ b/pkg/ocm/share/manager/json/json.go @@ -196,7 +196,7 @@ func getOCMEndpoint(originProvider *ocmprovider.ProviderInfo) (string, error) { } func (m *mgr) Share(ctx context.Context, md *provider.ResourceId, g *ocm.ShareGrant, name string, - pi *ocmprovider.ProviderInfo, pm string, owner *userpb.UserId, token string) (*ocm.Share, error) { + pi *ocmprovider.ProviderInfo, pm string, owner *userpb.UserId, token string, st ocm.Share_ShareType) (*ocm.Share, error) { id := genID() now := time.Now().UnixNano() @@ -265,6 +265,7 @@ func (m *mgr) Share(ctx context.Context, md *provider.ResourceId, g *ocm.ShareGr Creator: userID, Ctime: ts, Mtime: ts, + ShareType: st, } if isOwnersMeshProvider { diff --git a/pkg/ocm/share/share.go b/pkg/ocm/share/share.go index 428ab86713..9eb439a6e0 100644 --- a/pkg/ocm/share/share.go +++ b/pkg/ocm/share/share.go @@ -31,7 +31,7 @@ import ( type Manager interface { // Create a new share in fn with the given acl. Share(ctx context.Context, md *provider.ResourceId, g *ocm.ShareGrant, name string, - pi *ocmprovider.ProviderInfo, pm string, owner *userpb.UserId, token string) (*ocm.Share, error) + pi *ocmprovider.ProviderInfo, pm string, owner *userpb.UserId, token string, st ocm.Share_ShareType) (*ocm.Share, error) // GetShare gets the information for a share by the given ref. GetShare(ctx context.Context, ref *ocm.ShareReference) (*ocm.Share, error)