Skip to content

Commit

Permalink
refact: variable renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Oct 30, 2023
1 parent 6622738 commit b0ce72b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ public int compare(HashMap<String, String> h1, HashMap<String, String> h2) {

private Object isEditable(VitroRequest vreq, EditConfigurationVTwo config) {
Individual individual = EditConfigurationUtils.getIndividual(vreq, config.getSubjectUri());
DataPropertyStatementAccessObject adps = new DataPropertyStatementAccessObject(
DataPropertyStatementAccessObject dpsAccessObject = new DataPropertyStatementAccessObject(
vreq.getJenaOntModel(), individual.getURI(),
SOME_URI, SOME_LITERAL);

ObjectPropertyStatementAccessObject aops = new ObjectPropertyStatementAccessObject(
vreq.getJenaOntModel(), individual.getURI(),
SOME_PREDICATE, SOME_URI);
return PolicyHelper.isAuthorizedForActions(vreq, AuthorizationRequest.or(new SimpleAuthorizationRequest(adps, AccessOperation.ADD), new SimpleAuthorizationRequest(aops, AccessOperation.ADD)));
return PolicyHelper.isAuthorizedForActions(vreq, AuthorizationRequest.or(new SimpleAuthorizationRequest(dpsAccessObject, AccessOperation.ADD), new SimpleAuthorizationRequest(aops, AccessOperation.ADD)));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,13 @@ protected ResponseValues processRequest(VitroRequest vreq) {
// Check that we have back end editing priveleges
if (!PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.DO_BACK_END_EDITING.ACTION)) {
// If all else fails, can we add statements to this individual?
DataPropertyStatementAccessObject adps = new DataPropertyStatementAccessObject(vreq.getJenaOntModel(), profileUri, SOME_URI, SOME_LITERAL);
ObjectPropertyStatementAccessObject aops = new ObjectPropertyStatementAccessObject(vreq.getJenaOntModel(), profileUri, SOME_PREDICATE, SOME_URI);
if (!PolicyHelper.isAuthorizedForActions(vreq,
AuthorizationRequest.or(
new SimpleAuthorizationRequest(adps, AccessOperation.ADD),
new SimpleAuthorizationRequest(aops, AccessOperation.ADD)))) {
DataPropertyStatementAccessObject dpsAccessObject = new DataPropertyStatementAccessObject(
vreq.getJenaOntModel(), profileUri, SOME_URI, SOME_LITERAL);
ObjectPropertyStatementAccessObject opsAccessObject = new ObjectPropertyStatementAccessObject(
vreq.getJenaOntModel(), profileUri, SOME_PREDICATE, SOME_URI);
if (!PolicyHelper.isAuthorizedForActions(vreq,
AuthorizationRequest.or(new SimpleAuthorizationRequest(dpsAccessObject, AccessOperation.ADD),
new SimpleAuthorizationRequest(opsAccessObject, AccessOperation.ADD)))) {
return new TemplateResponseValues("unauthorizedForProfile.ftl");
}
}
Expand Down

0 comments on commit b0ce72b

Please sign in to comment.