NIHVIVO-2720 Add methods to PolicyHelper to check authorization for adding or dropping Jena statements, or entire Jena models.
This commit is contained in:
parent
601d340f62
commit
1aef7ddcb7
2 changed files with 20 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.rdf.model.Literal;
|
||||||
|
|
||||||
/** Should we allow the user to add this DataPropertyStatement? */
|
/** Should we allow the user to add this DataPropertyStatement? */
|
||||||
public class AddDataPropStmt extends AbstractDataPropertyAction {
|
public class AddDataPropStmt extends AbstractDataPropertyAction {
|
||||||
protected String data;
|
protected String data;
|
||||||
|
@ -15,6 +17,13 @@ public class AddDataPropStmt extends AbstractDataPropertyAction {
|
||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AddDataPropStmt(String subjectUri, String predicateUri, Literal literal) {
|
||||||
|
super(subjectUri, predicateUri);
|
||||||
|
this.data= literal.getValue().toString();
|
||||||
|
this.dataType = literal.getDatatypeURI();
|
||||||
|
this.lang = literal.getLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
public String getData() {
|
public String getData() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.rdf.model.Literal;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatementImpl;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatementImpl;
|
||||||
|
|
||||||
|
@ -23,6 +25,14 @@ public class DropDataPropStmt extends AbstractDataPropertyAction {
|
||||||
dataPropStmt.setData(data);
|
dataPropStmt.setData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DropDataPropStmt(String subjectUri, String predicateUri, Literal data) {
|
||||||
|
super(subjectUri, predicateUri);
|
||||||
|
dataPropStmt = new DataPropertyStatementImpl();
|
||||||
|
dataPropStmt.setIndividualURI(subjectUri);
|
||||||
|
dataPropStmt.setDatapropURI(predicateUri);
|
||||||
|
dataPropStmt.setData(data.getValue().toString());
|
||||||
|
}
|
||||||
|
|
||||||
public String data(){ return dataPropStmt.getData(); }
|
public String data(){ return dataPropStmt.getData(); }
|
||||||
public String lang(){ return dataPropStmt.getLanguage(); }
|
public String lang(){ return dataPropStmt.getLanguage(); }
|
||||||
public String datatype(){return dataPropStmt.getDatatypeURI(); }
|
public String datatype(){return dataPropStmt.getDatatypeURI(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue