task(content-drive): add permissions tab when editing folders #35160#35327
task(content-drive): add permissions tab when editing folders #35160#35327
Conversation
|
Claude finished @zJaaal's task in 2m 26s —— View job PR Review
Overall the change is clean and follows existing patterns well. A few issues worth addressing: 1. Empty context menu is shown when folder has no permissions (UX/fragility)
this.$items.set(folderMenuItems);
this.$memoizedMenuItems.set({ ...this.$memoizedMenuItems(), [key]: folderMenuItems });
this.contextMenu()?.show(triggeredEvent); // ← called even when folderMenuItems is []
return;When a folder has zero permissions, if (folderMenuItems.length > 0) {
this.contextMenu()?.show(triggeredEvent);
}The corresponding spec test ( 2. JSP has no server-side EDIT_PERMISSIONS check
The JSP retrieves and renders the permissions UI for any authenticated user who can call
if (folder != null && UtilMethods.isSet(folder.getInode())) {
if (!APILocator.getPermissionAPI()
.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
request.setAttribute(com.dotmarketing.util.WebKeys.PERMISSIONABLE_EDIT, folder);
// ...
}3. Stale memoized menu after permission change
The memoized menu is only cleared on Minor:
[currentPageReportTemplate]="`${('Page' | dm)} {currentPage}`"
|
- Derive PermissionType union from PERMISSIONS_TYPE const and narrow DotContentDriveFolder.permissions from string[] to PermissionType[] - Replace .find() with .includes() for permission checks in context menu - Add test for folder with empty permissions yielding zero menu items Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-when-editing-folders
…ng-folders' of https://github.com/dotCMS/core into 35160-task-content-drive-add-permissions-tab-when-editing-folders
Summary
EDIT_PERMISSIONSpermission on the folderDotPermissionsIframeDialogComponentloading/html/portlet/ext/folders/permissions.jspin an iframepermissions.jspto serve the existing permissions portlet in popup mode for folderspermissionsfield inDotContentDriveFolderfromnumber[]tostring[]and addedPERMISSIONS_TYPEconst enumPage {currentPage}) in folder list view paginationTest plan
EDIT_PERMISSIONS— verify Edit Permissions appears in the context menuEDIT_PERMISSIONS— verify the option is absentyarn nx test dot-content-drive🤖 Generated with Claude Code
This PR fixes: #35160