Skip to content

Legend calls GetLegendGraphics for padlocked layers #2290

@steff-o

Description

@steff-o

Describe the bug
If a layer is padlocked in the legend due to insufficient access rights Origo still tries to request the legend graphics. At least on Geoserver this will fail, causing an unnecessary network call and displaying an ugly broken link image.

To Reproduce
Steps to reproduce the behavior:

  1. Configure a layer in Geoserver to require an access group that you don't belong to
  2. Log out of Geoserver gui to avoid being admitted as admin
  3. Configure a WMS layer in Origo with the layer that you don't have access to
  4. Configure the WMS's source to use a capabilitiesURL
  5. Open the map in a browser
  6. Open devtools in the browser
  7. Refresh page
  8. Depending on you catalog mode setting in Geoserver you will either see a 403 or 200 response with an error message saying that the layer is missing
  9. Look at the legend to see that se symbol is not downloaded and instead displays the browser's broken image link image:
Image

Expected behavior
No request should be sent as it is bound to fail and the legend should display some sort of "no legend available" image/text

Additional context
Preventing fetching the actual map data was implemented for padlocked layers in #2255 but I guess we missed this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugMay be fixed by a core developer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions