Skip to content

Commit

Permalink
IVYPORTAL-18054 Iframe task template: Missing permission check for Ca…
Browse files Browse the repository at this point in the history
…se information (#1291)

* feature/IVYPORTAL-18054-Iframe-task-template-Missing-permission-check-for-Case-information-LE - Fix case not found

* feature/IVYPORTAL-18054-Iframe-task-template-Missing-permission-check-for-Case-information-LE - Fix case not have permission

* feature/IVYPORTAL-18054-Iframe-task-template-Missing-permission-check-for-Case-information-LE
  • Loading branch information
ntloc-axonivy authored Dec 9, 2024
1 parent cbc6961 commit bdb4b3d
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ch.ivy.addon.portal.generic:
CaseDetailsTemplate:
noCaseId: No case-Id specified
noCaseFound: Case not found or you don't have permission to view this case.
requestTabTitle: Request
statusTabTitle: Case Information
OpenTaskTemplate:
Expand Down
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_de.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ch.ivy.addon.portal.generic:
CaseDetailsTemplate:
noCaseId: Keine Vorgangs-ID spezifiziert
noCaseFound: Vorgang nicht gefunden oder Sie haben keine Berechtigung, diesen Vorgang zu sehen.
requestTabTitle: Anfrage
statusTabTitle: Vorgangsinformationen
OpenTaskTemplate:
Expand Down
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_en.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ch.ivy.addon.portal.generic:
CaseDetailsTemplate:
noCaseId: No case-Id specified
noCaseFound: Case not found or you don't have permission to view this case.
requestTabTitle: Request
statusTabTitle: Case Information
OpenTaskTemplate:
Expand Down
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_es.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ch.ivy.addon.portal.generic:
CaseDetailsTemplate:
noCaseId: No hay ID de caso especificado
noCaseFound: Caso no encontrado o no tienes permiso para ver este caso.
requestTabTitle: Solicitud
statusTabTitle: Información del caso
OpenTaskTemplate:
Expand Down
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_fr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ch.ivy.addon.portal.generic:
CaseDetailsTemplate:
noCaseId: Aucun numéro de dossier n'a été indiqué
noCaseFound: Cas non trouvé ou vous n'avez pas la permission de voir ce cas.
requestTabTitle: Demande
statusTabTitle: Informations sur le dossier
OpenTaskTemplate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private int getFirstTerminatingStageIndex(List<IStage> stages) {
}

public void generateCaseDetailInFrame(ICase currentCase) {
setCaseDetailsLink(PortalNavigator.buildPortalCaseDetailInFrameUrl(currentCase.uuid()));
setCaseDetailsLink(PortalNavigator.buildPortalCaseDetailInFrameUrl(currentCase != null ? currentCase.uuid() : ""));
}

public Long getIntervalForPollingWhenOpenCaseDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@
</h:panelGroup>
</f:facet>
<ui:insert name="caseDetails">
<h:outputText value="#{ivy.cms.co('/ch.ivy.addon.portal.generic/CaseDetailsTemplate/noCaseId')}"
rendered="#{caseWidgetBean.isHiddenCase(case)}" />
<h:panelGroup id="case-details-panel" layout="block" rendered="#{!caseWidgetBean.isHiddenCase(case)}"
<h:outputText value="#{ivy.cms.co('/ch.ivy.addon.portal.generic/CaseDetailsTemplate/noCaseFound')}"
rendered="#{caseWidgetBean.isHiddenCase(case) or !caseWidgetBean.isCaseFound(case)}" styleClass="no-case-found" />
<h:panelGroup id="case-details-panel" layout="block" rendered="#{!caseWidgetBean.isHiddenCase(case) and caseWidgetBean.isCaseFound(case)}"
styleClass="case-default-widget-container case-details case-details-panel">
<div class="ui-g js-iframe-container">
<div class="ui-g-12 u-padding-0">
<iframe id="i-frame-case-details" src="#{taskTemplateBean.caseDetailsLink}"
onload="setupHeightForIFrame();" class="case-information-frame js-iFrame-case-details"
onload="setupHeightForIFrame();" class="case-information-frame js-iFrame-case-details"
scrolling="no" frameborder="0"
title="#{ivy.cms.co('/Dialogs/com/axonivy/portal/layouts/AbstractTaskTemplate/CaseDetailsIFrameTitle')}" />
</div>
Expand Down
5 changes: 5 additions & 0 deletions AxonIvyPortal/portal/webContent/resources/css/module.css
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,11 @@ span.case-details-document-add-link, span.task-details-document-add-link {
align-self: center;
}

.no-case-found {
margin-left: 21px;
font-size: var(--large-font-size);
}

.case-detail-section-title-container {
display: flex;
}
Expand Down

0 comments on commit bdb4b3d

Please sign in to comment.