Skip to content

Conversation

neomorphic
Copy link
Member

@neomorphic neomorphic commented Oct 6, 2025

This pull request will show the breadcrumbs for folders and files that were previously hidden when permissions didn't allow access. The root cause was that the 403 error response in the fetchFileInfo function was throwing away the body.info, which meant it couldn't be used to create a FileOrFolder object in the fetchAndUpdateFileBrowserState function. This updated passes that information into the catch block, so that it can still be used to show the UI. Now that this is working, the properties UI shows the convert tab, and the overview tab has the create data link switch. Both of those components should probably be hidden in this case. To do that, we either need to use a blunt approach and just hide them when the api responds with a 403 or we need to use the body.info information and compare that to the currently logged in user.

@krokicki @allison-truhlar

@neomorphic neomorphic marked this pull request as ready for review October 6, 2025 19:32
@neomorphic
Copy link
Member Author

Please check this out and see if the UI makes sense to you when you view a closed directory

@allison-truhlar
Copy link
Contributor

I understand better what you were asking about now - I think it makes sense to use the blunt approach to hide those components for now. The cases that will be missed, I think, are where the user has read access but not write access at any level, and these will still be handled by toast errors when they try to use the "submit" buttons for any of those components.

@neomorphic
Copy link
Member Author

The cases that will be missed, I think, are where the user has read access but not write access at any level, and these will still be handled by toast errors when they try to use the "submit" buttons for any of those components.

Correct, and we could check the file permissions when we load the FileOrFolder object and use the hasWrite/hasRead, but we would need to know the logged in users group at that point.

@neomorphic
Copy link
Member Author

It would probably make the most sense to return hasRead and hasWrite properties from the API end point. Deciding if the user can change a file is much easier to do in the python API code.

... when write access is lacking.

Adds a hasRead and hasWrite attribute to the FileOrFolder object that is
returned from the /api/fileglancer/files endpoint. This is then used to
decide when to disable the buttons in the PropertiesDrawer component.
@neomorphic neomorphic merged commit 0f16ed0 into main Oct 8, 2025
5 checks passed
@neomorphic neomorphic deleted the disappearing_breadcrumbs branch October 8, 2025 17:06
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