osjs-server icon indicating copy to clipboard operation
osjs-server copied to clipboard

Add Share and Unshare APIs to vfs

Open mahsashadi opened this issue 1 year ago • 3 comments

Hi.

How do you think about adding share and unshare APIs to VFS, so that files could be shared with some other users ( for example by adding some metadata to files ). This would allow having our storage APIs implemented in our VFS adapter.

mahsashadi avatar Mar 07 '23 13:03 mahsashadi

Sounds nice.

One way this could be solved would be to have an internal service that connects to some kind of database and when you "share" a file a row would be inserted with the path and the user id or something like this. This would be server-side VFS only.

Then it would be possible to provide a mountpoint with a VFS adapter that uses the same database to enumerate files etc.

This approach would require it to work like this:

  • A user (1) navigates to home:/stuff and shares their file README.txt
  • An API call is made to the service and this is inserted: {sourceUserId: 1, targetUserIds: [/* a list or none for all... could even be groups*/], path: 'home:/stuff/README.txt' }`
  • A user (2) now can go to shared:/ and see the following structure <name of user 1>/stuff/README.md.

andersevenrud avatar Mar 08 '23 22:03 andersevenrud

Thanks for your reply and your detailed solution. Is it possible to only have these APIs signatures on VFS for now? We need this sharing logic in our swift vfs adapter, which its implementation is completely different.

mahsashadi avatar Mar 11 '23 11:03 mahsashadi

It could probably be solved in a few different ways. I don't really know what solution would fit your use-case the best.

But if it's something you need for your custom adapter, then I suppose it could be purely solved in the VFS side of thing for the most part (UI needs support as well).

andersevenrud avatar Mar 11 '23 16:03 andersevenrud