Skip to content

Custom Privileges Filter

François Prunayre edited this page Apr 22, 2014 · 5 revisions
Date 2014604614 Contacts Francois Prunayre / Florent Gravin
Status Motion passed / Done Release 2.11
Resources Available Ticket # See [https://github.com/geonetwork/core-geonetwork/pull/454](https://github.com/geonetwork/core-geonetwork/pull/454)
Source code [https://github.com/fxprunayre/core-geonetwork/tree/feature/extend-privileges-filter](https://github.com/fxprunayre/core-geonetwork/tree/feature/extend-privileges-filter)
Funding Ifremer

Overview

This proposal provides customization of the filter to be applied to the edit/download/dynamic reserved operations which currently only applies to file uploaded to the catalog for the download one and to WMS for dynamic. It also extends and make more generic the ISO19139 filter on elements with attribute nilReason (and value withheld).

The goal is to add the capability to configure the download and dynamic operation based on the catalog content where they could have different meanings depending :

  • on the schema (eg. URL to a file for download is not located at the same place for dublin core and ISO19139)
  • on the record encoding rules (eg. download could be WFS links and not only uploaded file).

This proposal define per schema configuration of the element to be filtered when a user access a record depending on the operations : edit / download / dynamic.

Technical Details:

Filter configuration for each type of operation is defined in schema-ident.xml in the filters section (https://github.com/fxprunayre/core-geonetwork/blob/8ec082bc48c613b53acb06963d29c9a734482ba9/web/src/main/webapp/WEB-INF/data/config/schema_plugins/iso19139/schema-ident.xml#L14):

  <filters>
    <filter xpath="*//*[@gco:nilReason='withheld']"
            ifNotOperation="editing">
      <keepMarkedElement gco:nilReson="withheld"/>
    </filter>
    <filter xpath="*//gmd:onLine[*/gmd:protocol/gco:CharacterString = 'WWW:DOWNLOAD-1.0-http--download']"
            ifNotOperation="download"/>
    <filter xpath="*//gmd:onLine[starts-with(*/gmd:protocol/gco:CharacterString, 'OGC:WMS')]"
            ifNotOperation="dynamic"/>
  </filters>

A filter define:

  • an operation (which match canEdit, canDownload, canDynamic method in AccessManager)
  • an XPath to select elements to filter
  • an optional element definition to substitute the replaced element by (if a match is found this element attributes or children are inserted). This is used to highlight removed element.

For backward compatibility for the existing gco:nilReason attribute filter (http://trac.osgeo.org/geonetwork/wiki/HidingMetadata) the following rules is defined for ISO19139:

    <filter xpath="*//*[@gco:nilReason='withheld']"
            ifNotOperation="editing">
      <keepMarkedElement gco:nilReson="withheld"/>
    </filter>

The global system properties to define gco:nilReason filter is removed as it depends now on the schema configuration.

The filters are applied in XMLSerializer according to user privileges.

Note: like current implementation it does not filter information returned by the search services. It only applies filters when user access a record in view mode, xml, csw, ...

Also fix: https://github.com/geonetwork/core-geonetwork/issues/451

Proposal Type:

  • Type: Schema configuration
  • Module: SchemaLoader

Voting History

  • Vote Proposed: 2014-04-15
  • +1 from Francois, Emanuele, Jose

Participants

  • Francois Prunayre
  • Florent Gravin
  • Mickael Treguer
Clone this wiki locally