diff --git a/gamuform_autorisations.php b/gamuform_autorisations.php index 626ad8f..a51a362 100644 --- a/gamuform_autorisations.php +++ b/gamuform_autorisations.php @@ -21,34 +21,42 @@ function gamuform_autoriser() { } function autoriser_gamuform_modifier_dist($faire, $type, $id, $qui, $opt) { + if (autoriser('webmestre')) { + return true; + } if (!empty($opt['objet'])) { return autoriser('modifier', $opt['objet'], $id, $qui, []); } - - return autoriser('webmestre'); + return false; } function autoriser_gamuform_voir_dist($faire, $type, $id, $qui, $opt) { + if (autoriser('webmestre')) { + return true; + } if (!empty($opt['objet'])) { return autoriser('voir', $opt['objet'], $id, $qui, []); } - - return autoriser('webmestre'); + return false; } function autoriser_gamuform_creer_dist($faire, $type, $id, $qui, $opt) { + if (autoriser('webmestre')) { + return true; + } if (!empty($opt['objet'])) { return autoriser('creer', $opt['objet'], $id, $qui, []); } - - return autoriser('webmestre'); + return false; } function autoriser_gamuform_supprimer_dist($faire, $type, $id, $qui, $opt) { + if (autoriser('webmestre')) { + return true; + } if (!empty($opt['objet'])) { return autoriser('voir', $opt['objet'], $id, $qui, []); } - - return autoriser('webmestre'); + return false; }