Authorized Plugins
Components can be defined such that they are only displayed if the user has the permission to see it, or if the config-entry in present in the config.json
file.
Display plugin depending on the user rights
GeoGirafe
Example Code:
<button class="gg-icon-button gg-big" plugin="plugin_infra3d" onclick="alert('plugin')">
<img alt="help-icon" src="icons/infra3d.svg" />
</button>
This will verify that the user has the value plugin_infra3d
in the authorized_plugins, and display the button only if it is the case.
Configuration in GMF-Geoportal
The functionality has to be included in vars.yaml or CONST_vars.yaml under functionalities.available_in_templates
.
In GMF Geoportal a functionality has to be defined with name=authorized_plugin
and the value equals the name of the plugin, for example plugin_infra3d
.
The functionality can then be given to the roles who should have the permission to see this plugin.
Display plugin depending on configuration entries
GeoGirafe comes with lots of default components. Sometimes, some components do not mak any sense in your environment. For exemple, if you don't have any LiDAR backend, you want to deactivate the cross-section from the default interface. You can configure some component do be deactivate automaticaly if the corresponding configuration-entry is not present in the config.json
file.
Example Code:
<button class="gg-icon-button gg-big" plugin="config:lidar" onclick="alert('plugin')">
<img alt="cross-section-icon" src="icons/cross-section.svg" />
</button>
This will verify that the entry lidar
is prensent in the config.json
file, and display the button only if it is the case.