Commit fa244284 authored by Thomas Hamel's avatar Thomas Hamel
Browse files

Ajout d'un privilège spécifique pour gérer les documents dans une préparation de soutenance

parent aef9bf98
Loading
Loading
Loading
Loading
+25 −0
Changes for doc/release-notes/v10/10.1.0/04_hdr.sql: 25 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,3 +4,28 @@ DELETE FROM unicaen_parametre_parametre
    USING unicaen_parametre_categorie
WHERE unicaen_parametre_parametre.categorie_id = unicaen_parametre_categorie.id
  AND unicaen_parametre_categorie.code = 'SOUTENANCE_HDR' and unicaen_parametre_parametre.code in ('DOC_CONFIDENTIALITE', 'DOC_DELEGATION_SIGNATURE', 'DOC_DELOCALISATION', 'DOC_REDACTION_ANGLAIS');

-- Ajout d'un privilège pour la gestion des documents d'une soutenance
INSERT INTO public.unicaen_privilege_privilege (categorie_id, code, libelle, ordre)
VALUES ((SELECT id FROM unicaen_privilege_categorie WHERE code = 'soutenance'), 'presoutenance-gerer-document', 'Gérer le téléchargement/téléversement d''un document dans la pré-soutenance', 410);

INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID)
with data(categ, priv) as (select 'soutenance', 'presoutenance-gerer-document')
select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID
from data
         join PROFIL on profil.ROLE_ID in (
                                           'ADMIN_TECH',
                                           'HDR_GEST',
                                           'BDD'
    )
         join unicaen_privilege_categorie cp on cp.CODE = data.categ
         join unicaen_privilege_privilege p on p.CATEGORIE_ID = cp.id and p.code = data.priv
where not exists (select * from PROFIL_PRIVILEGE where PRIVILEGE_ID = p.id and PROFIL_ID = profil.id);

insert into ROLE_PRIVILEGE (ROLE_ID, PRIVILEGE_ID)
select p2r.ROLE_ID, pp.PRIVILEGE_ID
from PROFIL_TO_ROLE p2r
         join profil pr on pr.id = p2r.PROFIL_ID
         join PROFIL_PRIVILEGE pp on pp.PROFIL_ID = pr.id
where not exists (select * from role_privilege where role_id = p2r.role_id and privilege_id = pp.privilege_id)
;
 No newline at end of file
+5 −1
Changes for module/Soutenance/config/others/justificatif.config.php: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use Soutenance\Form\Justificatif\JustificatifForm;
use Soutenance\Form\Justificatif\JustificatifFormFactory;
use Soutenance\Form\Justificatif\JustificatifHydratorFactory;
use Soutenance\Provider\Privilege\JustificatifPrivileges;
use Soutenance\Provider\Privilege\PresoutenancePrivileges;
use Soutenance\Provider\Privilege\PropositionPrivileges;
use Soutenance\Service\Justificatif\JustificatifService;
use Soutenance\Service\Justificatif\JustificatifServiceFactory;
@@ -73,7 +74,10 @@ return [
                    'action' => [
                        'ajouter-document-lie-soutenance',
                    ],
                    'privileges' => PropositionPrivileges::PROPOSITION_MODIFIER_GESTION,
                    'privileges' => [
                        PropositionPrivileges::PROPOSITION_MODIFIER_GESTION,
                        PresoutenancePrivileges::PRESOUTENANCE_GERER_DOCUMENT,
                    ]
                ],
            ],
        ],
+1 −0
Changes for module/Soutenance/config/others/presoutenanceHDR.config.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ return [
                            PresoutenancePrivileges::PRESOUTENANCE_ASSOCIATION_MEMBRE_INDIVIDU,
                            PresoutenancePrivileges::PRESOUTENANCE_DATE_RETOUR_MODIFICATION,
                            PresoutenancePrivileges::PRESOUTENANCE_PRESOUTENANCE_VISUALISATION,
                            PresoutenancePrivileges::PRESOUTENANCE_GERER_DOCUMENT,
                            HDRPrivileges::HDR_DONNER_RESULTAT,
                        ],
                        'resources' => ['HDR'],
+1 −0
Changes for module/Soutenance/config/others/presoutenanceThese.config.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ return [
                            PresoutenancePrivileges::PRESOUTENANCE_ASSOCIATION_MEMBRE_INDIVIDU,
                            PresoutenancePrivileges::PRESOUTENANCE_DATE_RETOUR_MODIFICATION,
                            PresoutenancePrivileges::PRESOUTENANCE_PRESOUTENANCE_VISUALISATION,
                            PresoutenancePrivileges::PRESOUTENANCE_GERER_DOCUMENT,
                            ThesePrivileges::THESE_DONNER_RESULTAT
                        ],
                        'resources' => ['These'],
+2 −0
Changes for module/Soutenance/src/Soutenance/Provider/Privilege/PresoutenancePrivileges.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,5 +10,7 @@ class PresoutenancePrivileges extends Privileges
    public const PRESOUTENANCE_DATE_RETOUR_MODIFICATION    = 'soutenance-modification-date-rapport';
    public const PRESOUTENANCE_PRESOUTENANCE_VISUALISATION = 'soutenance-presoutenance-visualisation';
    public const PRESOUTENANCE_SIMULER_REMONTEES = 'soutenance-simuler_remontees';
    public const PRESOUTENANCE_GERER_DOCUMENT = 'soutenance-presoutenance-gerer-document';


}
 No newline at end of file
Loading