Revert "don't create add url if neither of 'select from existing' nor 'provide selection' options set (#385)" (#389)

This reverts commit 6c9e21544a.
This commit is contained in:
Dragan Ivanovic 2023-05-23 10:49:57 +02:00 committed by GitHub
parent 329b8e4100
commit f19d0a08c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
} }
} }
protected void setAddUrl(ObjectProperty property) { protected void setAddUrl(Property property) {
// Is the add link suppressed for this property? // Is the add link suppressed for this property?
if (property.isAddLinkSuppressed()) { if (property.isAddLinkSuppressed()) {
return; return;
@ -125,10 +125,6 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
if ( ! PolicyHelper.isAuthorizedForActions(vreq, action) ) { if ( ! PolicyHelper.isAuthorizedForActions(vreq, action) ) {
return; return;
} }
if (isNotAllowedToCreateOrSelect(property)) {
return;
}
String rangeUri = (property instanceof ObjectProperty) String rangeUri = (property instanceof ObjectProperty)
? ((ObjectProperty) property).getRangeVClassURI() ? ((ObjectProperty) property).getRangeVClassURI()
@ -156,10 +152,6 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
} }
} }
private boolean isNotAllowedToCreateOrSelect(ObjectProperty property) {
return !property.getSelectFromExisting() && !property.getOfferCreateNewOption();
}
/** /**
* Pull this into a protected method so we can stub it out in the unit tests. * Pull this into a protected method so we can stub it out in the unit tests.
* Other options: * Other options: