[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1226: Dont display download/wms links when not connected and no rights granted

#1226: Dont display download/wms links when not connected and no rights granted
---------------------+------------------------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------
In ticket #1107 the display of wms/download links was reworked - the way
it is now in master, if you have a metadata with WMS or download links,
the code in MetadataResultsView.js:displayLinks() will create a linkButton
object regardless of allowDynamic/allowDownload and add it to the view -
thus if you dont have rights to view in interactive map/download, an empty
extjs menu will be created & added to the view but not populated.

This is probably because the latest linkButton is added in line 619 if it
is not null while the length of the array should also be checked like its
done on line 572.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1226&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1226: Dont display download/wms links when not connected and no rights granted
---------------------+------------------------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------

Comment(by landry):

{{{
@@ -616,7 +615,7 @@ GeoNetwork.MetadataResultsView =
Ext.extend(Ext.DataView, {

                      });
                      // Add the latest button
- if (linkButton !== null) {
+ if (linkButton !== null && linkButton.length !== 0) {
                          view.addLinkMenu(linkButton, label, currentType,
el);
                      }

}}}

Fixes the issue here.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1226#comment:1&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1226: Dont display download/wms links when not connected and no rights granted
----------------------+-----------------------------------------------------
  Reporter: landry | Owner: geonetwork-devel@…
      Type: defect | Status: closed
  Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------
Changes (by ianwallen):

  * status: new => closed
  * resolution: => fixed

Comment:

Commit in master 4425ca17cc3ab2d7ed7f006763922f9ab6d48fa3

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1226#comment:2&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.