To allow system wide local configuration, we can add a new configuration file located into the installation folder.
When Drive is looking for configuration files, it will first peek the system one (INSTALLDIR\config.ini), then the user one (~\.nuxeo-drive\config.ini).
- User options will override system ones.
- Changes are effective for all OSes.
We also need to tweak options in Settings to let the user know that is is managed by their sysadmin and they have no control over these.
We will create another file, let's say admin.py, which defines the IS_ADMIN constant. This way we will be able to filter behaviors.
The new configuration flow will be:
- a registry key inside HKEY_CURRENT_USER\Software\Nuxeo\Drive,
- the REST API endpoint /drive/configuration served by the server,
- a INSTALDIR/config.ini file,
- a $HOME/.nuxeo-drive/config.ini file,
- the command line.
Each of these ways overrides the previous one.