Skip to content

Commit

Permalink
Merge branch 'main' into feature/forgot-password-feature-toggle-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmrsulja committed Jan 22, 2024
2 parents d86011e + 75a1df0 commit bb40a1b
Show file tree
Hide file tree
Showing 118 changed files with 11,499 additions and 1,359 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Clone Vitro
run: git clone https://github.com/vivo-project/Vitro.git ../Vitro

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021, Cornell University
Copyright (c) 2024, Lyrasis
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -9,7 +9,7 @@ modification, are permitted provided that the following conditions are met:
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Cornell University nor the names of its contributors
* Neither the name of Lyrasis nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* $This file is distributed under the terms of the license in LICENSE$ */
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;

import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_LITERAL;
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_PREDICATE;
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_URI;
import static edu.cornell.mannlib.vitro.webapp.auth.objects.AccessObject.SOME_LITERAL;
import static edu.cornell.mannlib.vitro.webapp.auth.objects.AccessObject.SOME_PREDICATE;
import static edu.cornell.mannlib.vitro.webapp.auth.objects.AccessObject.SOME_URI;

import java.io.FileNotFoundException;
import java.util.ArrayList;
Expand All @@ -27,9 +27,12 @@
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Literal;

import edu.cornell.mannlib.vitro.webapp.auth.attributes.AccessOperation;
import edu.cornell.mannlib.vitro.webapp.auth.objects.DataPropertyStatementAccessObject;
import edu.cornell.mannlib.vitro.webapp.auth.objects.ObjectPropertyStatementAccessObject;
import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.SimpleAuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.Property;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
Expand Down Expand Up @@ -331,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());
AddDataPropertyStatement adps = new AddDataPropertyStatement(
DataPropertyStatementAccessObject dpsAccessObject = new DataPropertyStatementAccessObject(
vreq.getJenaOntModel(), individual.getURI(),
SOME_URI, SOME_LITERAL);

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


Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit bb40a1b

Please sign in to comment.