correction du calcul d'autorisation pour l'édition du nom des slugs
This commit is contained in:
parent
44bc7bdc5b
commit
17ba9f097a
2 changed files with 8 additions and 11 deletions
|
@ -13,7 +13,6 @@ if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction d'appel pour le pipeline
|
* Fonction d'appel pour le pipeline
|
||||||
* @pipeline autoriser */
|
* @pipeline autoriser */
|
||||||
|
@ -21,37 +20,35 @@ function gamumail_autoriser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------
|
/**
|
||||||
// Objet gamumails
|
* Objet gamumails
|
||||||
|
**/
|
||||||
function autoriser_gamumail_creer_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_creer_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoriser_gamumail_voir_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_voir_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoriser_gamumail_modifier_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_modifier_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoriser_gamumail_supprimer_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_supprimer_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoriser_gamumail_configurer_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_configurer_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return autoriser('webmestre');
|
return autoriser('webmestre');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Autorisation de modifier le nom d'un slug
|
* Autorisation de modifier le nom d'un slug
|
||||||
* uniquement les webmestres avec un mail en @gamuza.fr
|
* uniquement les webmestres avec un mail en @gamuza.fr
|
||||||
|
* sauf si editable=non (pour les slugs créés par des plugins)
|
||||||
**/
|
**/
|
||||||
function autoriser_gamumail_modifier_nom_slug_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_modifier_nom_slug_dist($faire, $type, $id, $qui, $opt) {
|
||||||
|
$editable = sql_getfetsel('editable', 'spip_gamumails', 'id_gamumail='.intval($id));
|
||||||
if (
|
if (
|
||||||
intval($id)
|
intval($id)
|
||||||
and $editable = sql_getfetsel('editable', 'spip_gamumails', 'id_gamumail='.intval($id))
|
and $editable != 'non'
|
||||||
and $editable !== 'non'
|
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
autoriser('webmestre')
|
autoriser('webmestre')
|
||||||
|
|
Loading…
Add table
Reference in a new issue