= Metadata Element hiding = || '''Date''' || 2012/09/14 || || '''Contact(s)''' || [http://wiki.osgeo.org/wiki/User:Jeichar Jesse Eichar] || || '''Last edited''' || || || '''Status''' || Proposed || || '''Assigned to release''' || 2.9.x || || '''Resources''' || Funding IFremer || || '''Code''' || https://github.com/jesseeichar/core-geonetwork/commits/feature/hide-withheld-section || == Overview == In certain circumstances it can be desirable to hide certain elements of metadata, for example if passwords or connection information is contained in the metadata. This proposal allows these elements to be hidden when viewed by non-owner/administrator users. === Proposal Type === * '''Type''': Metadata * '''App''': !GeoNetwork * '''Module''': === Links === * '''Email discussions''': * '''IRC discussions''': * '''Related work''': === Voting History === * None as yet ---- == Proposal == This proposal will modify loading metadata so that the method will do the following things: * check the settings parameter hidewithheldelements/enabled if it is false then this feature is disabled * check if the current user is either an administrator or the owner of the metadata if both are false then all elements will be retrieved * check the settings parameter hidewithheldelements/keepMarkedElement * If the value is true, then the element with the nilReason attribute will be kept. This allows the UI to display the element with a note indicating that it has been hidden * If the value is false, then the element with the nilReason attribute will deleted along with all of its children. * When the marked element is kept the following happens: * search the document for the attribute: gco:nilReason='withheld'. if the following two checks are true then all attributes (excepting gco:nilReason) will be removed, as will all child elements. The element itself will remain as a marker Note: at the moment only gco:nilReason='withheld' attribute marks an element as hidden. In the future more tags can be added for other schema's. There are two places that must be updated for new takes to work with this system: * the xpath in update !XmlSerializer.internalSelect. * Update xsl/utils.xsl by changing the hasHiddenChildren template. * If the new tag is in iso19139 then the xsl:template mode="localised" match="*[@gco:nilReason='withheld'... template must be updated as well. By default this feature is disabled but this setting can be changed in the configuration page in administration. keepMarkedElement is true by default. In addition to hiding the metadata the Show metadata UIs will show a message that there is hidden/censored metadata. The most important use of this is to notify editors (that can't see the data) that they should not remove the element. One of the expected uses of this is to have some semantics in update-fixed-info that adds the attribute tags to the metadata when needed. In addition a user could add the attribute via the edit UI. === Backwards Compatibility Issues === Settings needs to be updated. Will be part of the migrate sql files. == Risks == == Participants == * As above