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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction d'appel pour le pipeline
|
||||
* @pipeline autoriser */
|
||||
|
@ -21,37 +20,35 @@ function gamumail_autoriser() {
|
|||
}
|
||||
|
||||
|
||||
// -----------------
|
||||
// Objet gamumails
|
||||
|
||||
/**
|
||||
* Objet gamumails
|
||||
**/
|
||||
function autoriser_gamumail_creer_dist($faire, $type, $id, $qui, $opt) {
|
||||
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||
}
|
||||
|
||||
function autoriser_gamumail_voir_dist($faire, $type, $id, $qui, $opt) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function autoriser_gamumail_modifier_dist($faire, $type, $id, $qui, $opt) {
|
||||
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||
}
|
||||
|
||||
function autoriser_gamumail_supprimer_dist($faire, $type, $id, $qui, $opt) {
|
||||
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||
}
|
||||
|
||||
function autoriser_gamumail_configurer_dist($faire, $type, $id, $qui, $opt) {
|
||||
return autoriser('webmestre');
|
||||
}
|
||||
|
||||
/**
|
||||
* Autorisation de modifier le nom d'un slug
|
||||
* 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) {
|
||||
$editable = sql_getfetsel('editable', 'spip_gamumails', 'id_gamumail='.intval($id));
|
||||
if (
|
||||
intval($id)
|
||||
and $editable = sql_getfetsel('editable', 'spip_gamumails', 'id_gamumail='.intval($id))
|
||||
and $editable !== 'non'
|
||||
and $editable != 'non'
|
||||
) {
|
||||
return
|
||||
autoriser('webmestre')
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
<div id="#SLUG" class="js-hidden">
|
||||
<div class="objet--slug">
|
||||
<strong><:gamumail:slug:>: </strong>
|
||||
[(#AUTORISER{modifier_nom_slug,gamumail, #ID_GAMUMAIL}|?{
|
||||
[(#AUTORISER{modifier_nom_slug, gamumail, #ID_GAMUMAIL}|?{
|
||||
<span class="[(#EDIT{nom_slug})]">[(#SLUG|sinon{<:gamumail:dbe_clic_editer:>})]</span>
|
||||
,
|
||||
<span class="">[(#SLUG)]</span>
|
||||
|
|
Loading…
Add table
Reference in a new issue