From 643f5aee9828715fb71851c50d0233e73604447a Mon Sep 17 00:00:00 2001 From: tofulm Date: Tue, 3 May 2022 16:08:44 +0200 Subject: [PATCH] amelioration ordre autorisations --- gamuform_autorisations.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) 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; }