From 1247b1e2168aa39e96b3696a4b62087289143761 Mon Sep 17 00:00:00 2001 From: freddyDOTCMS Date: Tue, 11 Feb 2025 12:00:02 -0600 Subject: [PATCH] Fix bug when limited user tries to copy contentlet --- .../portlets/containers/business/ContainerAPIImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dotCMS/src/main/java/com/dotmarketing/portlets/containers/business/ContainerAPIImpl.java b/dotCMS/src/main/java/com/dotmarketing/portlets/containers/business/ContainerAPIImpl.java index a8798a3e8076..9f6a3e056109 100644 --- a/dotCMS/src/main/java/com/dotmarketing/portlets/containers/business/ContainerAPIImpl.java +++ b/dotCMS/src/main/java/com/dotmarketing/portlets/containers/business/ContainerAPIImpl.java @@ -1179,11 +1179,15 @@ private ResolvedPath resolvePath(final String inputPath, hostsToFound.put(currentHost.getInode(), currentHost); } } catch(DotSecurityException e) { - + //ignore: If the user lacks permission for this Host, we skip attempting to resolve the Container with it } - final Host defaultHost = APILocator.getHostAPI().findDefaultHost(user, respectFrontEndEndRoles); - hostsToFound.put(defaultHost.getInode(), defaultHost); + try { + final Host defaultHost = APILocator.getHostAPI().findDefaultHost(user, respectFrontEndEndRoles); + hostsToFound.put(defaultHost.getInode(), defaultHost); + } catch(DotSecurityException e) { + //ignore: If the user lacks permission for this Host, we skip attempting to resolve the Container with it + } return find(relativePath, hostsToFound, user, live, respectFrontEndEndRoles); }