boolean copySourceContainers, User user, boolean respectFrontendRoles) throws DotDataException,
DotSecurityException {
if (!permissionAPI.doesUserHavePermission(sourceTemplate, PermissionAPI.PERMISSION_READ, user,
respectFrontendRoles)) {
throw new DotSecurityException("You don't have permission to read the source file.");
}
if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_WRITE, user,
respectFrontendRoles)) {
throw new DotSecurityException("You don't have permission to write in the destination folder.");
}
List<ContainerRemapTuple> remap = new LinkedList<ContainerRemapTuple>();
if (copySourceContainers) {
List<Container> sourceContainers = getContainersInTemplate(sourceTemplate, user, respectFrontendRoles);