Autorisations_-tendues/auted_autorisations.php

53 lines
1 KiB
PHP

<?php
/**
* Définit les autorisations du plugin Autorisations étendues
*
* @plugin Autorisations étendues
* @copyright 2020
* @author tofulm
* @licence GNU/GPL
* @package SPIP\Auted\Autorisations
*/
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
/**
* Fonction d'appel pour le pipeline
* @pipeline autoriser */
function auted_autoriser() {
}
// -----------------
// 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['boss'] === "oui");
}
/**
* Autorisation de modifier (autmodele)
*
**/
function autoriser_autmodele_modifier_dist($faire, $type, $id, $qui, $opt) {
return (autoriser('webmestre', '', '', $qui) or $qui['boss'] === "oui");
}