VIVO-1929: patch authorizing create individual form (#206)
* patch authorizing create individual form Resolves: https://jira.lyrasis.org/browse/VIVO-1929
This commit is contained in:
parent
4fdbb71fee
commit
2e0b3f0f05
2 changed files with 12 additions and 3 deletions
|
@ -61,6 +61,10 @@ public class EditConfigurationUtils {
|
||||||
return vreq.getParameter("rangeUri");
|
return vreq.getParameter("rangeUri");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getTypeOfNew(VitroRequest vreq) {
|
||||||
|
return vreq.getParameter("typeOfNew");
|
||||||
|
}
|
||||||
|
|
||||||
public static VClass getRangeVClass(VitroRequest vreq) {
|
public static VClass getRangeVClass(VitroRequest vreq) {
|
||||||
// This needs a WebappDaoFactory with no filtering/RDFService
|
// This needs a WebappDaoFactory with no filtering/RDFService
|
||||||
// funny business because it needs to be able to retrieve anonymous union
|
// funny business because it needs to be able to retrieve anonymous union
|
||||||
|
|
|
@ -11,6 +11,7 @@ import javax.servlet.annotation.WebServlet;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
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.jena.ontology.OntModel;
|
import org.apache.jena.ontology.OntModel;
|
||||||
|
@ -70,7 +71,11 @@ public class EditRequestDispatchController extends FreemarkerHttpServlet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AuthorizationRequest requiredActions(VitroRequest vreq) {
|
protected AuthorizationRequest requiredActions(VitroRequest vreq) {
|
||||||
//Check if this statement can be edited here and return unauthorized if not
|
// If request is for new individual, return simple do back end editing action permission
|
||||||
|
if (StringUtils.isNotEmpty(EditConfigurationUtils.getTypeOfNew(vreq))) {
|
||||||
|
return SimplePermission.DO_BACK_END_EDITING.ACTION;
|
||||||
|
}
|
||||||
|
// Check if this statement can be edited here and return unauthorized if not
|
||||||
String subjectUri = EditConfigurationUtils.getSubjectUri(vreq);
|
String subjectUri = EditConfigurationUtils.getSubjectUri(vreq);
|
||||||
String predicateUri = EditConfigurationUtils.getPredicateUri(vreq);
|
String predicateUri = EditConfigurationUtils.getPredicateUri(vreq);
|
||||||
String objectUri = EditConfigurationUtils.getObjectUri(vreq);
|
String objectUri = EditConfigurationUtils.getObjectUri(vreq);
|
||||||
|
|
Loading…
Add table
Reference in a new issue