Currently, the app framework supports a database-managed mechanism for enabling/disabling apps, as well as the use of permissions, which are also managed in the database.
It would be useful to be able to configure the enabled apps and extensions via an external configuration file as well.
Some intended usages:
- a situation where mysql replication is backing a database for a reporting server, and a different set of apps and extensions need to be enabled on that server
- an implementation using a standardized OpenMRS distribution, but wanting to disable a particular app or feature, without writing code
- Note that this differs from the already-implemented idea of a "feature toggle", which is intended to switch off a feature as it is being developed, and should be removed once the feature is complete.
- Change the methods that currently return enabled Apps and enabled Extensions and/or determines whether a particular app or extension to also look at the file .OpenMRS/appframework-configuration.json
- If the file does not exist, then the existing behavior should not be changed (i.e. check whether the app/extension is enabled, and the user has the required privilege)
- The structure of the file should be:
- Reload this file when the module's context is refreshed. Use Jackson to load this into a proper Java object that defines its syntax.
- Bonus: Reload this file if it has been modified (but avoid actually checking for modification every time we look or enabled apps/extensions)