[feature] Add shared directories in the shared tab#1491
[feature] Add shared directories in the shared tab#1491Louis-Pagnier-KW merged 4 commits intomainfrom
Conversation
158ceb3 to
b0444a3
Compare
b0444a3 to
b4e3bfb
Compare
Shared tab redirect to browse data
BryonLewis
left a comment
There was a problem hiding this comment.
Thanks this is great.
One minor comment about admins not having data shared with them. It may only depend on the deployment for how that could impact users but I assume you want to have items show up to people if it's been explicitly shared, including admins.
server/dive_server/crud_override.py
Outdated
| ): | ||
| query = { | ||
| '$and': [ | ||
| Folder().permissionClauses(user=user, level=AccessType.READ), |
There was a problem hiding this comment.
The only thing I see in this PR that may cause a problem would be with the deployment and how it is used (on small deployments this may be an issue).
Admins while they have implicit access to everything you can still explicitly share folders and files with them.
The current .permissionClauses folder will return back a falsy {} meaning that admins won't see anything explicitly shared with them.
You could check clone the user object and make sure that internal object doesn't see the user as an admin or you could check the response and see if it is an empty object to make it so Admin's can see what is shared with them.
There was a problem hiding this comment.
Thank you, I effectively forgot to test with admin accounts.
The get_folders_shared_with_me_query code was almost the same as the permissionClauses method, so I just added the 'level' condition, and removed the permissionClauses dependency.
I have also included folders that are explicitly shared with groups that the user belongs to.


In the "shared with me" tab, only datasets were shown.
Now, it also includes any shared directory to the user, so it can download and interact with shared files.
Previously, the user was not able to navigate to a shared directory that was in a private directory.
Now, in the share tab are included all shared directories whose parent is not accessible.
Example: