-
Notifications
You must be signed in to change notification settings - Fork 23
[feature] Add shared directories in the shared tab #1491
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
BryonLewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍


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: