elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.7k stars 8.24k forks source link

[ShareMenu] The new modal doesn't account for `disabledShareUrl` #201980

Open markov00 opened 6 days ago

markov00 commented 6 days ago

Kibana version: main, probably 8.15

Describe the bug:

The share link in Lens should be enabled only if the user has the createShortUrl privilege. This doesn't happen anymore and the new share menu always offers the ability to copy the link.

This is a regression caused by https://github.com/elastic/kibana/pull/180406

The disabledShareUrl property, passed in the ShareContext of the new ShareMenu, is not considered and the link tab is always present.

Steps to reproduce:

  1. Create a simple user and a custom role. Assign only Read capabilities to Visualize Library
  2. Now sign up with that user, create a new visualization and try to share it
  3. The share Link tab is visible (even if the button doesn't do nothing and the link is not created.

Expected behavior: The share menu should respect the disabledShareUrl property and the link tab should not be visible

elasticmachine commented 6 days ago

Pinging @elastic/appex-sharedux (Team:SharedUX)