From 89d46b53de87bd27beca3a1a759dda53ba9663b0 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Mon, 18 Dec 2023 18:04:20 +0100 Subject: [PATCH] fix: removed duplicate authorization check without statement details and graph --- .../individual/PropertyGroupTemplateModel.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyGroupTemplateModel.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyGroupTemplateModel.java index 44b73d5b70..abeefaf701 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyGroupTemplateModel.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyGroupTemplateModel.java @@ -102,20 +102,11 @@ private boolean allowedToDisplay(VitroRequest vreq, ObjectProperty op, Individua */ private boolean allowedToDisplay(VitroRequest vreq, DataProperty dp, Individual subject) { AccessObject ao; - if (dp instanceof FauxDataPropertyWrapper) { - ao = new FauxDataPropertyAccessObject(dp); - } else { - ao = new DataPropertyAccessObject(dp); - } - if (PolicyHelper.isAuthorizedForActions(vreq, ao, AccessOperation.DISPLAY)) { - return true; - } - //TODO: Model should be here to correctly check authorization if (dp instanceof FauxDataPropertyWrapper) { final FauxProperty fauxProperty = ((FauxDataPropertyWrapper) dp).getFauxProperty(); - ao = new FauxDataPropertyStatementAccessObject(null, subject.getURI(), fauxProperty, SOME_LITERAL); + ao = new FauxDataPropertyStatementAccessObject(vreq.getJenaOntModel(), subject.getURI(), fauxProperty, SOME_LITERAL); } else { - ao = new DataPropertyStatementAccessObject(null, subject.getURI(), dp, SOME_LITERAL); + ao = new DataPropertyStatementAccessObject(vreq.getJenaOntModel(), subject.getURI(), dp, SOME_LITERAL); } return PolicyHelper.isAuthorizedForActions(vreq, ao, AccessOperation.DISPLAY); }