Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Louis-Pagnier-KW
Copy link
Collaborator

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:

User1
├── Private
│   ├── sharedWithUser2                            (accessible directly)
│   │   └── sharedWithUser2SubDirectory            (accessible through parent)
│   └── stillPrivate                               (not shown)
│          └── alsoSharedWithUser2                 (accessible directly)
├── Public                                         (not visible, because public and not specifically shared)
└── PrivateButSharedWithUser2                      (accessible directly)

@Louis-Pagnier-KW Louis-Pagnier-KW changed the title Add shared directories in the shared tab [feature] Add shared directories in the shared tab May 14, 2025
@Louis-Pagnier-KW Louis-Pagnier-KW marked this pull request as draft May 14, 2025 16:16
@Louis-Pagnier-KW
Copy link
Collaborator Author

image
Shared directories are directly shown in a Girder Browser instead of a v-table.

The other possible implementation was to keep a table here, and on click route the user to "Browse Data" tab, but i had some problems with the integrated breadcrumb that can't query the current folder path and cause bugs.

@Louis-Pagnier-KW
Copy link
Collaborator Author

I finally changed the implementation to keep only one browser as before, and the share tab only redirect to the "browse data" tab.
image

The main problem on the "Browse Data" tab was to have the bread crumb working with path whose parent is not accessible.
In the GirderFileManager component, there was no slot for a custom breadcrumb, as opposed to the DataBrowser component used by it.

So I had to copy the GirderFileManager implementation and update the bread crumb with a custom one that use a new endpoint which returns the path until hitting a non-readable folder, instead of returning 403.

@Louis-Pagnier-KW Louis-Pagnier-KW self-assigned this May 16, 2025
@Louis-Pagnier-KW Louis-Pagnier-KW marked this pull request as ready for review May 16, 2025 09:45
Copy link
Collaborator

@BryonLewis BryonLewis left a 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.

):
query = {
'$and': [
Folder().permissionClauses(user=user, level=AccessType.READ),
Copy link
Collaborator

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.

https://github.com/girder/girder/blob/614a8ebdcfe153accf3615e245ddb763208bc871/girder/models/model_base.py#L47-L50

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.

Copy link
Collaborator Author

@Louis-Pagnier-KW Louis-Pagnier-KW May 19, 2025

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.

Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Louis-Pagnier-KW Louis-Pagnier-KW merged commit 3db45f0 into main May 19, 2025
4 checks passed
@Louis-Pagnier-KW Louis-Pagnier-KW deleted the shared-folders branch May 19, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants