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
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: