Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map stays blank if user has no permissions on default theme #12

Closed
olivierdalang opened this issue Apr 28, 2022 · 1 comment
Closed

Comments

@olivierdalang
Copy link

Hey ! Not 100% this is the right repo to report this issue...

In our setup, there is no default theme that every user has access to (we run qwc-map-viewer with AUTH_REQUIRED: "true"). This leads to the map staying blank on startup for all users except for the user that happens to have access to the first theme.

In such case, it would be better to fall back to the first project that user has access to.

See themes.json below, as served by qwc-map-viewer below, where you can see that the default theme isn't listed in the available themes. Note that the input configuration is generated by the config generator, which seems to assume the first project as default (never specified that manually). Arguably the config generator shouldn't add the "defaultTheme" property, and QWC should use the first theme if no "defaultTheme" is set.

Thanks !!

{
  "themes": {
    ...
    "defaultTheme": "scan/client_a",
    ...
    "items": [
      {
        ...
        "id": "scan/client_b",
        ...
      }
    ],
    ...
  }
}
@manisandro
Copy link
Member

I'd say setting a default theme which is protected will always lead to undesired results. For authenticated users, the default startup params can be stored in the QWC Config DB (qwc_config.user_infos -> default_url_params). I'd suggest using that approach instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants