ajout du fichier

This commit is contained in:
Christophe 2020-02-10 13:19:46 +01:00
parent bfadf6e1a6
commit cfebaa9dc0

View file

@ -0,0 +1,30 @@
<?php
if (!defined('_ECRIRE_INC_VERSION')){
return;
}
function tester_autorisation($faire, $type, $qui, $secret = true) {
include_spip('inc/autoriser');
if (autoriser('webmestre', null, null, $qui, null)) {
return true;
}
if ($secret) {
if (pipeline('super_autorisation',$qui)) {
return true;
}
}
$Tauts = [];
if (!empty($qui['autorisations'])) {
$Tauts = json_decode($qui['autorisations'],true);
}
if (array_key_exists($type, $Tauts)) {
if (in_array($faire, $Tauts[$type])) {
return true;
}
}
return false;
}