mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-10 06:10:05 -06:00
graph/sharedWithMe: Fix 'createdBy' attribute for resources from project spaces
Don't return a meaningless userid anymore for shares created from files or directories in a project space. These resources don't have a real owner. Fixes: #8314
This commit is contained in:
committed by
Ralf Haferkamp
parent
a44cf4a6ea
commit
36eff3b280
@@ -226,7 +226,7 @@ func (g Graph) cs3ReceivedSharesToDriveItems(ctx context.Context, receivedShares
|
||||
remoteItem.SetSize(s)
|
||||
}
|
||||
|
||||
if userID := shareStat.GetInfo().GetOwner(); userID != nil {
|
||||
if userID := shareStat.GetInfo().GetOwner(); userID != nil && userID.Type != cs3User.UserType_USER_TYPE_SPACE_OWNER {
|
||||
identity, err := g.cs3UserIdToIdentity(ctx, userID)
|
||||
if err != nil {
|
||||
// TODO: define a proper error behavior here. We don't
|
||||
|
||||
@@ -387,8 +387,7 @@ var _ = Describe("SharedWithMe", func() {
|
||||
|
||||
jsonData := gjson.Get(tape.Body.String(), "value.0.createdBy")
|
||||
|
||||
Expect(jsonData.Get("user.displayName").String()).To(Equal(""))
|
||||
Expect(jsonData.Get("user.id").String()).To(Equal(ownerID.OpaqueId))
|
||||
Expect(jsonData.String()).To(Equal(""))
|
||||
|
||||
jsonData = gjson.Get(tape.Body.String(), "value.0.remoteItem.permissions.0.invitation.invitedBy.user")
|
||||
Expect(jsonData.Get("displayName").String()).To(Equal(getUserResponseShareCreator.User.DisplayName))
|
||||
|
||||
Reference in New Issue
Block a user