Utilisation de la balise #AVANCEMENT_CAMPAGNE dans les squelettes.
[spip_souscriptions.git] / souscription_autorisations.php
1 <?php
2 /**
3  * Définit les autorisations du plugin Souscription
4  *
5  * @plugin     Souscription
6  * @copyright  2013
7  * @author     Olivier Tétard
8  * @licence    GNU/GPL
9  * @package    SPIP\Souscription\Autorisations
10  */
11
12 if (!defined('_ECRIRE_INC_VERSION')) return;
13
14
15 /**
16  * Fonction d'appel pour le pipeline
17  * @pipeline autoriser */
18 function souscription_autoriser(){}
19
20
21 // -----------------
22 // Objet souscriptions
23
24
25 /**
26  * Autorisation de voir un élément de menu (souscriptions)
27  **/
28 function autoriser_souscription_menu_dist($faire, $type, $id, $qui, $opt){
29   return autoriser('webmestre');
30 }
31
32 /**
33  * Autorisation de voir le bouton d'accès rapide de création (souscription)
34  **/
35 function autoriser_souscriptioncreer_menu_dist($faire, $type, $id, $qui, $opt){
36   return false;
37 }
38
39 /**
40  * Autorisation de créer un don. Tout le monde est autorisé
41  * à faire un don.
42  **/
43 function autoriser_souscription_creer_dist($faire, $type, $id, $qui, $opt) {
44   return true;
45 }
46
47 /**
48  * Autorisation de voir un don. Il faut être administrateur pour voir
49  * un don.
50  **/
51 function autoriser_souscription_voir_dist($faire, $type, $id, $qui, $opt) {
52   return autoriser('webmestre', '', '', $qui);
53 }
54
55 /**
56  * Autorisation de modifier un don. Personne n'est autorisé à le
57  * faire.
58  **/
59 function autoriser_souscription_modifier_dist($faire, $type, $id, $qui, $opt) {
60   return false;
61 }
62
63 /**
64  * Autorisation de supprimer un don. Personne n'est autorisé à le
65  * faire.
66  **/
67 function autoriser_souscription_supprimer_dist($faire, $type, $id, $qui, $opt) {
68   return false;
69 }
70
71 /*
72  * Autorisation d'exporter un don.
73  */
74 function autoriser_souscription_exporter_dist($faire, $type, $id, $qui, $opt) {
75   return autoriser('webmestre', '', '', $qui);
76 }
77
78 function autoriser_souscription_configurer_dist($faire, $mode='', $id=0, $qui = NULL, $opt = NULL){
79   return autoriser('webmestre');
80 }
81
82 function autoriser_souscriptioncampagne_dist($faire, $mode='', $id=0, $qui = NULL, $opt = NULL){
83   return autoriser('webmestre');
84 }