Skip to content

Commit 58fd2ad

Browse files
committed
[DURACOM-447] Updated projections
1 parent 56113c2 commit 58fd2ad

4 files changed

Lines changed: 52 additions & 0 deletions

File tree

dspace-server-webapp/src/main/java/org/dspace/app/rest/projection/CompositeProjection.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ public boolean allowLinking(HALResource halResource, LinkRest linkRest) {
8282
return true;
8383
}
8484

85+
@Override
86+
public boolean preventMetadataLevelSecurity() {
87+
return projections.stream()
88+
.anyMatch(prj -> prj.preventMetadataLevelSecurity());
89+
}
90+
8591
@Override
8692
public boolean isAllLanguages() {
8793
return projections.stream()
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* The contents of this file are subject to the license and copyright
3+
* detailed in the LICENSE and NOTICE files at the root of the source
4+
* tree and available online at
5+
*
6+
* http://www.dspace.org/license/
7+
*/
8+
package org.dspace.app.rest.projection;
9+
10+
import org.springframework.stereotype.Component;
11+
12+
/**
13+
* This is a 'placeholder' projection. When set, no metadata security evaluation
14+
* will be performed during DSpaceObject conversion, and only public metadata defined in
15+
* 'metadata.publicField' array property will be returned.
16+
*
17+
* @author Corrado Lombardi (corrado.lombardi at 4science.it)
18+
*
19+
*/
20+
@Component
21+
public class PreventMetadataSecurityProjection extends AbstractProjection {
22+
23+
public final static String NAME = "preventMetadataSecurity";
24+
25+
@Override
26+
public String getName() {
27+
return NAME;
28+
}
29+
30+
@Override
31+
public boolean preventMetadataLevelSecurity() {
32+
return true;
33+
}
34+
}

dspace-server-webapp/src/main/java/org/dspace/app/rest/projection/Projection.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ boolean allowEmbedding(HALResource<? extends RestAddressableModel> halResource,
147147
PageRequest getPagingOptions(String rel, HALResource<? extends RestAddressableModel> resource,
148148
Link... oldLinks);
149149

150+
default boolean preventMetadataLevelSecurity() {
151+
return false;
152+
}
153+
150154
/**
151155
* This method will check if the current Projection allows allLanguage filter
152156
* @return true if allowed, false otherwise

dspace/config/item-submission.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,14 @@
331331
<step id="license"/>
332332
</submission-process>
333333

334+
<submission-process name="publication-edit">
335+
<step id="collection"/>
336+
<!-- Publications use a custom first step, but share page 2 with "traditional" Item form -->
337+
<step id="publicationStep"/>
338+
<step id="traditionalpagetwo"/>
339+
<step id="upload"/>
340+
</submission-process>
341+
334342
<!--
335343
Submission Process for 'Person' Entities
336344
To enable: create a collection for Persons and add it to the <submission-map> tag linking to this process

0 commit comments

Comments
 (0)