module.config.php 8.31 KB
Newer Older
1
2
3
4
5
<?php

namespace ExportRh;

use Application\Provider\Privilege\Privileges;
6
use ExportRh\Assertion\ExportRhAssertion;
Antony Le Courtes's avatar
Antony Le Courtes committed
7
8
use ExportRh\Connecteur\Siham\SihamConnecteur;
use ExportRh\Connecteur\Siham\SihamConnecteurFactory;
9
10
use ExportRh\Form\ExportRhForm;
use ExportRh\Form\Factory\ExportRhFormFactory;
11
use UnicaenAuth\Guard\PrivilegeController;
12
use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider;
13
14
15

return [

16
    'router'       => [
17
        'routes' => [
18
            'intervenant' => [
19
                'type'          => 'Segment',
20
                'may_terminate' => true,
21
                'options'       => [
22
23
                    'route'  => '/intervenant',
                    'action' => 'index',
24
25
                ],
                'child_routes'  => [
26
27
28
29
30
31
32
33
34
35
36
                    'exporter'       => [
                        'type'          => 'Segment',
                        'may_terminate' => false,
                        'options'       => [
                            'route'    => '/:intervenant/exporter',
                            'defaults' => [
                                'controller' => Controller\ExportRhController::class,
                                'action'     => 'exporter',
                            ],
                        ],
                    ],
37
38
39
40
41
42
43
44
45
                    'exporter-rh'    => [
                        'type'    => 'Segment',
                        'options' => [
                            'route'    => '/:intervenant/voir?tab=export-rh',
                            'defaults' => [
                                'action' => 'voir',
                            ],
                        ],
                    ],
46
47
48
49
50
51
52
53
54
55
56
                    'pec'            => [
                        'type'          => 'Segment',
                        'may_terminate' => false,
                        'options'       => [
                            'route'    => '/:intervenant/pec',
                            'defaults' => [
                                'controller' => Controller\ExportRhController::class,
                                'action'     => 'prise-en-charge',
                            ],
                        ],
                    ],
57
58
59
60
61
62
63
64
65
66
67
                    'ren'            => [
                        'type'          => 'Segment',
                        'may_terminate' => false,
                        'options'       => [
                            'route'    => '/:intervenant/ren',
                            'defaults' => [
                                'controller' => Controller\ExportRhController::class,
                                'action'     => 'renouvellement',
                            ],
                        ],
                    ],
68
69
70
71
72
73
74
75
76
77
78
                    'sync'           => [
                        'type'          => 'Segment',
                        'may_terminate' => false,
                        'options'       => [
                            'route'    => '/:intervenant/sync',
                            'defaults' => [
                                'controller' => Controller\ExportRhController::class,
                                'action'     => 'synchroniser',
                            ],
                        ],
                    ],
79
80
81
82
83
84
85
86
87
88
89
                    'administration' => [
                        'type'          => 'Literal',
                        'may_terminate' => true,
                        'options'       => [
                            'route'    => '/administration',
                            'defaults' => [
                                'controller' => Controller\AdministrationController::class,
                                'action'     => 'index',
                            ],
                        ],
                        'child_routes'  => [
Antony Le Courtes's avatar
Antony Le Courtes committed
90
91
                            'chercher-intervenant-rh' => [
                                'type'          => 'Literal',
92
                                'may_terminate' => false,
Antony Le Courtes's avatar
Antony Le Courtes committed
93
94
95
96
97
98
99
100
101
                                'options'       => [
                                    'route'    => '/chercher-intervenant-rh',
                                    'defaults' => [
                                        'controller' => Controller\AdministrationController::class,
                                        'action'     => 'chercher-intervenant-rh',
                                    ],
                                ],

                            ],
102
103
104
105
106
107
108
109

                        ],
                    ],
                ],
            ],
        ],
    ],

110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
    /* 'navigation'   => [
         'default' => [
             'home' => [
                 'pages' => [
                     'administration' => [
                         'pages' => [
                             'export-rh' => [
                                 'label'          => 'Export vers le SI RH',
                                 'icon'           => 'glyphicon glyphicon-list-alt',
                                 'route'          => 'intervenant/administration',
                                 'resource'       => PrivilegeController::getResourceId(Controller\AdministrationController::class, 'index'),
                                 'order'          => 82,
                                 'border - color' => '#111',
                                 'pages'          => [
                                     'chercher-intervenant-rh' => [
                                         'label'        => 'Rechercher un intervenant dans le SI RH',
                                         'icon'         => 'fa fa-graduation-cap',
                                         'route'        => 'intervenant/administration/chercher-intervenant-rh',
                                         'resource'     => PrivilegeController::getResourceId(Controller\AdministrationController::class, 'chercher-intervenant-rh'),
                                         'order'        => 800,
                                         'border-color' => '#BBCF55',
                                     ],
                                 ],
                             ],
                         ],
135

136
                     ],
137

138
139
140
141
                 ],
             ],
         ],
     ],*/
142
    'bjyauthorize' => [
143
        'guards'         => [
144
145
146
            PrivilegeController::class => [
                [
                    'controller' => Controller\AdministrationController::class,
Antony Le Courtes's avatar
Antony Le Courtes committed
147
                    'action'     => ['index', 'chercher-intervenant-rh'],
148
                    'privileges' => [Privileges::INTERVENANT_EXPORTER],
149
150
151
152
153
                    //'assertion'  => Assertion\AgrementAssertion::class,

                ],
                [
                    'controller' => Controller\ExportRhController::class,
154
                    'action'     => ['exporter', 'prise-en-charge', 'renouvellement', 'synchroniser'],
155
                    'privileges' => [Privileges::INTERVENANT_EXPORTER],
156
157
158
159
160
161
162
163
164
                    'assertion'  => ExportRhAssertion::class,

                ],
            ],
        ],
        'rule_providers' => [
            PrivilegeRuleProvider::class => [
                'allow' => [
                    [
165
                        'privileges' => [
166
                            Privileges::INTERVENANT_EXPORTER,
167
168
                            ExportRhAssertion::PRIV_CAN_INTERVENANT_EXPORT_RH,
                        ],
169
170
171
                        'resources'  => 'Intervenant',
                        'assertion'  => ExportRhAssertion::class,
                    ],
172
173
174
175
176
                ],
            ],
        ],
    ],

177

178
179
    'service_manager' => [
        'factories' => [
Antony Le Courtes's avatar
Antony Le Courtes committed
180
            Service\ExportRhService::class => Service\ExportRhServiceFactory::class,
181
            ExportRhAssertion::class       => \UnicaenAuth\Assertion\AssertionFactory::class,
Antony Le Courtes's avatar
Antony Le Courtes committed
182
            SihamConnecteur::class         => SihamConnecteurFactory::class,
183
184
185
186
187
188
189
190
191
        ],
    ],
    'view_helpers'    => [
        'factories' => [
        ],
    ],
    'controllers'     => [
        'factories' => [
            Controller\AdministrationController::class => Controller\AdministrationControllerFactory::class,
192
            Controller\ExportRhController::class       => Controller\ExportRhControllerFactory::class,
193
194
195
196
197
198
199
        ],
    ],
    'view_manager'    => [
        'template_path_stack' => [
            __DIR__ . '/../view',
        ],
    ],
200
201
202
203
204
    'form_elements'   => [
        'factories' => [
            ExportRhForm::class => ExportRhFormFactory::class,
        ],
    ],
205
];