diff --git a/auted_autorisations.php b/auted_autorisations.php index c84bb1e..d08b399 100644 --- a/auted_autorisations.php +++ b/auted_autorisations.php @@ -22,32 +22,26 @@ function auted_autoriser() { // ----------------- -// Objet aut_mods - +// BOSS +function autoriser_boss_dist($faire, $type, $id, $qui, $opt) { + if (autoriser('webmestre', null, null, $qui, null)) { + return true; + } + if ($qui['boss'] === 'oui') { + return true; + } + return false; +} +// ----------------- +// Objet aut_modeles /** * Autorisation de créer (autmodele) * **/ function autoriser_autmodele_associer_dist($faire, $type, $id, $qui, $opt) { - return (autoriser('webmestre', '', '', $qui) or $qui['pgp'] === "boss"); -} - -/** - * Autorisation de créer (autmodele) - * -**/ -function autoriser_autmodele_creer_dist($faire, $type, $id, $qui, $opt) { - return (autoriser('webmestre', '', '', $qui) or $qui['pgp'] === "boss"); -} - -/** - * Autorisation de voir (autmodele) - * -**/ -function autoriser_autmodele_voir_dist($faire, $type, $id, $qui, $opt) { - return (autoriser('webmestre', '', '', $qui) or $qui['pgp'] === "boss"); + return (autoriser('webmestre', '', '', $qui) or $qui['boss'] === "oui"); } /** @@ -55,13 +49,5 @@ function autoriser_autmodele_voir_dist($faire, $type, $id, $qui, $opt) { * **/ function autoriser_autmodele_modifier_dist($faire, $type, $id, $qui, $opt) { - return (autoriser('webmestre', '', '', $qui) or $qui['pgp'] === "boss"); -} - -/** - * Autorisation de supprimer (autmodele) - * -**/ -function autoriser_autmodele_supprimer_dist($faire, $type, $id, $qui, $opt) { - return (autoriser('webmestre', '', '', $qui) or $qui['pgp'] === "boss"); + return (autoriser('webmestre', '', '', $qui) or $qui['boss'] === "oui"); }