Merge branch 'maint-rel-1.6' into develop
This commit is contained in:
commit
09dd8da784
19 changed files with 276 additions and 229 deletions
|
@ -15,7 +15,6 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObje
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean.RoleLevel;
|
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean.RoleLevel;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,11 +110,9 @@ public class DisplayByRolePermission extends Permission {
|
||||||
* subject, its predicate, and its object.
|
* subject, its predicate, and its object.
|
||||||
*/
|
*/
|
||||||
private boolean isAuthorized(DisplayObjectPropertyStatement action) {
|
private boolean isAuthorized(DisplayObjectPropertyStatement action) {
|
||||||
ObjectPropertyStatement stmt = action.getObjectPropertyStatement();
|
String subjectUri = action.getSubjectUri();
|
||||||
String subjectUri = stmt.getSubjectURI();
|
String objectUri = action.getObjectUri();
|
||||||
String objectUri = stmt.getObjectURI();
|
Property op = action.getProperty();
|
||||||
Property op = (stmt.getProperty() != null)
|
|
||||||
? stmt.getProperty() : new Property(stmt.getPropertyURI());
|
|
||||||
return canDisplayResource(subjectUri)
|
return canDisplayResource(subjectUri)
|
||||||
&& canDisplayPredicate(op)
|
&& canDisplayPredicate(op)
|
||||||
&& canDisplayResource(objectUri);
|
&& canDisplayResource(objectUri);
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class DisplayRestrictedDataToSelfPolicy implements PolicyIface {
|
||||||
String subjectUri = stmt.getIndividualURI();
|
String subjectUri = stmt.getIndividualURI();
|
||||||
Property predicate = new Property(stmt.getDatapropURI());
|
Property predicate = new Property(stmt.getDatapropURI());
|
||||||
if (canDisplayResource(subjectUri) && canDisplayPredicate(predicate)
|
if (canDisplayResource(subjectUri) && canDisplayPredicate(predicate)
|
||||||
&& isAboutAssociatedIndividual(individuals, stmt)) {
|
&& isAboutAssociatedIndividual(individuals, subjectUri)) {
|
||||||
return authorized("user may view DataPropertyStatement "
|
return authorized("user may view DataPropertyStatement "
|
||||||
+ subjectUri + " ==> " + predicate.getURI());
|
+ subjectUri + " ==> " + predicate.getURI());
|
||||||
} else {
|
} else {
|
||||||
|
@ -112,19 +112,17 @@ public class DisplayRestrictedDataToSelfPolicy implements PolicyIface {
|
||||||
*/
|
*/
|
||||||
private PolicyDecision isAuthorized(DisplayObjectPropertyStatement action,
|
private PolicyDecision isAuthorized(DisplayObjectPropertyStatement action,
|
||||||
Collection<String> individuals) {
|
Collection<String> individuals) {
|
||||||
ObjectPropertyStatement stmt = action.getObjectPropertyStatement();
|
String subjectUri = action.getSubjectUri();
|
||||||
String subjectUri = stmt.getSubjectURI();
|
Property predicate = action.getProperty();
|
||||||
String predicateUri = stmt.getPropertyURI();
|
String objectUri = action.getObjectUri();
|
||||||
String objectUri = stmt.getObjectURI();
|
if (canDisplayResource(subjectUri) && canDisplayPredicate(predicate)
|
||||||
if (canDisplayResource(subjectUri) && canDisplayPredicate(new Property
|
|
||||||
(predicateUri))
|
|
||||||
&& canDisplayResource(objectUri)
|
&& canDisplayResource(objectUri)
|
||||||
&& isAboutAssociatedIndividual(individuals, stmt)) {
|
&& isAboutAssociatedIndividual(individuals, subjectUri, objectUri)) {
|
||||||
return authorized("user may view ObjectPropertyStatement "
|
return authorized("user may view ObjectPropertyStatement "
|
||||||
+ subjectUri + " ==> " + predicateUri + " ==> " + objectUri);
|
+ subjectUri + " ==> " + predicate.getURI() + " ==> " + objectUri);
|
||||||
} else {
|
} else {
|
||||||
return defaultDecision("user may not view ObjectPropertyStatement "
|
return defaultDecision("user may not view ObjectPropertyStatement "
|
||||||
+ subjectUri + " ==> " + predicateUri + " ==> " + objectUri);
|
+ subjectUri + " ==> " + predicate.getURI() + " ==> " + objectUri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,9 +149,9 @@ public class DisplayRestrictedDataToSelfPolicy implements PolicyIface {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAboutAssociatedIndividual(Collection<String> selves,
|
private boolean isAboutAssociatedIndividual(Collection<String> selves,
|
||||||
DataPropertyStatement stmt) {
|
String subjectUri) {
|
||||||
for (String self : selves) {
|
for (String self : selves) {
|
||||||
if (self.equals(stmt.getIndividualURI())) {
|
if (self.equals(subjectUri)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,10 +159,9 @@ public class DisplayRestrictedDataToSelfPolicy implements PolicyIface {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAboutAssociatedIndividual(Collection<String> selves,
|
private boolean isAboutAssociatedIndividual(Collection<String> selves,
|
||||||
ObjectPropertyStatement stmt) {
|
String subjectUri, String objectUri) {
|
||||||
for (String self : selves) {
|
for (String self : selves) {
|
||||||
if (self.equals(stmt.getSubjectURI())
|
if (self.equals(subjectUri) || self.equals(objectUri)) {
|
||||||
|| self.equals(stmt.getObjectURI())) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.auth.policy;
|
package edu.cornell.mannlib.vitro.webapp.auth.policy;
|
||||||
|
|
||||||
|
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants.SOME_URI;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -26,6 +28,7 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPro
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropDataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropDataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObjectPropertyStatement;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.UserAccount;
|
import edu.cornell.mannlib.vitro.webapp.beans.UserAccount;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.authenticate.Authenticator;
|
import edu.cornell.mannlib.vitro.webapp.controller.authenticate.Authenticator;
|
||||||
|
|
||||||
|
@ -125,8 +128,7 @@ public class PolicyHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource subject = stmt.getSubject();
|
Resource subject = stmt.getSubject();
|
||||||
edu.cornell.mannlib.vitro.webapp.beans.Property predicate = new edu.cornell.mannlib.vitro.webapp.beans.Property(
|
com.hp.hpl.jena.rdf.model.Property predicate = stmt.getPredicate();
|
||||||
stmt.getPredicate().getURI());
|
|
||||||
RDFNode objectNode = stmt.getObject();
|
RDFNode objectNode = stmt.getObject();
|
||||||
if ((subject == null) || (predicate == null) || (objectNode == null)) {
|
if ((subject == null) || (predicate == null) || (objectNode == null)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -134,8 +136,11 @@ public class PolicyHelper {
|
||||||
|
|
||||||
RequestedAction action;
|
RequestedAction action;
|
||||||
if (objectNode.isResource()) {
|
if (objectNode.isResource()) {
|
||||||
|
Property property = new Property(predicate.getURI());
|
||||||
|
property.setDomainVClassURI(SOME_URI);
|
||||||
|
property.setRangeVClassURI(SOME_URI);
|
||||||
action = new AddObjectPropertyStatement(modelToBeModified,
|
action = new AddObjectPropertyStatement(modelToBeModified,
|
||||||
subject.getURI(), predicate, objectNode.asResource()
|
subject.getURI(), property, objectNode.asResource()
|
||||||
.getURI());
|
.getURI());
|
||||||
} else {
|
} else {
|
||||||
action = new AddDataPropertyStatement(modelToBeModified,
|
action = new AddDataPropertyStatement(modelToBeModified,
|
||||||
|
@ -158,8 +163,7 @@ public class PolicyHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource subject = stmt.getSubject();
|
Resource subject = stmt.getSubject();
|
||||||
edu.cornell.mannlib.vitro.webapp.beans.Property predicate = new edu.cornell.mannlib.vitro.webapp.beans.Property();
|
com.hp.hpl.jena.rdf.model.Property predicate = stmt.getPredicate();
|
||||||
predicate.setURI(stmt.getPredicate().getURI());
|
|
||||||
RDFNode objectNode = stmt.getObject();
|
RDFNode objectNode = stmt.getObject();
|
||||||
if ((subject == null) || (predicate == null) || (objectNode == null)) {
|
if ((subject == null) || (predicate == null) || (objectNode == null)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -167,8 +171,11 @@ public class PolicyHelper {
|
||||||
|
|
||||||
RequestedAction action;
|
RequestedAction action;
|
||||||
if (objectNode.isResource()) {
|
if (objectNode.isResource()) {
|
||||||
|
Property property = new Property(predicate.getURI());
|
||||||
|
property.setDomainVClassURI(SOME_URI);
|
||||||
|
property.setRangeVClassURI(SOME_URI);
|
||||||
action = new DropObjectPropertyStatement(modelToBeModified,
|
action = new DropObjectPropertyStatement(modelToBeModified,
|
||||||
subject.getURI(), predicate, objectNode.asResource()
|
subject.getURI(), property, objectNode.asResource()
|
||||||
.getURI());
|
.getURI());
|
||||||
} else {
|
} else {
|
||||||
action = new DropDataPropertyStatement(modelToBeModified,
|
action = new DropDataPropertyStatement(modelToBeModified,
|
||||||
|
|
|
@ -209,7 +209,9 @@ public class PropertyRestrictionPolicyHelper {
|
||||||
role = faux.getHiddenFromPublishBelowRoleLevel();
|
role = faux.getHiddenFromPublishBelowRoleLevel();
|
||||||
}
|
}
|
||||||
if (role != null) {
|
if (role != null) {
|
||||||
log.debug("Putting D:" + faux.getDomainVClassURI() + " P:" + faux.getURI() + " R:" + faux.getRangeVClassURI() + " ==> L:" + role);
|
log.debug("Putting D:" + faux.getDomainVClassURI() + " P:"
|
||||||
|
+ faux.getURI() + " R:" + faux.getRangeVClassURI()
|
||||||
|
+ " ==> L:" + role);
|
||||||
map.put(new Pair<String,Pair<String,String>>(
|
map.put(new Pair<String,Pair<String,String>>(
|
||||||
faux.getDomainVClassURI(), new Pair<String,String>(
|
faux.getDomainVClassURI(), new Pair<String,String>(
|
||||||
faux.getURI(), faux.getRangeVClassURI())), role);
|
faux.getURI(), faux.getRangeVClassURI())), role);
|
||||||
|
|
|
@ -3,27 +3,37 @@
|
||||||
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display;
|
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||||
|
|
||||||
/** Should we let the user see this ObjectPropertyStatement? */
|
/** Should we let the user see this ObjectPropertyStatement? */
|
||||||
public class DisplayObjectPropertyStatement extends RequestedAction {
|
public class DisplayObjectPropertyStatement extends RequestedAction {
|
||||||
private final ObjectPropertyStatement objectPropertyStatement;
|
private final String subjectUri;
|
||||||
|
private final ObjectProperty property;
|
||||||
|
private final String objectUri;
|
||||||
|
|
||||||
public DisplayObjectPropertyStatement(
|
public DisplayObjectPropertyStatement(String subjectUri,
|
||||||
ObjectPropertyStatement objectPropertyStatement) {
|
ObjectProperty property, String objectUri) {
|
||||||
this.objectPropertyStatement = objectPropertyStatement;
|
this.subjectUri = subjectUri;
|
||||||
|
this.property = property;
|
||||||
|
this.objectUri = objectUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectPropertyStatement getObjectPropertyStatement() {
|
public String getSubjectUri() {
|
||||||
return objectPropertyStatement;
|
return subjectUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObjectProperty getProperty() {
|
||||||
|
return property;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getObjectUri() {
|
||||||
|
return objectUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DisplayObjectPropertyStatement["
|
return "DisplayObjectPropertyStatement[" + subjectUri + "==>"
|
||||||
+ objectPropertyStatement.getSubjectURI() + "==>"
|
+ property.getURI() + "==>" + objectUri + "]";
|
||||||
+ objectPropertyStatement.getPropertyURI() + "==>"
|
|
||||||
+ objectPropertyStatement.getObjectURI() + "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,6 @@ package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,23 +24,6 @@ public abstract class AbstractObjectPropertyStatementAction extends
|
||||||
this.objectUri = objectUri;
|
this.objectUri = objectUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractObjectPropertyStatementAction(OntModel ontModel,
|
|
||||||
ObjectPropertyStatement ops) {
|
|
||||||
super(ontModel);
|
|
||||||
this.subjectUri = (ops.getSubject() == null) ? ops.getSubjectURI()
|
|
||||||
: ops.getSubject().getURI();
|
|
||||||
this.predicate = (ops.getProperty() == null) ? createProperty(ops
|
|
||||||
.getPropertyURI()) : ops.getProperty();
|
|
||||||
this.objectUri = (ops.getObject() == null) ? ops.getObjectURI() : ops
|
|
||||||
.getObject().getURI();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ObjectProperty createProperty(String propertyURI) {
|
|
||||||
ObjectProperty op = new ObjectProperty();
|
|
||||||
op.setURI(propertyURI);
|
|
||||||
return op;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSubjectUri() {
|
public String getSubjectUri() {
|
||||||
return subjectUri;
|
return subjectUri;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,8 +16,4 @@ public class AddObjectPropertyStatement extends
|
||||||
super(ontModel, uriOfSub, predicate, uriOfObj);
|
super(ontModel, uriOfSub, predicate, uriOfObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddObjectPropertyStatement(OntModel ontModel,
|
|
||||||
ObjectPropertyStatement ops) {
|
|
||||||
super(ontModel, ops);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,9 +16,4 @@ public class DropObjectPropertyStatement extends
|
||||||
Property pred, String obj) {
|
Property pred, String obj) {
|
||||||
super(ontModel, sub, pred, obj);
|
super(ontModel, sub, pred, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DropObjectPropertyStatement(OntModel ontModel,
|
|
||||||
ObjectPropertyStatement ops) {
|
|
||||||
super(ontModel, ops);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,9 +15,4 @@ public class EditObjectPropertyStatement extends
|
||||||
Property keywordPred, String objectUri) {
|
Property keywordPred, String objectUri) {
|
||||||
super(ontModel, subjectUri, keywordPred, objectUri);
|
super(ontModel, subjectUri, keywordPred, objectUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditObjectPropertyStatement(OntModel ontModel,
|
|
||||||
ObjectPropertyStatement ops) {
|
|
||||||
super(ontModel, ops);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.publish;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
|
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AbstractObjectPropertyStatementAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AbstractObjectPropertyStatementAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,9 +20,20 @@ public class PublishObjectPropertyStatement extends
|
||||||
super(ontModel, subjectUri, keywordPred, objectUri);
|
super(ontModel, subjectUri, keywordPred, objectUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We don't need to know range and domain because publishing never involves
|
||||||
|
* faux properties.
|
||||||
|
*/
|
||||||
public PublishObjectPropertyStatement(OntModel ontModel,
|
public PublishObjectPropertyStatement(OntModel ontModel,
|
||||||
ObjectPropertyStatement ops) {
|
String subjectUri,
|
||||||
super(ontModel, ops);
|
String predicateUri, String objectUri) {
|
||||||
|
this(ontModel, subjectUri, populateProperty(predicateUri), objectUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Property populateProperty(String predicateUri) {
|
||||||
|
Property prop = new Property(predicateUri);
|
||||||
|
prop.setDomainVClassURI(RequestActionConstants.SOME_URI);
|
||||||
|
prop.setRangeVClassURI(RequestActionConstants.SOME_URI);
|
||||||
|
return prop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,6 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.publish.PublishData
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.publish.PublishObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.publish.PublishObjectPropertyStatement;
|
||||||
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;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RdfResponseValues;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RdfResponseValues;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
||||||
|
@ -171,10 +169,11 @@ public class IndividualRdfAssembler {
|
||||||
+ "WHERE { <%1$s> ?predicate ?object ."
|
+ "WHERE { <%1$s> ?predicate ?object ."
|
||||||
+ " ?object <%2$s> ?label . } ", individualUri,
|
+ " ?object <%2$s> ?label . } ", individualUri,
|
||||||
RDFS.label)));
|
RDFS.label)));
|
||||||
m.add(runConstructQuery(String
|
m.add(runConstructQuery(String.format(
|
||||||
.format("CONSTRUCT { ?subject <%2$s> ?type . } "
|
"CONSTRUCT { ?subject <%2$s> ?type . } "
|
||||||
+ "WHERE { ?subject ?predicate <%1$s> ."
|
+ "WHERE { ?subject ?predicate <%1$s> ."
|
||||||
+ " ?subject <%2$s> ?type . } ", individualUri, RDF.type)));
|
+ " ?subject <%2$s> ?type . } ", individualUri,
|
||||||
|
RDF.type)));
|
||||||
m.add(runConstructQuery(String.format(
|
m.add(runConstructQuery(String.format(
|
||||||
"CONSTRUCT { ?subject <%2$s> ?label . } "
|
"CONSTRUCT { ?subject <%2$s> ?label . } "
|
||||||
+ "WHERE { ?subject ?predicate <%1$s> ."
|
+ "WHERE { ?subject ?predicate <%1$s> ."
|
||||||
|
@ -213,9 +212,8 @@ public class IndividualRdfAssembler {
|
||||||
}
|
}
|
||||||
} else if (stmt.getObject().isURIResource()) {
|
} else if (stmt.getObject().isURIResource()) {
|
||||||
String objectUri = stmt.getObject().asResource().getURI();
|
String objectUri = stmt.getObject().asResource().getURI();
|
||||||
ObjectPropertyStatement ops = new ObjectPropertyStatementImpl(
|
RequestedAction pops = new PublishObjectPropertyStatement(o,
|
||||||
subjectUri, predicateUri, objectUri);
|
subjectUri, predicateUri, objectUri);
|
||||||
RequestedAction pops = new PublishObjectPropertyStatement(o, ops);
|
|
||||||
if (!PolicyHelper.isAuthorizedForActions(vreq, pops)) {
|
if (!PolicyHelper.isAuthorizedForActions(vreq, pops)) {
|
||||||
log.debug("not authorized: " + pops);
|
log.debug("not authorized: " + pops);
|
||||||
stmts.remove();
|
stmts.remove();
|
||||||
|
|
|
@ -20,11 +20,13 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayData
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayDataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayDataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectProperty;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectPropertyStatement;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the properties depending on what DisplayByRolePermission is on the
|
* Filter the properties depending on what DisplayByRolePermission is on the
|
||||||
|
@ -117,7 +119,30 @@ public class FilterByRoleLevelPermission extends VitroFiltersImpl {
|
||||||
UnaryFunctor<ObjectPropertyStatement, Boolean> {
|
UnaryFunctor<ObjectPropertyStatement, Boolean> {
|
||||||
@Override
|
@Override
|
||||||
public Boolean fn(ObjectPropertyStatement ops) {
|
public Boolean fn(ObjectPropertyStatement ops) {
|
||||||
return checkAuthorization(new DisplayObjectPropertyStatement(ops));
|
String subjectUri = ops.getSubjectURI();
|
||||||
|
ObjectProperty predicate = getOrCreateProperty(ops);
|
||||||
|
String objectUri = ops.getObjectURI();
|
||||||
|
return checkAuthorization(new DisplayObjectPropertyStatement(
|
||||||
|
subjectUri, predicate, objectUri));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It would be nice if every ObjectPropertyStatement held a real
|
||||||
|
* ObjectProperty. If it doesn't, we do the next best thing, but it
|
||||||
|
* won't recognize any applicaable Faux properties.
|
||||||
|
*/
|
||||||
|
private ObjectProperty getOrCreateProperty(ObjectPropertyStatement ops) {
|
||||||
|
if (ops.getProperty() != null) {
|
||||||
|
return ops.getProperty();
|
||||||
|
}
|
||||||
|
if (ops.getPropertyURI() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ObjectProperty op = new ObjectProperty();
|
||||||
|
op.setURI(ops.getPropertyURI());
|
||||||
|
op.setDomainVClassURI(RequestActionConstants.SOME_URI);
|
||||||
|
op.setRangeVClassURI(RequestActionConstants.SOME_URI);
|
||||||
|
return op;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayData
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayDataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayDataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectProperty;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectPropertyStatement;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
|
@ -88,7 +89,31 @@ public class HideFromDisplayByPolicyFilter extends VitroFiltersImpl {
|
||||||
UnaryFunctor<ObjectPropertyStatement, Boolean> {
|
UnaryFunctor<ObjectPropertyStatement, Boolean> {
|
||||||
@Override
|
@Override
|
||||||
public Boolean fn(ObjectPropertyStatement ops) {
|
public Boolean fn(ObjectPropertyStatement ops) {
|
||||||
return checkAuthorization(new DisplayObjectPropertyStatement(ops));
|
String subjectUri = ops.getSubjectURI();
|
||||||
}
|
ObjectProperty predicate = getOrCreateProperty(ops);
|
||||||
|
String objectUri = ops.getObjectURI();
|
||||||
|
return checkAuthorization(new DisplayObjectPropertyStatement(
|
||||||
|
subjectUri, predicate, objectUri));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It would be nice if every ObjectPropertyStatement held a real
|
||||||
|
* ObjectProperty. If it doesn't, we do the next best thing, but it
|
||||||
|
* won't recognize any applicaable Faux properties.
|
||||||
|
*/
|
||||||
|
private ObjectProperty getOrCreateProperty(ObjectPropertyStatement ops) {
|
||||||
|
if (ops.getProperty() != null) {
|
||||||
|
return ops.getProperty();
|
||||||
|
}
|
||||||
|
if (ops.getPropertyURI() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ObjectProperty op = new ObjectProperty();
|
||||||
|
op.setURI(ops.getPropertyURI());
|
||||||
|
op.setDomainVClassURI(RequestActionConstants.SOME_URI);
|
||||||
|
op.setRangeVClassURI(RequestActionConstants.SOME_URI);
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,6 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAct
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObjectPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.EditObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.EditObjectPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap;
|
||||||
|
@ -33,9 +30,9 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
|
||||||
private final String editUrl;
|
private final String editUrl;
|
||||||
private final String deleteUrl;
|
private final String deleteUrl;
|
||||||
|
|
||||||
public ObjectPropertyStatementTemplateModel(String subjectUri, ObjectProperty predicate, String objectKey,
|
public ObjectPropertyStatementTemplateModel(String subjectUri, ObjectProperty property, String objectKey,
|
||||||
Map<String, String> data, String templateName, VitroRequest vreq) {
|
Map<String, String> data, String templateName, VitroRequest vreq) {
|
||||||
super(subjectUri, predicate, vreq);
|
super(subjectUri, property, vreq);
|
||||||
|
|
||||||
this.data = Collections.unmodifiableMap(new HashMap<String, String>(data));
|
this.data = Collections.unmodifiableMap(new HashMap<String, String>(data));
|
||||||
this.objectUri = data.get(objectKey);
|
this.objectUri = data.get(objectKey);
|
||||||
|
@ -43,15 +40,12 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
|
||||||
//to keep track of later
|
//to keep track of later
|
||||||
this.objectKey = objectKey;
|
this.objectKey = objectKey;
|
||||||
|
|
||||||
ObjectPropertyStatement ops = new ObjectPropertyStatementImpl(subjectUri, property.getURI(), objectUri);
|
|
||||||
ops.setProperty(predicate);
|
|
||||||
|
|
||||||
// Do delete url first, since it is used in building edit url
|
// Do delete url first, since it is used in building edit url
|
||||||
this.deleteUrl = makeDeleteUrl(ops);
|
this.deleteUrl = makeDeleteUrl();
|
||||||
this.editUrl = makeEditUrl(ops);
|
this.editUrl = makeEditUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String makeDeleteUrl(ObjectPropertyStatement ops) {
|
private String makeDeleteUrl() {
|
||||||
// Is the delete link suppressed for this property?
|
// Is the delete link suppressed for this property?
|
||||||
if (property.isDeleteLinkSuppressed()) {
|
if (property.isDeleteLinkSuppressed()) {
|
||||||
return "";
|
return "";
|
||||||
|
@ -87,11 +81,11 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ops.getProperty()!= null && ops.getProperty().getDomainVClassURI() != null) {
|
if (property!= null && property.getDomainVClassURI() != null) {
|
||||||
params.put("domainUri", ops.getProperty().getDomainVClassURI());
|
params.put("domainUri", property.getDomainVClassURI());
|
||||||
}
|
}
|
||||||
if (ops.getProperty()!= null && ops.getProperty().getRangeVClassURI() != null) {
|
if (property!= null && property.getRangeVClassURI() != null) {
|
||||||
params.put("rangeUri", ops.getProperty().getRangeVClassURI());
|
params.put("rangeUri", property.getRangeVClassURI());
|
||||||
}
|
}
|
||||||
|
|
||||||
params.put("templateName", templateName);
|
params.put("templateName", templateName);
|
||||||
|
@ -100,14 +94,14 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
|
||||||
return UrlBuilder.getUrl(EDIT_PATH, params);
|
return UrlBuilder.getUrl(EDIT_PATH, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String makeEditUrl(ObjectPropertyStatement ops) {
|
private String makeEditUrl() {
|
||||||
// Is the edit link suppressed for this property?
|
// Is the edit link suppressed for this property?
|
||||||
if (property.isEditLinkSuppressed()) {
|
if (property.isEditLinkSuppressed()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine whether the statement can be edited
|
// Determine whether the statement can be edited
|
||||||
RequestedAction action = new EditObjectPropertyStatement(vreq.getJenaOntModel(), ops);
|
RequestedAction action = new EditObjectPropertyStatement(vreq.getJenaOntModel(), subjectUri, property, objectUri);
|
||||||
if ( ! PolicyHelper.isAuthorizedForActions(vreq, action) ) {
|
if ( ! PolicyHelper.isAuthorizedForActions(vreq, action) ) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -125,11 +119,11 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
|
||||||
params.put("deleteProhibited", "prohibited");
|
params.put("deleteProhibited", "prohibited");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ops.getProperty()!= null && ops.getProperty().getDomainVClassURI() != null) {
|
if (property!= null && property.getDomainVClassURI() != null) {
|
||||||
params.put("domainUri", ops.getProperty().getDomainVClassURI());
|
params.put("domainUri", property.getDomainVClassURI());
|
||||||
}
|
}
|
||||||
if (ops.getProperty()!= null && ops.getProperty().getRangeVClassURI() != null) {
|
if (property!= null && property.getRangeVClassURI() != null) {
|
||||||
params.put("rangeUri", ops.getProperty().getRangeVClassURI());
|
params.put("rangeUri", property.getRangeVClassURI());
|
||||||
}
|
}
|
||||||
|
|
||||||
params.putAll(UrlBuilder.getModelParams(vreq));
|
params.putAll(UrlBuilder.getModelParams(vreq));
|
||||||
|
|
|
@ -21,8 +21,6 @@ import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatementImpl;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatementImpl;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
import edu.cornell.mannlib.vitro.webapp.beans.Property;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
|
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
|
@ -82,9 +80,8 @@ public class PropertyGroupTemplateModel extends BaseTemplateModel {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectPropertyStatement ops = new ObjectPropertyStatementImpl(
|
RequestedAction dops = new DisplayObjectPropertyStatement(
|
||||||
subject.getURI(), op.getURI(), SOME_URI);
|
subject.getURI(), op, SOME_URI);
|
||||||
RequestedAction dops = new DisplayObjectPropertyStatement(ops);
|
|
||||||
if (PolicyHelper.isAuthorizedForActions(vreq, dops)) {
|
if (PolicyHelper.isAuthorizedForActions(vreq, dops)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -122,6 +119,7 @@ public class PropertyGroupTemplateModel extends BaseTemplateModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString(){
|
public String toString(){
|
||||||
String ptmStr ="";
|
String ptmStr ="";
|
||||||
for( int i=0; i < properties.size() ; i ++ ){
|
for( int i=0; i < properties.size() ; i ++ ){
|
||||||
|
|
|
@ -4,11 +4,8 @@ package edu.cornell.mannlib.vitro.webapp.auth.policy;
|
||||||
|
|
||||||
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants.SOME_LITERAL;
|
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants.SOME_LITERAL;
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.log4j.Level;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -19,7 +16,6 @@ import stubs.javax.servlet.ServletContextStub;
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
import com.hp.hpl.jena.ontology.OntModelSpec;
|
import com.hp.hpl.jena.ontology.OntModelSpec;
|
||||||
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
||||||
import com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHandler;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle;
|
import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle;
|
||||||
|
@ -81,19 +77,6 @@ public class SelfEditingPolicy_2_Test extends AbstractTestClass {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
InputStream is = getClass().getResourceAsStream(
|
|
||||||
"./SelfEditingPolicy_2_Test.xml");
|
|
||||||
Assert.assertNotNull(is);
|
|
||||||
|
|
||||||
// suppress the warning messages from loading the model.
|
|
||||||
setLoggerLevel(RDFDefaultErrorHandler.class, Level.OFF);
|
|
||||||
|
|
||||||
// TODO This doesn't appear to be used for anything. Can it go away, along with the data file?
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read(is, "");
|
|
||||||
Assert.assertNotNull(model);
|
|
||||||
Assert.assertTrue(model.size() > 0);
|
|
||||||
|
|
||||||
ServletContextStub ctx = new ServletContextStub();
|
ServletContextStub ctx = new ServletContextStub();
|
||||||
PropertyRestrictionPolicyHelper.setBean(ctx,
|
PropertyRestrictionPolicyHelper.setBean(ctx,
|
||||||
PropertyRestrictionPolicyHelperStub
|
PropertyRestrictionPolicyHelperStub
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
|
||||||
|
|
||||||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
||||||
|
|
||||||
<rdf:RDF
|
|
||||||
xmlns:owl ="http://www.w3.org/2002/07/owl#"
|
|
||||||
xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:rdfs ="http://www.w3.org/2000/01/rdf-schema#"
|
|
||||||
xmlns:xsd ="http://www.w3.org/2001/XMLSchema#"
|
|
||||||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
|
||||||
xmlns =""
|
|
||||||
>
|
|
||||||
|
|
||||||
<owl:Ontology rdf:about="">
|
|
||||||
<rdfs:comment>
|
|
||||||
An ontology with a property with a prohibited annotation for unit testing.
|
|
||||||
</rdfs:comment>
|
|
||||||
</owl:Ontology>
|
|
||||||
|
|
||||||
<owl:AnnotationProperty rdf:about="vitro:selfEditProhibitedAnnot"/>
|
|
||||||
|
|
||||||
<owl:ObjectProperty rdf:about="vitro:hasSuperPowers">
|
|
||||||
<vitro:selfEditProhibitedAnnot rdf:datatype="xsd:boolean">true</vitro:selfEditProhibitedAnnot>
|
|
||||||
</owl:ObjectProperty>
|
|
||||||
|
|
||||||
<owl:ObjectProperty rdf:about="vitro:mayPrintMoney">
|
|
||||||
<vitro:selfEditProhibitedAnnot rdf:datatype="xsd:boolean">true</vitro:selfEditProhibitedAnnot>
|
|
||||||
</owl:ObjectProperty>
|
|
||||||
|
|
||||||
<owl:ObjectProperty rdf:about="vitro:getsOutOfJailFree">
|
|
||||||
<vitro:selfEditProhibitedAnnot rdf:datatype="xsd:boolean">true</vitro:selfEditProhibitedAnnot>
|
|
||||||
</owl:ObjectProperty>
|
|
||||||
|
|
||||||
<owl:ObjectProperty rdf:about="vitro:canDeleteModel">
|
|
||||||
<vitro:selfEditProhibitedAnnot rdf:datatype="xsd:boolean">true</vitro:selfEditProhibitedAnnot>
|
|
||||||
</owl:ObjectProperty>
|
|
||||||
|
|
||||||
|
|
||||||
<owl:DatatypeProperty rdf:about="vitro:felonies">
|
|
||||||
<vitro:selfEditProhibitedAnnot rdf:datatype="xsd:boolean">true</vitro:selfEditProhibitedAnnot>
|
|
||||||
</owl:DatatypeProperty>
|
|
||||||
|
|
||||||
|
|
||||||
</rdf:RDF>
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.filtering;
|
package edu.cornell.mannlib.vitro.webapp.dao.filtering;
|
||||||
|
|
||||||
|
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants.SOME_URI;
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -82,12 +84,22 @@ public class IndividualFilteringByStatementTest extends AbstractTestClass {
|
||||||
private static final String URI_VISIBLE_OBJECT_ORDINARY = "object://visible_on_ordinary";
|
private static final String URI_VISIBLE_OBJECT_ORDINARY = "object://visible_on_ordinary";
|
||||||
private static final String URI_MAYBE_OBJECT_ORDINARY = "object://maybe_on_ordinary";
|
private static final String URI_MAYBE_OBJECT_ORDINARY = "object://maybe_on_ordinary";
|
||||||
|
|
||||||
|
private static final String FAUX_DOMAIN_VISIBLE = "faux://visibleDomain";
|
||||||
|
private static final String FAUX_RANGE_VISIBLE = "faux://visibleRange";
|
||||||
|
private static final String FAUX_DOMAIN_HIDDEN = "faux://hiddenDomain";
|
||||||
|
private static final String FAUX_RANGE_HIDDEN = "faux://hiddenRange";
|
||||||
|
|
||||||
|
private static final String URI_FAUX_VISIBLE_ORDINARY = "object://faux_visible_on_ordinary";
|
||||||
|
private static final String URI_FAUX_HIDDEN_ORDINARY = "object://faux_hidden_on_ordinary";
|
||||||
|
|
||||||
|
private IndividualStub indSpecial;
|
||||||
|
private IndividualStub indOrdinary;
|
||||||
private Individual filteredSpecial;
|
private Individual filteredSpecial;
|
||||||
private Individual filteredOrdinary;
|
private Individual filteredOrdinary;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void createIndividuals() {
|
public void createIndividuals() {
|
||||||
IndividualStub indSpecial = new IndividualStub(URI_INDIVIDUAL_SPECIAL);
|
indSpecial = new IndividualStub(URI_INDIVIDUAL_SPECIAL);
|
||||||
|
|
||||||
indSpecial.addDataPropertyStatement(PROPERTY_DATA_HIDDEN,
|
indSpecial.addDataPropertyStatement(PROPERTY_DATA_HIDDEN,
|
||||||
VALUE_HIDDEN_DATA_SPECIAL);
|
VALUE_HIDDEN_DATA_SPECIAL);
|
||||||
|
@ -96,17 +108,17 @@ public class IndividualFilteringByStatementTest extends AbstractTestClass {
|
||||||
indSpecial.addDataPropertyStatement(PROPERTY_DATA_MAYBE,
|
indSpecial.addDataPropertyStatement(PROPERTY_DATA_MAYBE,
|
||||||
VALUE_MAYBE_DATA_SPECIAL);
|
VALUE_MAYBE_DATA_SPECIAL);
|
||||||
|
|
||||||
indSpecial.addObjectPropertyStatement(PROPERTY_OBJECT_HIDDEN,
|
indSpecial.addObjectPropertyStatement(property(PROPERTY_OBJECT_HIDDEN),
|
||||||
URI_HIDDEN_OBJECT_SPECIAL);
|
URI_HIDDEN_OBJECT_SPECIAL);
|
||||||
indSpecial.addObjectPropertyStatement(PROPERTY_OBJECT_VISIBLE,
|
indSpecial.addObjectPropertyStatement(
|
||||||
URI_VISIBLE_OBJECT_SPECIAL);
|
property(PROPERTY_OBJECT_VISIBLE), URI_VISIBLE_OBJECT_SPECIAL);
|
||||||
indSpecial.addObjectPropertyStatement(PROPERTY_OBJECT_MAYBE,
|
indSpecial.addObjectPropertyStatement(property(PROPERTY_OBJECT_MAYBE),
|
||||||
URI_MAYBE_OBJECT_SPECIAL);
|
URI_MAYBE_OBJECT_SPECIAL);
|
||||||
|
|
||||||
filteredSpecial = new IndividualFiltering(indSpecial,
|
filteredSpecial = new IndividualFiltering(indSpecial,
|
||||||
new IndividualBasedFilter());
|
new IndividualBasedFilter());
|
||||||
|
|
||||||
IndividualStub indOrdinary = new IndividualStub("someOtherUri");
|
indOrdinary = new IndividualStub("someOtherUri");
|
||||||
|
|
||||||
indOrdinary.addDataPropertyStatement(PROPERTY_DATA_HIDDEN,
|
indOrdinary.addDataPropertyStatement(PROPERTY_DATA_HIDDEN,
|
||||||
VALUE_HIDDEN_DATA_ORDINARY);
|
VALUE_HIDDEN_DATA_ORDINARY);
|
||||||
|
@ -115,17 +127,30 @@ public class IndividualFilteringByStatementTest extends AbstractTestClass {
|
||||||
indOrdinary.addDataPropertyStatement(PROPERTY_DATA_MAYBE,
|
indOrdinary.addDataPropertyStatement(PROPERTY_DATA_MAYBE,
|
||||||
VALUE_MAYBE_DATA_ORDINARY);
|
VALUE_MAYBE_DATA_ORDINARY);
|
||||||
|
|
||||||
indOrdinary.addObjectPropertyStatement(PROPERTY_OBJECT_HIDDEN,
|
indOrdinary.addObjectPropertyStatement(
|
||||||
URI_HIDDEN_OBJECT_ORDINARY);
|
property(PROPERTY_OBJECT_HIDDEN), URI_HIDDEN_OBJECT_ORDINARY);
|
||||||
indOrdinary.addObjectPropertyStatement(PROPERTY_OBJECT_VISIBLE,
|
indOrdinary.addObjectPropertyStatement(
|
||||||
URI_VISIBLE_OBJECT_ORDINARY);
|
property(PROPERTY_OBJECT_VISIBLE), URI_VISIBLE_OBJECT_ORDINARY);
|
||||||
indOrdinary.addObjectPropertyStatement(PROPERTY_OBJECT_MAYBE,
|
indOrdinary.addObjectPropertyStatement(property(PROPERTY_OBJECT_MAYBE),
|
||||||
URI_MAYBE_OBJECT_ORDINARY);
|
URI_MAYBE_OBJECT_ORDINARY);
|
||||||
|
|
||||||
filteredOrdinary = new IndividualFiltering(indOrdinary,
|
filteredOrdinary = new IndividualFiltering(indOrdinary,
|
||||||
new IndividualBasedFilter());
|
new IndividualBasedFilter());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ObjectProperty property(String propertyUri) {
|
||||||
|
return property(propertyUri, SOME_URI, SOME_URI);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ObjectProperty property(String propertyUri, String domainUri,
|
||||||
|
String rangeUri) {
|
||||||
|
ObjectProperty op = new ObjectProperty();
|
||||||
|
op.setURI(propertyUri);
|
||||||
|
op.setDomainVClassURI(domainUri);
|
||||||
|
op.setRangeVClassURI(rangeUri);
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Tests on data properties
|
// Tests on data properties
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -363,6 +388,41 @@ public class IndividualFilteringByStatementTest extends AbstractTestClass {
|
||||||
fail("onOrdinary_getPopulatedObjectPropertyList not implemented");
|
fail("onOrdinary_getPopulatedObjectPropertyList not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
// Tests on Faux object properties
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
@Test
|
||||||
|
public void hiddenFauxWithVisibleBase() {
|
||||||
|
indOrdinary.addObjectPropertyStatement(
|
||||||
|
property(PROPERTY_OBJECT_VISIBLE, FAUX_DOMAIN_HIDDEN,
|
||||||
|
FAUX_RANGE_HIDDEN), URI_FAUX_HIDDEN_ORDINARY);
|
||||||
|
filteredOrdinary = new IndividualFiltering(indOrdinary,
|
||||||
|
new IndividualBasedFilter());
|
||||||
|
|
||||||
|
List<ObjectPropertyStatement> expected = opsList(filteredOrdinary,
|
||||||
|
ops(PROPERTY_OBJECT_VISIBLE, URI_VISIBLE_OBJECT_ORDINARY));
|
||||||
|
List<ObjectPropertyStatement> actual = filteredOrdinary
|
||||||
|
.getObjectPropertyStatements();
|
||||||
|
assertEquivalentOpsList("hidden faux is not visible", expected, actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void visibleFauxWithHiddenBase() {
|
||||||
|
indOrdinary.addObjectPropertyStatement(
|
||||||
|
property(PROPERTY_OBJECT_HIDDEN, FAUX_DOMAIN_VISIBLE,
|
||||||
|
FAUX_RANGE_VISIBLE), URI_FAUX_VISIBLE_ORDINARY);
|
||||||
|
filteredOrdinary = new IndividualFiltering(indOrdinary,
|
||||||
|
new IndividualBasedFilter());
|
||||||
|
|
||||||
|
List<ObjectPropertyStatement> expected = opsList(filteredOrdinary,
|
||||||
|
ops(PROPERTY_OBJECT_VISIBLE, URI_VISIBLE_OBJECT_ORDINARY),
|
||||||
|
ops(PROPERTY_OBJECT_HIDDEN, URI_FAUX_VISIBLE_ORDINARY));
|
||||||
|
List<ObjectPropertyStatement> actual = filteredOrdinary
|
||||||
|
.getObjectPropertyStatements();
|
||||||
|
assertEquivalentOpsList("visible faux even if base is hidden",
|
||||||
|
expected, actual);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Helper methods
|
// Helper methods
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -726,14 +786,33 @@ public class IndividualFilteringByStatementTest extends AbstractTestClass {
|
||||||
@Override
|
@Override
|
||||||
public Boolean fn(ObjectPropertyStatement ops) {
|
public Boolean fn(ObjectPropertyStatement ops) {
|
||||||
if (PROPERTY_OBJECT_VISIBLE.equals(ops.getPropertyURI())) {
|
if (PROPERTY_OBJECT_VISIBLE.equals(ops.getPropertyURI())) {
|
||||||
|
if (isFauxHidden(ops)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (PROPERTY_OBJECT_MAYBE.equals(ops.getPropertyURI())
|
if (PROPERTY_OBJECT_MAYBE.equals(ops.getPropertyURI())
|
||||||
&& URI_INDIVIDUAL_SPECIAL.equals(ops.getSubjectURI())) {
|
&& URI_INDIVIDUAL_SPECIAL.equals(ops.getSubjectURI())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (isFauxVisible(ops)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isFauxHidden(ObjectPropertyStatement ops) {
|
||||||
|
ObjectProperty prop = ops.getProperty();
|
||||||
|
return FAUX_DOMAIN_HIDDEN.equals(prop.getDomainVClassURI())
|
||||||
|
&& FAUX_RANGE_HIDDEN.equals(prop.getRangeVClassURI());
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFauxVisible(ObjectPropertyStatement ops) {
|
||||||
|
ObjectProperty prop = ops.getProperty();
|
||||||
|
return FAUX_DOMAIN_VISIBLE.equals(prop.getDomainVClassURI())
|
||||||
|
&& FAUX_RANGE_VISIBLE.equals(prop.getRangeVClassURI());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -12,6 +12,9 @@ import java.util.Set;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.rdf.model.Resource;
|
||||||
|
import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean.RoleLevel;
|
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean.RoleLevel;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
|
@ -21,6 +24,7 @@ import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock the basic functions of Individual for unit tests.
|
* Mock the basic functions of Individual for unit tests.
|
||||||
|
@ -31,6 +35,8 @@ public class IndividualStub implements Individual {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
private final String uri;
|
private final String uri;
|
||||||
|
private final String namespace;
|
||||||
|
private final String localName;
|
||||||
|
|
||||||
private final Set<DataPropertyStatement> dpsSet = new HashSet<DataPropertyStatement>();
|
private final Set<DataPropertyStatement> dpsSet = new HashSet<DataPropertyStatement>();
|
||||||
private final Set<ObjectPropertyStatement> opsSet = new HashSet<ObjectPropertyStatement>();
|
private final Set<ObjectPropertyStatement> opsSet = new HashSet<ObjectPropertyStatement>();
|
||||||
|
@ -40,27 +46,25 @@ public class IndividualStub implements Individual {
|
||||||
|
|
||||||
public IndividualStub(String uri) {
|
public IndividualStub(String uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
|
Resource r = ResourceFactory.createResource(uri);
|
||||||
|
this.namespace = r.getNameSpace();
|
||||||
|
this.localName = r.getLocalName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDataPropertyStatement(String predicateUri, String object) {
|
public void addDataPropertyStatement(String predicateUri, String object) {
|
||||||
dpsSet.add(new DataPropertyStatementImpl(this.uri, predicateUri, object));
|
dpsSet.add(new DataPropertyStatementImpl(this.uri, predicateUri, object));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addObjectPropertyStatement(String predicateUri, String objectUri) {
|
public void addObjectPropertyStatement(ObjectProperty property, String objectUri) {
|
||||||
opsSet.add(new ObjectPropertyStatementImpl(this.uri, predicateUri,
|
ObjectPropertyStatementImpl ops = new ObjectPropertyStatementImpl();
|
||||||
objectUri));
|
ops.setSubject(this);
|
||||||
|
ops.setProperty(property);
|
||||||
|
ops.setObjectURI(objectUri);
|
||||||
|
opsSet.add(ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPopulatedObjectPropertyStatement(String predicateUri,
|
public void addVclass(String ns, String localname, String vClassName) {
|
||||||
String objectUri, Individual object) {
|
vClasses.add(new VClass(ns, localname, vClassName));
|
||||||
ObjectPropertyStatementImpl stmt = new ObjectPropertyStatementImpl(
|
|
||||||
this.uri, predicateUri, objectUri);
|
|
||||||
stmt.setObject(object);
|
|
||||||
opsSet.add(stmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addVclass(String namespace, String localname, String vClassName) {
|
|
||||||
vClasses.add(new VClass(namespace, localname, vClassName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -72,6 +76,22 @@ public class IndividualStub implements Individual {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAnonymous() {
|
||||||
|
return (this.uri == null || VitroVocabulary.PSEUDO_BNODE_NS.equals(this
|
||||||
|
.getNamespace()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLocalName() {
|
||||||
|
return this.localName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getNamespace() {
|
||||||
|
return this.namespace;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -166,12 +186,6 @@ public class IndividualStub implements Individual {
|
||||||
// does nothing.
|
// does nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLocalName() {
|
|
||||||
// Useless for now.
|
|
||||||
return "BOGUS Local Name";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VClass getVClass() {
|
public VClass getVClass() {
|
||||||
for (VClass vc : vClasses) {
|
for (VClass vc : vClasses) {
|
||||||
|
@ -197,69 +211,57 @@ public class IndividualStub implements Individual {
|
||||||
// Un-implemented methods
|
// Un-implemented methods
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isAnonymous() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"ResourceBean.isAnonymous() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setURI(String URI) {
|
public void setURI(String URI) {
|
||||||
throw new RuntimeException("ResourceBean.setURI() not implemented.");
|
throw new RuntimeException("IndividualStub.setURI() not implemented.");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNamespace() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"ResourceBean.getNamespace() not implemented.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNamespace(String namespace) {
|
public void setNamespace(String namespace) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.setNamespace() not implemented.");
|
"IndividualStub.setNamespace() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLocalName(String localName) {
|
public void setLocalName(String localName) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.setLocalName() not implemented.");
|
"IndividualStub.setLocalName() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RoleLevel getHiddenFromDisplayBelowRoleLevel() {
|
public RoleLevel getHiddenFromDisplayBelowRoleLevel() {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.getHiddenFromDisplayBelowRoleLevel() not implemented.");
|
"IndividualStub.getHiddenFromDisplayBelowRoleLevel() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHiddenFromDisplayBelowRoleLevel(RoleLevel eR) {
|
public void setHiddenFromDisplayBelowRoleLevel(RoleLevel eR) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.setHiddenFromDisplayBelowRoleLevel() not implemented.");
|
"IndividualStub.setHiddenFromDisplayBelowRoleLevel() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHiddenFromDisplayBelowRoleLevelUsingRoleUri(String roleUri) {
|
public void setHiddenFromDisplayBelowRoleLevelUsingRoleUri(String roleUri) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.setHiddenFromDisplayBelowRoleLevelUsingRoleUri() not implemented.");
|
"IndividualStub.setHiddenFromDisplayBelowRoleLevelUsingRoleUri() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RoleLevel getProhibitedFromUpdateBelowRoleLevel() {
|
public RoleLevel getProhibitedFromUpdateBelowRoleLevel() {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.getProhibitedFromUpdateBelowRoleLevel() not implemented.");
|
"IndividualStub.getProhibitedFromUpdateBelowRoleLevel() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setProhibitedFromUpdateBelowRoleLevel(RoleLevel eR) {
|
public void setProhibitedFromUpdateBelowRoleLevel(RoleLevel eR) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.setProhibitedFromUpdateBelowRoleLevel() not implemented.");
|
"IndividualStub.setProhibitedFromUpdateBelowRoleLevel() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setProhibitedFromUpdateBelowRoleLevelUsingRoleUri(String roleUri) {
|
public void setProhibitedFromUpdateBelowRoleLevelUsingRoleUri(String roleUri) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"ResourceBean.setProhibitedFromUpdateBelowRoleLevelUsingRoleUri() not implemented.");
|
"IndividualStub.setProhibitedFromUpdateBelowRoleLevelUsingRoleUri() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue