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

[Maps] fix users without access to Maps should not have the option to create them #88830

Merged
merged 4 commits into from
Jan 25, 2021

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jan 20, 2021

Fixes #88723

This PR unregisters Maps visualization alias when a user does not have write permission to maps. This ensures the Maps card is not displayed in the visualize create menu when users do not have permission to create a map.

@nreese nreese added release_note:fix [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.12.0 labels Jan 20, 2021
@nreese nreese requested a review from a team as a code owner January 20, 2021 13:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for fixing.

we should also solve the case where the "visualize"-button is showing in Discover for geo-fields.

We could just not register the trigger when the user does not have priviliges

e.g.: something like

    if (core.application.capabilities.maps.save) {
      plugins.uiActions.addTriggerAction(VISUALIZE_GEO_FIELD_TRIGGER, visualizeGeoFieldAction);
    } else {
      plugins.visualizations.unRegisterAlias(APP_ID);
    }

If we don't register the trigger, the visualize-button is no longer showing

image

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx!

// unregisters the OSS alias
plugins.visualizations.unRegisterAlias(PLUGIN_ID_OSS);

if (core.application.capabilities.maps.show) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nreese
Copy link
Contributor Author

nreese commented Jan 25, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
maps 157.2KB 157.4KB +149.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit 15a45e8 into elastic:master Jan 25, 2021
nreese added a commit to nreese/kibana that referenced this pull request Jan 25, 2021
… create them (elastic#88830)

* [Maps] fix users without access to Maps should not have the option to create them

* fix test message

* wrap add geo field trigger in show capabilities check

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Jan 25, 2021
… create them (#88830) (#89209)

* [Maps] fix users without access to Maps should not have the option to create them

* fix test message

* wrap add geo field trigger in show capabilities check

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:fix v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users without access to Maps should not have the option to create them
4 participants