3 # Alias: Control permissions in addons with Multisite
6 # Multisite can be used to manage the permissions of
7 # the users in the addons e.g. if a user can edit NagVis
15 echo "on: control user permissions"
16 echo "off: disable permission control"
19 NAGVIS_CFG
=${OMD_ROOT}/etc
/nagvis
/conf.d
/authorisation.ini.php
20 PNP_CFG
=${OMD_ROOT}/etc
/pnp4nagios
/config.d
/authorisation.php
21 if [ "$2" == "on" ]; then
22 cat > $NAGVIS_CFG <<EOF
23 ; Created by OMD hook MULTISITE_AUTHORISATION
24 ; Use the permissions files generated by multisite
26 authorisationmodule="CoreAuthorisationModMultisite"
27 authorisation_multisite_file="$OMD_ROOT/var/check_mk/wato/auth/auth.php"
30 if [ ! -d $
(dirname $PNP_CFG) ]; then
31 mkdir $
(dirname $PNP_CFG)
35 // Created by OMD hook MULTISITE_AUTHORISATION
36 // Use the permissions files generated by multisite
37 if(file_exists(OMD_SITE_ROOT.'/var/check_mk/wato/auth/auth.php')) {
38 require_once(OMD_SITE_ROOT.'/var/check_mk/wato/auth/auth.php');
40 // Before the first use of multisite the auth.php is empty and does not contain this
41 // function. Do try to execute these functions in this case.
42 if(function_exists('users_with_permission')) {
43 \$conf['allowed_for_all_services'] = implode(',', users_with_permission('general.see_all'));
44 \$conf['allowed_for_all_hosts'] = implode(',', users_with_permission('general.see_all'));
50 [ -f $NAGVIS_CFG ] && rm $NAGVIS_CFG
51 [ -f $PNP_CFG ] && rm $PNP_CFG