Document Recycle Bin: Checks user permission for Document "Read" - #23041
Conversation
that the user must have "Read" permission.
this will remove an extra fetch request.
|
Claude finished @leekelleher's task in 4m 53s —— View job PR ReviewTarget: Adds a
Suggestions
Approved with Suggestions for improvementGood to go, but please carefully consider the importance of the suggestions.
|
There was a problem hiding this comment.
Pull request overview
This PR tightens backoffice UI access to the Document Recycle Bin in v17 by ensuring users without Document “Read” permission can’t see the recycle bin entry points (tree menu item and root collection workspace view). It also aligns the Media recycle bin “allow” condition manifest with the Document equivalent by inlining the condition class to avoid an extra dynamic import request at startup.
Changes:
- Add a document user-permission condition (
Umb.Document.Read) to the Document Recycle Bin menu item manifest so it’s hidden when the user lacks read permission. - Add the same permission condition to the Document Recycle Bin root collection workspace view manifest to prevent viewing the recycle bin collection via direct navigation.
- Inline the Media recycle bin current-user allow-condition class in its manifest (replacing the lazy import) to reduce initial fetches.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Umbraco.Web.UI.Client/src/packages/media/media/recycle-bin/manifests.ts |
Switches the Media recycle bin allow-condition manifest from dynamic import to a statically imported condition class. |
src/Umbraco.Web.UI.Client/src/packages/documents/documents/recycle-bin/root/workspace/manifests.ts |
Adds a Umb.Document.Read user-permission condition to the recycle bin root collection workspace view. |
src/Umbraco.Web.UI.Client/src/packages/documents/documents/recycle-bin/menu/manifests.ts |
Adds a Umb.Document.Read user-permission condition to the recycle bin menu item to hide it when read is denied. |
Description
ref: #22274 (comment)
Discovered during the development of Elements (for v18.0), if a user does not have Document "Read" permission, they can still view items in the Recycle Bin. To note, they can not access the trashed document directly, only the see the tree/collection.
This PR adds conditions to manifests of the Document Recycle Bin menu and root workspace to check the user's "Read" permission. We do not have the equivalent user permissions for Media, so it does not have the same condition.
There is an extra change in this PR, I have in-lined constructor for the "Allow Media Recycle Bin Current User Condition" manifest, as this will reduce the extra fetch request on initial app start up. This mirrors how the equivalent Document condition is loaded.
How to test?