Kibana enable or disable visualizations in a dashboard via API

When using a Kibana dashboard which encapsulates multiple visualizations, we have a requirement to disable or enable some visualizations via the API (query params).

We believe this could be a good feature in Open Distro as it solves business requirements when building complex dashboards in Kibana for reporting purposes for example.

We have identified where to implement this feature in Kibana and wanted to check how feasible is it to apply it either on the common source or at least for our internal use initially.

The changes are in the following two files:

path: src/plugins/dashboard/public/application
file: dashboard_state_manager.js

path: src/plugins/dashboard/public/application
file: _dashboard_app.scss

Can someone share a view on this feature, please?
If we only keep it for our internal use, are we safe from Apache License 2 perspective?

P.S. Our company is using AWS Managed Elastic and we want to adopt Kibana Open Distro (unmanaged) for a reporting capability.