From d6f3f63efc5c22ac344a51f9cf53beb128f35c52 Mon Sep 17 00:00:00 2001 From: Loc Nguyen Date: Thu, 5 Dec 2024 14:38:53 +0700 Subject: [PATCH] feature/IVYPORTAL-18054-Iframe-task-template-Missing-permission-check-for-Case-information-LE - Fix case not have permission --- AxonIvyPortal/portal/cms/cms_de.yaml | 2 +- .../portal/generic/bean/AbstractTaskTemplateBean.java | 2 +- .../ch/ivy/addon/portalkit/bean/CaseWidgetBean.java | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/AxonIvyPortal/portal/cms/cms_de.yaml b/AxonIvyPortal/portal/cms/cms_de.yaml index 0267078871e..dd66e122eea 100644 --- a/AxonIvyPortal/portal/cms/cms_de.yaml +++ b/AxonIvyPortal/portal/cms/cms_de.yaml @@ -1,6 +1,6 @@ ch.ivy.addon.portal.generic: CaseDetailsTemplate: - noCaseFound: Fall nicht gefunden oder Sie haben keine Berechtigung, diesen Fall zu sehen. + noCaseFound: Vorgang nicht gefunden oder Sie haben keine Berechtigung, diesen Vorgang zu sehen. requestTabTitle: Anfrage statusTabTitle: Vorgangsinformationen OpenTaskTemplate: diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/AbstractTaskTemplateBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/AbstractTaskTemplateBean.java index d02d42b2414..a5a43fcce15 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/AbstractTaskTemplateBean.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/AbstractTaskTemplateBean.java @@ -159,7 +159,7 @@ private int getFirstTerminatingStageIndex(List stages) { } public void generateCaseDetailInFrame(ICase currentCase) { - setCaseDetailsLink(PortalNavigator.buildPortalCaseDetailInFrameUrl(currentCase != null ? currentCase.uuid() : null)); + setCaseDetailsLink(PortalNavigator.buildPortalCaseDetailInFrameUrl(currentCase != null ? currentCase.uuid() : "")); } public Long getIntervalForPollingWhenOpenCaseDetails() { diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/CaseWidgetBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/CaseWidgetBean.java index 0c303aff69d..b8338487372 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/CaseWidgetBean.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/CaseWidgetBean.java @@ -11,6 +11,7 @@ import javax.faces.bean.ViewScoped; import org.apache.commons.collections4.CollectionUtils; + import com.axonivy.portal.enums.SearchScopeCaseField; import com.axonivy.portal.service.GlobalSearchService; @@ -25,6 +26,7 @@ import ch.ivy.addon.portalkit.enums.SessionAttribute; import ch.ivy.addon.portalkit.enums.TaskSortField; import ch.ivy.addon.portalkit.exporter.Exporter; +import ch.ivy.addon.portalkit.ivydata.service.impl.CaseService; import ch.ivy.addon.portalkit.service.CaseFilterService; import ch.ivy.addon.portalkit.support.HtmlParser; import ch.ivy.addon.portalkit.util.CaseUtils; @@ -221,8 +223,15 @@ public String getGlobalSearchText(CaseLazyDataModel model) { } return result; } - + public boolean isShowGlobalSearchScope() { return GlobalSearchService.getInstance().isShowGlobalSearchByCases(); } + + public boolean isCaseFound(ICase caze) { + if (caze != null) { + return CaseService.newInstance().isCaseAccessible(caze.uuid()); + } + return false; + } }