Skip to content

Commit

Permalink
fix: removed duplicate authorization check without statement details …
Browse files Browse the repository at this point in the history
…and graph
  • Loading branch information
litvinovg committed Dec 18, 2023
1 parent 3326dcb commit 89d46b5
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 89d46b5

Please sign in to comment.