Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix listing shares to multiple groups #3741

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix listing shares to multiple groups

Users can now see the shares to all groups they are a member of.

https://github.com/cs3org/reva/pull/3741
12 changes: 8 additions & 4 deletions pkg/share/manager/jsoncs3/jsoncs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,21 @@ func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaborati
for ssid, spaceShareIDs := range m.GroupReceivedCache.List(group) {
// add a pending entry, the state will be updated
// when reading the received shares below if they have already been accepted or denied
rs := receivedsharecache.Space{
Mtime: spaceShareIDs.Mtime,
States: make(map[string]*receivedsharecache.State, len(spaceShareIDs.IDs)),
var rs *receivedsharecache.Space
var ok bool
if rs, ok = ssids[ssid]; !ok {
rs = &receivedsharecache.Space{
Mtime: spaceShareIDs.Mtime,
States: make(map[string]*receivedsharecache.State, len(spaceShareIDs.IDs)),
}
ssids[ssid] = rs
}

for shareid := range spaceShareIDs.IDs {
rs.States[shareid] = &receivedsharecache.State{
State: collaboration.ShareState_SHARE_STATE_PENDING,
}
}
ssids[ssid] = &rs
}
}

Expand Down