Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

Purpose

Allows item submitters/editors to set visibility levels on individual metadata values. When set, a metadata value is only returned via REST/UI if the requesting user meets the required security level.

This mechanism is overridden by Hide Item Metadata Fields, so if you set metadata.hide.person.email = true,  the configuration below will not work for the person.email metadata.


Configuration Key Format

metadatavalue.visibility[.EntityType][.metadataField].settings = [level1 level2 ...]


Lookup Hierarchy (most specific wins)

1. Field-level: metadatavalue.visibility.Person.person.email.settings

2. Entity-level: metadatavalue.visibility.Person.settings

3. Global fallback: metadatavalue.visibility.settings

An empty [] means no security levels are offered (metadata follows standard visibility). A null/missing value falls through to the next level.


Default Security Levels

Defined in spring-dspace-security-metadata.xml:

LevelClassMeaning
0MetadataPublicAccessVisible to everyone (including Anonymous)
1MetadataGroupBasedAccessVisible only to members of the "Trusted" group
2MetadataAdministratorAndOwnerAccessVisible only to Admins or the entity owner


How Values Work 

The configured array defines which levels the submitter/editor can choose from, not the visibility itself. For example: 

  • [0 1 2] – submitter can pick Public, Trusted, or Admin/Owner
  • [1 2] – submitter can only pick Trusted or Admin/Owner
  • If only one value > 0 is set, the choice is between level 0 and that level 


Configuration

Inside metadata-security.cfg:

metadatavalue.visibility.settings = [0 1 2]
metadatavalue.visibility.Person.settings = [0 1]
metadatavalue.visibility.Person.dc.date.available.settings = [0 1]


Custom Security Levels 

To add custom levels:  

  1. Implement the org.dspace.content.service.MetadataSecurityEvaluation interface
  2. Register the implementation in dspace/config/spring/api/spring-dspace-security-metadata.xml with a new level number: 

    <util:map id="securityLevelsMap">
    <entry key="0" value-ref="level0Security"/>
    <entry key="1" value-ref="level1Security"/>
    <entry key="2" value-ref="level2Security"/>
    <entry key="3" value-ref="level3Security"/> <!-- your custom level -->
    </util:map>
    
<bean id="level3Security" class="org.dspace.content.YourCustomSecurityAccess"/>
  3. Add the new level number to the appropriate configuration keys in metadata-security.cfg




  • No labels