mise au carré des autorisations
This commit is contained in:
parent
6221819062
commit
0feb7ecfee
7 changed files with 16 additions and 15 deletions
|
@ -18,7 +18,7 @@ include_spip('inc/autoriser');
|
||||||
|
|
||||||
function action_creer_slug_dist(){
|
function action_creer_slug_dist(){
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("webmestre")) {
|
if (!autoriser('creer','gamumail')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,17 +6,13 @@ function action_gamuform_add_pdf_dist(){
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("etre","connecte")) {
|
if (!autoriser('modifier','gamumail')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$securiser_action = charger_fonction('securiser_action', 'inc');
|
$securiser_action = charger_fonction('securiser_action', 'inc');
|
||||||
$arg = $securiser_action();
|
$arg = $securiser_action();
|
||||||
$id_gamumail = $arg;
|
$id_gamumail = $arg;
|
||||||
include_spip('inc/autoriser');
|
|
||||||
if (! autoriser("webmestre")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (intval($id_gamumail)) {
|
if (intval($id_gamumail)) {
|
||||||
sql_insertq('spip_gamumail_pdfs',['id_gamumail' => intval($id_gamumail)]);
|
sql_insertq('spip_gamumail_pdfs',['id_gamumail' => intval($id_gamumail)]);
|
||||||
|
|
|
@ -16,7 +16,7 @@ include_spip('inc/autoriser');
|
||||||
|
|
||||||
function action_supprimer_slug_dist(){
|
function action_supprimer_slug_dist(){
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("webmestre")) {
|
if (!autoriser('supprimer','gamumail')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ include_spip('inc/autoriser');
|
||||||
|
|
||||||
function action_switcher_slug_public_dist(){
|
function action_switcher_slug_public_dist(){
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("webmestre")) {
|
if (!autoriser('modifier','gamumail')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ function gamumail_autoriser() {
|
||||||
* @return bool true s'il a le droit, false sinon
|
* @return bool true s'il a le droit, false sinon
|
||||||
**/
|
**/
|
||||||
function autoriser_gamumail_creer_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_creer_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return in_array($qui['statut'], array('0minirezo', '1comite'));
|
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +66,7 @@ function autoriser_gamumail_voir_dist($faire, $type, $id, $qui, $opt) {
|
||||||
* @return bool true s'il a le droit, false sinon
|
* @return bool true s'il a le droit, false sinon
|
||||||
**/
|
**/
|
||||||
function autoriser_gamumail_modifier_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_modifier_dist($faire, $type, $id, $qui, $opt) {
|
||||||
return in_array($qui['statut'], array('0minirezo', '1comite'));
|
return $qui['statut'] == '0minirezo' and !$qui['restreint'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
[(#AUTORISER{modifier,gamumail}|sinon_interdire_acces)]
|
||||||
|
|
||||||
<style type="text/css" media="screen">
|
<style type="text/css" media="screen">
|
||||||
.configuration_mails .objet--mail span {
|
.configuration_mails .objet--mail span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -82,7 +84,9 @@
|
||||||
<BOUCLE_message(GAMUMAILS)>
|
<BOUCLE_message(GAMUMAILS)>
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<div class="une_conf">
|
<div class="une_conf">
|
||||||
<a class="btn btn_supprimer" title="<:gamumail:supprimer_modele:>" href="[(#URL_ACTION_AUTEUR{supprimer_slug,#ID_GAMUMAIL,#SELF})]"><i class="fa fa-trash"></i></a>
|
[(#AUTORISER{supprimer,gamumail}|oui)
|
||||||
|
<a class="btn btn_supprimer" title="<:gamumail:supprimer_modele:>" href="[(#URL_ACTION_AUTEUR{supprimer_slug,#ID_GAMUMAIL,#SELF})]"><i class="fa fa-trash"></i></a>
|
||||||
|
]
|
||||||
<span class="btn btn_editer" title="<:gamumail:editer_titre:>" onClick="$('#h4_#SLUG em.crayon-crayon').trigger('click');"><i class="fa fa-edit"></i></span>
|
<span class="btn btn_editer" title="<:gamumail:editer_titre:>" onClick="$('#h4_#SLUG em.crayon-crayon').trigger('click');"><i class="fa fa-edit"></i></span>
|
||||||
<h4 class="toggle cursor #EDIT{titre}"
|
<h4 class="toggle cursor #EDIT{titre}"
|
||||||
id="h4_#SLUG"
|
id="h4_#SLUG"
|
||||||
|
@ -93,7 +97,7 @@
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div id="#SLUG" class="js-hidden">
|
<div id="#SLUG" class="js-hidden">
|
||||||
[(#AUTORISER{webmestre}|oui)
|
[(#AUTORISER{supprimer,gamumail}|oui)
|
||||||
<div class="objet--slug">
|
<div class="objet--slug">
|
||||||
<strong><:gamumail:slug:>: </strong>
|
<strong><:gamumail:slug:>: </strong>
|
||||||
<span class="#EDIT{slug}">[(#SLUG|sinon{<:gamumail:dbe_clic_editer:>})]</span>
|
<span class="#EDIT{slug}">[(#SLUG|sinon{<:gamumail:dbe_clic_editer:>})]</span>
|
||||||
|
@ -145,8 +149,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</BOUCLE_message>
|
</BOUCLE_message>
|
||||||
|
[(#AUTORISER{creer,gamumail}|oui)
|
||||||
<a class="btn" title="<:gamumail:creer_modele:>" href="[(#URL_ACTION_AUTEUR{creer_slug,null,#SELF})]"><i class="fa fa-envelope"></i> Nouveau modèle</a>
|
<a class="btn" title="<:gamumail:creer_modele:>" href="[(#URL_ACTION_AUTEUR{creer_slug,null,#SELF})]"><i class="fa fa-envelope"></i> Nouveau modèle</a>
|
||||||
|
]
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
]
|
]
|
||||||
|
|
||||||
<div class="pdfs">
|
<div class="pdfs">
|
||||||
[(#AUTORISER{webmestre}|oui)
|
[(#AUTORISER{modifier,gamumail}|oui)
|
||||||
<a class="btn ajax nohistory nocache" href="[(#URL_ACTION_AUTEUR{gamuform_add_pdf,#ENV{id_gamumail},#SELF})]">
|
<a class="btn ajax nohistory nocache" href="[(#URL_ACTION_AUTEUR{gamuform_add_pdf,#ENV{id_gamumail},#SELF})]">
|
||||||
+ pdf
|
+ pdf
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Add table
Reference in a new issue