Skip to content

Commit

Permalink
fix(files_sharing): Only clear permissions of pending federated shares
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Jan 27, 2025
1 parent 8ce1c96 commit 4dd5f82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/files_sharing/src/services/SharingService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ describe('SharingService share to Node mapping', () => {
expect(file.mtime?.getTime()).toBe(remoteFile.mtime * 1000)
// not available for remote shares
expect(file.size).toBe(undefined)
expect(file.permissions).toBe(0)
expect(file.permissions).toBe(19)
expect(file.root).toBe('/files/test')
expect(file.attributes).toBeInstanceOf(Object)
expect(file.attributes.favorite).toBe(0)
Expand Down
9 changes: 6 additions & 3 deletions apps/files_sharing/src/services/SharingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ const ocsEntryToNode = async function(ocsEntry: any): Promise<Folder | File | nu
ocsEntry.file_target = ocsEntry.name
}

// Need to set permissions to NONE for federated shares
ocsEntry.item_permissions = Permission.NONE
ocsEntry.permissions = Permission.NONE
// If the share is not accepted yet we don't know which permissions it will have
if (!ocsEntry.accepted) {
// Need to set permissions to NONE for federated shares
ocsEntry.item_permissions = Permission.NONE
ocsEntry.permissions = Permission.NONE
}

ocsEntry.uid_owner = ocsEntry.owner
// TODO: have the real display name stored somewhere
Expand Down

0 comments on commit 4dd5f82

Please sign in to comment.