elastic / kibana

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

[ResponseOps][Alerts] Provide helper tools for plugins to know if a user has access to create certain rule types #184986

Open cnasikas opened 4 months ago

cnasikas commented 4 months ago

In https://github.com/elastic/kibana/issues/184564, we found a bug in the discover plugin where if you have full access to "discover" and read access to any of the feature privileges related to alerts and rules the "Alert" button is shown. To hide the button we need to know if the user has access to any of the consumers (future privileges) supported by the ES Query type. Plugins, like discover, should not have to know about the implementation details of our framework. We should provide tools where given a rule type, plugins can deduct if the user has permission to create the rule. Example:

type canCreateRule = (uiCapabilities, ruleTypeId) => boolean
elasticmachine commented 4 months ago

Pinging @elastic/response-ops (Team:ResponseOps)