Commit 8b90af53e52bbf4dc989300e4aa5c3c21e00eb09

Authored by Alexandre
1 parent ff92126b

Version: 2.4.2.12

Refactoriser gestion profil (ACL)

Demande (terminée):	https://projects.irap.omp.eu/issues/3765
									
Version majeure en cours (2.4):
https://projects.irap.omp.eu/versions/107

ROADMAP: https://projects.irap.omp.eu/projects/labinvent/roadmap
README-LABINVENT.md
... ... @@ -51,11 +51,11 @@ Logiciel testé et validé sur les configurations suivantes :
51 51 VERSION ACTUELLE
52 52  
53 53 Date: 03/06/2016
54   -Version: 2.4.2.11
  54 +Version: 2.4.2.12
55 55  
56   -Configuration mail auto management
  56 +Refactoriser gestion profil (ACL)
57 57  
58   -Demande (terminée): https://projects.irap.omp.eu/issues/3756
  58 +Demande (terminée): https://projects.irap.omp.eu/issues/3765
59 59  
60 60 Version majeure en cours (2.4): https://projects.irap.omp.eu/versions/107
61 61  
... ...
doc/userguide/ACL.doc 0 → 100755
No preview for this file type
doc/userguide/ACL.html 0 → 100755
... ... @@ -0,0 +1,102 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE html
  3 + PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
  4 +<html xmlns="http://www.w3.org/1999/xhtml"><!--This file was converted to xhtml by OpenOffice.org - see http://xml.openoffice.org/odf2xhtml for more info.--><head profile="http://dublincore.org/documents/dcmi-terms/"><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/><title xml:lang="en-US">- no title specified</title><meta name="DCTERMS.title" content="" xml:lang="en-US"/><meta name="DCTERMS.language" content="en-US" scheme="DCTERMS.RFC4646"/><meta name="DCTERMS.source" content="http://xml.openoffice.org/odf2xhtml"/><meta name="DCTERMS.creator" content="Etienne Pallier"/><meta name="DCTERMS.issued" content="2014-01-21T18:49:39" scheme="DCTERMS.W3CDTF"/><meta name="DCTERMS.contributor" content="Etienne Pallier"/><meta name="DCTERMS.modified" content="2014-01-21T22:40:01" scheme="DCTERMS.W3CDTF"/><meta name="DCTERMS.provenance" content="" xml:lang="en-US"/><meta name="DCTERMS.subject" content="," xml:lang="en-US"/><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en"/><link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en"/><link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en"/><link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en"/><style type="text/css">
  5 + @page { }
  6 + table { border-collapse:collapse; border-spacing:0; empty-cells:show }
  7 + td, th { vertical-align:top; font-size:12pt;}
  8 + h1, h2, h3, h4, h5, h6 { clear:both }
  9 + ol, ul { margin:0; padding:0;}
  10 + li { list-style: none; margin:0; padding:0;}
  11 + <!-- "li span.odfLiEnd" - IE 7 issue-->
  12 + li span. { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; }
  13 + span.footnodeNumber { padding-right:1em; }
  14 + span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; }
  15 + * { margin:0;}
  16 + .P1 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; }
  17 + .P10 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-style:normal; }
  18 + .P11 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-style:normal; font-weight:bold; }
  19 + .P12 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-weight:normal; }
  20 + .P13 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-weight:normal; }
  21 + .P14 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; }
  22 + .P15 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  23 + .P16 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  24 + .P17 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  25 + .P18 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  26 + .P19 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  27 + .P2 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; }
  28 + .P20 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; font-weight:bold; }
  29 + .P21 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-weight:bold; }
  30 + .P22 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-weight:bold; }
  31 + .P23 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; font-weight:normal; }
  32 + .P24 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-weight:normal; }
  33 + .P25 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-weight:normal; }
  34 + .P26 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-weight:normal; }
  35 + .P27 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; }
  36 + .P28 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; }
  37 + .P29 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; }
  38 + .P3 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; }
  39 + .P30 { font-size:10pt; font-family:Times New Roman; writing-mode:lr-tb; font-style:italic; font-weight:bold; }
  40 + .P31 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; }
  41 + .P32 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; font-weight:bold; }
  42 + .P33 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  43 + .P34 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-style:normal; text-shadow:none; text-decoration:none ! important; font-weight:normal; }
  44 + .P35 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; margin-left:1.251cm; margin-right:0cm; text-indent:0cm; }
  45 + .P36 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; margin-left:1.251cm; margin-right:0cm; text-indent:0cm; font-weight:normal; }
  46 + .P37 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; margin-left:1.251cm; margin-right:0cm; text-indent:0cm; font-weight:normal; }
  47 + .P38 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; margin-left:1.251cm; margin-right:0cm; text-indent:0cm; }
  48 + .P39 { font-size:12pt; font-family:Times, Times New Roman; writing-mode:lr-tb; margin-left:1.251cm; margin-right:0cm; text-indent:0cm; }
  49 + .P4 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; font-weight:bold; }
  50 + .P40 { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-weight:bold; }
  51 + .P5 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-weight:bold; }
  52 + .P6 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-style:italic; font-weight:bold; }
  53 + .P7 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-style:italic; font-weight:bold; }
  54 + .P8 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:left ! important; font-style:italic; font-weight:normal; }
  55 + .P9 { font-size:9pt; font-family:Times New Roman; writing-mode:lr-tb; text-align:center ! important; font-style:italic; font-weight:normal; }
  56 + .Standard { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  57 + .Table_20_Contents { font-size:12pt; font-family:Times New Roman; writing-mode:lr-tb; }
  58 + .Tableau1 { width:26.435cm; margin-left:-0.078cm; writing-mode:lr-tb; }
  59 + .Tableau1_A1 { vertical-align:top; background-color:#cccccc; padding:0.097cm; border-left-width:0.0133cm; border-left-style:solid; border-left-color:#000000; border-right-style:none; border-top-width:0.0133cm; border-top-style:solid; border-top-color:#000000; border-bottom-width:0.0133cm; border-bottom-style:solid; border-bottom-color:#000000; writing-mode:lr-tb; }
  60 + .Tableau1_A2 { vertical-align:top; background-color:#e6e6e6; padding:0.097cm; border-left-width:0.0133cm; border-left-style:solid; border-left-color:#000000; border-right-style:none; border-top-style:none; border-bottom-width:0.0133cm; border-bottom-style:solid; border-bottom-color:#000000; writing-mode:lr-tb; }
  61 + .Tableau1_B2 { vertical-align:top; padding:0.097cm; border-left-width:0.0133cm; border-left-style:solid; border-left-color:#000000; border-right-style:none; border-top-style:none; border-bottom-width:0.0133cm; border-bottom-style:solid; border-bottom-color:#000000; writing-mode:lr-tb; }
  62 + .Tableau1_L1 { vertical-align:top; background-color:#cccccc; padding:0.097cm; border-width:0.0133cm; border-style:solid; border-color:#000000; writing-mode:lr-tb; }
  63 + .Tableau1_L2 { vertical-align:top; padding:0.097cm; border-left-width:0.0133cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.0133cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; border-bottom-width:0.0133cm; border-bottom-style:solid; border-bottom-color:#000000; writing-mode:lr-tb; }
  64 + .Tableau1_A { width:1.937cm; }
  65 + .Tableau1_B { width:2.402cm; }
  66 + .Tableau1_C { width:2.459cm; }
  67 + .Tableau1_D { width:2.828cm; }
  68 + .Tableau1_E { width:1.836cm; }
  69 + .Tableau1_F { width:1.734cm; }
  70 + .Tableau1_G { width:2.066cm; }
  71 + .Tableau1_H { width:2.766cm; }
  72 + .Tableau1_I { width:2.727cm; }
  73 + .Tableau1_J { width:1.487cm; }
  74 + .Tableau1_K { width:1.445cm; }
  75 + .Tableau1_L { width:2.75cm; }
  76 + .T1 { font-size:12pt; }
  77 + .T11 { font-size:9pt; }
  78 + .T12 { font-size:9pt; font-weight:bold; }
  79 + .T13 { font-size:9pt; font-style:italic; font-weight:bold; }
  80 + .T14 { font-size:9pt; font-style:italic; font-weight:normal; }
  81 + .T17 { font-size:9pt; font-weight:normal; }
  82 + .T19 { font-size:9pt; }
  83 + .T2 { font-size:12pt; font-weight:bold; }
  84 + .T20 { font-size:9pt; }
  85 + .T21 { font-size:12pt; font-style:normal; text-shadow:none; text-decoration:none ! important; font-weight:normal; }
  86 + .T3 { font-size:12pt; font-weight:bold; }
  87 + .T4 { font-size:12pt; font-weight:normal; }
  88 + .T5 { font-size:12pt; font-weight:normal; }
  89 + .T6 { font-size:12pt; font-style:italic; font-weight:bold; }
  90 + .T7 { font-size:12pt; }
  91 + .T8 { font-weight:normal; }
  92 + .WW8Num1z0 { font-family:Symbol; }
  93 + .WW8Num2z0 { font-family:Symbol; }
  94 + .WW8Num3z0 { font-family:Times New Roman; }
  95 + .WW8Num4z0 { font-family:Symbol; }
  96 + .WW8Num5z0 { font-family:Symbol; }
  97 + .WW8Num6z0 { font-size:12pt; }
  98 + .WW8Num8z0 { font-family:Symbol; font-size:9pt; font-weight:normal; }
  99 + .WW8Num9z0 { font-size:9pt; }
  100 + <!-- ODF styles with no properties representable as CSS -->
  101 + .Tableau1.1 .WW8Num7z0 .WW8Num8z1 .WW8Num8z2 .WW8Num8z3 .WW8Num8z4 .WW8Num8z5 .WW8Num8z6 .WW8Num8z7 .WW8Num8z8 .WW8Num9z1 .WW8Num9z2 .WW8Num9z3 .WW8Num9z4 .WW8Num9z5 .WW8Num9z6 .WW8Num9z7 .WW8Num9z8 { }
  102 + </style></head><body dir="ltr" style="max-width:29.7cm;margin-top:1cm; margin-bottom:1cm; margin-left:1cm; margin-right:1.45cm; "><p class="P40">ACL (Access Control List)</p><p class="P20"> </p><p class="P20"> </p><p class="P20"> </p><p class="P20">I – Cycle de vie du statut du matériel</p><p class="P20"> </p><p class="Standard"><span class="T2">Créer</span><span class="T4"> un matériel ==</span><span class="T5">&gt; passe alors en statut </span><span class="T3">CREATED ==&gt; </span><span class="T6">peut alors être éventuellement supprimé (mais ne pourra plus être supprimé ensuite)</span></p><p class="Standard"><span class="T3">Valider</span><span class="T5"> un matériel CREATED ==&gt; passe alors en statut </span><span class="T3">VALIDATED </span><span class="T5">(admin only)</span></p><p class="P29"><span class="T3">Demander l'Archivage</span><span class="T5"> d'un materiel VALIDATED ==&gt; passe alors en statut </span><span class="T3">TOBEARCHIVED</span><span class="T5"> (resp et admin only)</span></p><p class="P29"><span class="T3">Sortir</span><span class="T5"> de l'inventaire (Valider une demande d'archivage d'un matériel TOBEARCHIVED) ==&gt; statut </span><span class="T3">ARCHIVED</span><span class="T5"> (admin only)</span></p><p class="P29"><span class="T3">Désarchiver</span><span class="T5"> un matériel ==&gt; repasse de TOBEARCHIVED ou ARCHIVED à </span><span class="T3">VALIDATED</span><span class="T5"> (admin only) </span></p><p class="P29"> </p><p class="P24">En résumé : TODO (schéma)</p><p class="P29"> </p><p class="P22">CREATED ==&gt;  VALIDATED ==&gt;  TOBEARCHIVED ==&gt;  ARCHIVED</p><p class="P29"><span class="T3">     I                        /\                        I                                I</span></p><p class="P29"><span class="T3">    V                                    I ------------------------        I ---------------------------------        I (adminplus only)</span></p><p class="P22">DELETED</p><p class="P21"> </p><p class="P21"> </p><p class="P21"> </p><p class="P20">II - Droits des utilisateurs selon leur profil</p><p class="P20"> </p><p class="P20">A – Globalement (principes généraux)</p><p class="P20"> </p><p class="P23">Un utilisateur non logué ne doit RIEN pouvoir faire. Seulement se loguer, c'est tout. Il n'a accès qu'à la page d'accueil (de login).</p><p class="P23">Une fois logué, un utilisateur a des droits différents selon son profil, globalement :</p><p class="P35"><span class="T4">- un </span><span class="T2">USER</span><span class="T4"> ne peut que créer un matériel, un suivi, ou un emprunt, consulter, et modifier (uniquement ce qu'il a créé lui-même)</span></p><p class="P35"><span class="T4">- un </span><span class="T2">RESPONSABLE</span><span class="T4"> a tous les droits sauf accès à certains champs et certaines vues réservées à l'administration (ADMIN). Il ne peut pas non plus archiver un matériel, mais seulement demander l'archivage (comme un USER)</span></p><p class="P35"><span class="T4">- un </span><span class="T2">ADMIN</span><span class="T4">(istratif) a tous les droits (y-compris champs réservés à l'administration)</span></p><p class="P35"><span class="T4">- un </span><span class="T2">ADMINPLUS</span><span class="T4"> (administratif Plus) a tous les droits de ADMIN et en plus il peut modifier un matériel quelque soit son statut (y-compris TOBEARCHIVED et ARCHIVED), notamment il peut modifier le statut du matériel (pour le rétrograder)</span></p><p class="P35"><span class="T4">- un </span><span class="T2">SUPERADMIN</span><span class="T4"> a tous les droits : ceux d'ADMINPLUS et certains droits supplémentaires pour lui permettre des corrections d'erreur et la configuration de l'application (notamment l'administration des utilisateurs...)</span></p><p class="P36"> </p><p class="Standard"><span class="T4">Concernant les informations internes permettant de savoir </span><span class="T2">qui a fait quoi</span><span class="T4"> (mises en place en février 2014), elles ne sont bien sûr pas modifiables puisque gérées automatiquement par le système, mais sont visibles par tous excepté le profil USER.</span></p><p class="P20"> </p><p class="P20"> </p><p class="P20">B - sur la table MATERIEL</p><p class="P30"> </p><table border="0" cellspacing="0" cellpadding="0" class="Tableau1"><colgroup><col width="85"/><col width="105"/><col width="107"/><col width="124"/><col width="80"/><col width="76"/><col width="90"/><col width="121"/><col width="119"/><col width="65"/><col width="63"/><col width="120"/></colgroup><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A1"><p class="P2"> </p></td><td style="text-align:left;width:2.402cm; " class="Tableau1_A1"><p class="P5">Read (un seul ou  une liste)</p><p class="P5"> </p><p class="P5">(view ou index)</p></td><td style="text-align:left;width:2.459cm; " class="Tableau1_A1"><p class="P5">Create (1)</p><p class="P5"> </p><p class="P5">(add)</p></td><td style="text-align:left;width:2.828cm; " class="Tableau1_A1"><p class="P5">Update (1)</p><p class="P5"> </p><p class="P5">(edit)</p></td><td style="text-align:left;width:1.836cm; " class="Tableau1_A1"><p class="P5">Delete</p><p class="P5"> </p><p class="P5">(delete)</p></td><td style="text-align:left;width:1.734cm; " class="Tableau1_A1"><p class="P5">Valider</p><p class="P5"> </p><p class="P5">(statusValidated)</p></td><td style="text-align:left;width:2.066cm; " class="Tableau1_A1"><p class="P5">Demander archivage</p><p class="P5"> </p><p class="P5">(statusToBeArchived)</p></td><td style="text-align:left;width:2.766cm; " class="Tableau1_A1"><p class="P5">Sortir de l'inventaire</p><p class="P5"> </p><p class="P1"><span class="T12"> (statusArchived)</span></p></td><td style="text-align:left;width:2.727cm; " class="Tableau1_A1"><p class="P5">Désarchiver (2)</p></td><td style="text-align:left;width:1.487cm; " class="Tableau1_A1"><p class="P5">Exporter</p><p class="P5"> </p><p class="P5">(csv)</p><p class="P5"> </p></td><td style="text-align:left;width:1.445cm; " class="Tableau1_A1"><p class="P5">Montée de statut groupée (3)</p><p class="P5"> </p><p class="P5">(execActions)</p></td><td style="text-align:left;width:2.75cm; " class="Tableau1_L1"><p class="P5">Edition (4)</p><p class="P5"> </p><p class="P5">DOCUMENTS</p><p class="P5">entrée &amp; sortie</p></td></tr><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A2"><p class="P6">ALL (TOUS)</p><p class="P6"> </p><p class="P11">(droits par défaut)</p></td><td style="text-align:left;width:2.402cm; " class="Tableau1_B2"><p class="P11">Y</p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P14"><span class="T13">champs exclus (cachés) :</span><span class="T14"> données admin</span></p></td><td style="text-align:left;width:2.459cm; " class="Tableau1_B2"><p class="P11">Y</p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P8"> </p><p class="P14"><span class="T13">champs exclus (cachés) </span><span class="T14">:</span></p><p class="P8">données admin + statut + créateur + étiquette</p></td><td style="text-align:left;width:2.828cm; " class="Tableau1_B2"><p class="P11">Y</p><p class="P9">ssi</p><p class="P12">CREATED (tous les champs) </p><p class="P9">ou </p><p class="P8">VALIDATED (certains champs seulement)</p><p class="P8"> </p><p class="P14"><span class="T13">champs exclus (cachés)</span><span class="T14"> :</span></p><p class="P8">données admin + statut + créateur + étiquette</p></td><td style="text-align:left;width:1.836cm; " class="Tableau1_B2"><p class="P11">Y</p><p class="P6">ssi CREATED</p></td><td style="text-align:left;width:1.734cm; " class="Tableau1_B2"><p class="P11">N</p><p class="P6"> </p><p class="P6">(resp+)</p></td><td style="text-align:left;width:2.066cm; " class="Tableau1_B2"><p class="P11">N</p><p class="P6"> </p><p class="P6">(resp+)</p></td><td style="text-align:left;width:2.766cm; " class="Tableau1_B2"><p class="P11">N</p><p class="P6"> </p><p class="P6">(admin+)</p></td><td style="text-align:left;width:2.727cm; " class="Tableau1_B2"><p class="P11">N</p><p class="P6"> </p><p class="P6">(adminplus+)</p></td><td style="text-align:left;width:1.487cm; " class="Tableau1_B2"><p class="P11">N</p><p class="P11"> </p><p class="P6">(resp+)</p></td><td style="text-align:left;width:1.445cm; " class="Tableau1_B2"><p class="P11">N</p><p class="P11"> </p><p class="P6">(admin+)</p></td><td style="text-align:left;width:2.75cm; " class="Tableau1_L2"><p class="P11">N</p><p class="P11"> </p><p class="P6">(admin+)</p></td></tr><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A2"><p class="Table_20_Contents"><span class="T12">User </span><span class="T17">(quelconque)</span></p></td><td colspan="2" style="text-align:left;width:2.402cm; " class="Tableau1_B2"><p class="P3">idem ALL</p></td><td colspan="2" style="text-align:left;width:2.828cm; " class="Tableau1_B2"><p class="P13">idem ALL</p><p class="P1"><span class="T17">ssi </span><span class="T12">créateur</span></p></td><td colspan="7" style="text-align:left;width:1.734cm; " class="Tableau1_L2"><p class="P3">idem ALL</p></td></tr><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A2"><p class="P4">Responsable</p></td><td style="text-align:left;width:2.402cm; " class="Tableau1_B2"><p class="P3">idem ALL</p></td><td colspan="2" style="text-align:left;width:2.459cm; " class="Tableau1_B2"><p class="P3">idem ALL</p><p class="P3">(+ créateur + étiquette)</p></td><td style="text-align:left;width:1.836cm; " class="Tableau1_B2"><p class="P3">idem ALL</p></td><td style="text-align:left;width:1.734cm; " class="Tableau1_B2"><p class="P3">Y</p><p class="P6">ssi</p><p class="P6">CREATED</p><p class="P3"> </p></td><td style="text-align:left;width:2.066cm; " class="Tableau1_B2"><p class="P3">Y</p><p class="P6">ssi</p><p class="P6">VALIDATED</p></td><td colspan="2" style="text-align:left;width:2.766cm; " class="Tableau1_B2"><p class="P3">idem ALL</p></td><td style="text-align:left;width:1.487cm; " class="Tableau1_B2"><p class="P3">Y</p></td><td colspan="2" style="text-align:left;width:1.445cm; " class="Tableau1_L2"><p class="P3">idem ALL</p></td></tr><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A2"><p class="P4">Admin</p></td><td colspan="3" style="text-align:left;width:2.402cm; " class="Tableau1_B2"><p class="P3">(idem Responsable +  données admin)</p></td><td colspan="3" style="text-align:left;width:1.836cm; " class="Tableau1_B2"><p class="P3">idem Responsable</p></td><td style="text-align:left;width:2.766cm; " class="Tableau1_B2"><p class="P3">Y</p><p class="P6">ssi</p><p class="P6">TOBEARCHIVED</p></td><td colspan="2" style="text-align:left;width:2.727cm; " class="Tableau1_B2"><p class="P3">idem Responsable</p></td><td style="text-align:left;width:1.445cm; " class="Tableau1_B2"><p class="P3">Y</p></td><td style="text-align:left;width:2.75cm; " class="Tableau1_L2"><p class="P3">Y</p><p class="P7">- admission : </p><p class="P7">ssi VALIDATED</p><p class="P7">- sortie : </p><p class="P7">ssi TOBEARCHIVED ou ARCHIVED</p></td></tr><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A2"><p class="P4">Adminplus</p></td><td colspan="2" style="text-align:left;width:2.402cm; " class="Tableau1_B2"><p class="P3">idem Admin</p></td><td style="text-align:left;width:2.828cm; " class="Tableau1_B2"><p class="P3">idem Admin</p><p class="P1"><span class="T11">(</span><span class="T12">tous les statuts</span><span class="T11">)</span></p><p class="P1"><span class="T11">(+ champ </span><span class="T12">statut</span><span class="T11">)</span></p><p class="P1"><span class="T11">TOBEARCHIVED ou ARCHIVED: </span><span class="T12">seulement le statut</span></p></td><td colspan="4" style="text-align:left;width:1.836cm; " class="Tableau1_B2"><p class="P3">idem Admin</p></td><td style="text-align:left;width:2.727cm; " class="Tableau1_B2"><p class="P3">Y</p><p class="P6">ssi</p><p class="P6">ARCHIVED ou</p><p class="P6">TOBEARCHIVED</p></td><td colspan="3" style="text-align:left;width:1.487cm; " class="Tableau1_L2"><p class="P3">idem Admin</p></td></tr><tr class="Tableau11"><td style="text-align:left;width:1.937cm; " class="Tableau1_A2"><p class="P4">Superadmin</p></td><td colspan="11" style="text-align:left;width:2.402cm; " class="Tableau1_L2"><p class="P3">Y</p><p class="P3">idem Adminplus</p><p class="P10"><span class="T8">(+</span><span class="T8">num_inventaire_old)</span></p></td></tr></table><p class="P15"> </p><p class="P30">Par défaut, le superadmin a TOUS les droits</p><p class="P30"> </p><p class="Standard"><span class="T12">Conventions d'écriture </span><span class="T11">: </span></p><p class="P35"><span class="T11">- r</span><span class="T12">esp+</span><span class="T11"> = possible pour un </span><span class="T12">Responsable et plus </span><span class="T17">(responsable, admin, adminplus, et superadmin)</span></p><p class="P35"><span class="T17">- </span><span class="T12">admin+</span><span class="T11"> = possible pour un </span><span class="T12">Admin</span><span class="T11"> </span><span class="T12">et plus </span><span class="T17">(admin, adminplus, et superadmin)</span></p><p class="P37">- ...</p><p class="P38"> </p><p class="Standard"><span class="T12">Notes </span><span class="T11">:</span></p><p class="P31"> </p><ol><li><p class="P33" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0cm">(1)</span><span class="T12">Droits en modification (edit) </span><span class="T11">:</span><span class="odfLiEnd"/> </p></li></ol><p class="P38">- Un simple « user » ne doit pas pouvoir modifier le responsable, ni le statut, ni l'étiquette, ni les données admin d'un matériel (en mode Création comme Modification)</p><p class="P38">- Un  «responsable » ne doit pas pouvoir modifier le statut, ni les données admin d'un matériel (en mode Création comme Modification)</p><p class="P38">- Les données admin ne sont accessibles qu'aux profils admin+</p><p class="P35"><span class="T11">- Le champ "</span><span class="T12">status</span><span class="T11">" n'est modifiable que par les profils adminplus+</span></p><p class="P35"><span class="T11">- Tout le monde peut modifier un matériel </span><span class="T12">VALIDATED </span><span class="T17">(</span><span class="T12">user </span><span class="T11">ne peut modifier que ses matériels),</span></p><p class="P35"><span class="T11">MAIS </span><span class="T12">UNIQUEMENT certains champs</span><span class="T11"> </span><span class="T19">(</span><span class="T20">designation, sous_categorie, materiel_administratif, materiel_technique, description, etiquette, lieu_stockage, lieu_detail, numero_serie, groupes_thematique, groupes_metier)</span><span class="T19"> </span><span class="T11"><br/>- Seuls les profils </span><span class="T12">adminplus+</span><span class="T11"> peuvent modifier un matériel </span><span class="T12">TOBEARCHIVED, ou ARCHIVED </span><span class="T17">mais</span><span class="T11"> </span><span class="T12">UNIQUEMENT le champ "status" </span><span class="T11">(pour pouvoir rétrograder à CREATED ou VALIDATED)</span></p><p class="P35"><span class="T11">- Le seul moyen de modifier COMPLÈTEMENT un matériel VALIDATED, TOBEARCHIVED, ou ARCHIVED, <br/>c'est de </span><span class="T12">changer son statut</span><span class="T11">, en </span><span class="T17">le rétrogradant à </span><span class="T11">CREATED (seuls les profils adminplus+ peuvent le faire)</span></p><p class="P38"> </p><ol><li><p class="P33" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0cm">(2)</span><span class="T12">Désarchiver </span><span class="T11">: consiste à rétrograder un matériel ARCHIVED ou TOBEARCHIVED dans le statut VALIDATED ou CREATED (adminplus+ only) ; utile en cas d'erreur</span><span class="odfLiEnd"/> </p></li></ol><p class="P31"> </p><ol><li><p class="P33" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0cm">(3)</span><span class="T12">Montée de statut groupée : </span><span class="T17">seul ADMIN peut (exporter tout ou partie de la liste des matériels, et) </span><span class="T12">augmenter (+1) le statut d'un groupe de matériels</span><span class="T17">, depuis la vue « index » (vue spéciale pour ADMIN, avec des cases à cocher et boutons pour exporter ou faire évoluer le statut)</span><span class="odfLiEnd"/> </p></li></ol><p class="P31"> </p><ol><li><p class="P32" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0cm">(4)</span>Edition des documents :<span class="odfLiEnd"/> </p></li></ol><p class="P38">Admission : quand on "VALIDE" un matériel "CREATED", le statut passe en VALIDATED et le document d'admission est automatiquement édité</p><p class="P38">Sortie : quand on "ARCHIVE" un document "TOBEARCHIVED", le statut passe en ARCHIVED et le document de sortie est automatiquement édité</p><p class="P38">De plus :</p><p class="P38">- Bouton "Doc admission" affiché à partir du statut "VALIDATED"</p><p class="P38">- Bouton "Doc Sortie" affiché à partir du statut TOBEARCHIVED (et donc aussi pour ARCHIVED)</p><p class="P38">Enfin, Le doc de sortie doit être couplée avec la liste des matériels a archiver (TOBEARCHIVED) quand il y a une demande de sortie.</p><p class="P38"> </p><p class="P39"> </p><p class="P20">C - sur les différentes VUES liées au matériel</p><p class="Standard"> </p><p class="Standard"><span class="T2">Page accueil </span><span class="T1">:</span></p><p class="P15"><span> Administration voit un menu avec 2 options :</span></p><ul><li><ul><li><ul><li><p class="P16" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0cm">.</span>« Voir les matériels à valider »<span class="odfLiEnd"/> </p></li><li><p class="P16" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0cm">.</span>« Voir les matériels à sortir de l'inventaire »<span class="odfLiEnd"/> </p></li></ul></li></ul></li></ul><p class="P15"> </p><p class="P20">Page Outils :</p><p class="P15">User n'a pas accès à cette page</p><p class="P15">Les autres ont quelques options</p><p class="P15">superadmin a ces options en plus :</p><ul><li><p class="P17" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0cm">.</span>Gérer les utilisateurs<span class="odfLiEnd"/> </p></li><li><p class="P17" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0cm">.</span>Passer en mode debug<span class="odfLiEnd"/> </p></li></ul><p class="P15"> </p><p class="Standard"><span class="T2">Vue materiel/index (liste) </span><span class="T1">: limiter aux </span><span class="T2">matériels actifs</span><span class="T1"> (non archivés)</span></p><ul><li><ul><li><p class="P18" style="margin-left:0cm;"><span class="WW8Num1z0" style="display:block;float:left;min-width:0cm">.</span>Administration voit des boutons pour filtrer par « tous », « à valider », « validés », « à sortir », « archivés »<span class="odfLiEnd"/> </p></li></ul></li></ul><p class="P15"> </p><p class="Standard"><span class="T2">Vue materiel/find </span><span class="T1">: limiter aux </span><span class="T2">matériels actifs</span><span class="T1"> (non archivés)</span></p><p class="P15"><span> Seul le profil Administration voit TOUS les matériels (y-compris archivés)</span></p><p class="P15"> </p><p class="Standard"><span class="T2">Vue materiel/view </span><span class="T1">:</span></p><p class="P15"><span> boutons « Imprimer Etiquettes » : admin et resp only</span></p><p class="P15"> </p><p class="Standard"><span class="T2">Vue materiel/edit </span><span class="T1">:</span></p><ul><li><p class="P19" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0cm">.</span>Etiquette O/N (administratif only)<span class="odfLiEnd"/> </p></li><li><p class="P19" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0cm">.</span>Statut (superadmin only)<span class="odfLiEnd"/> </p></li><li><p class="P19" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0cm">.</span>Informations administratives (administratif only)<span class="odfLiEnd"/> </p></li><li><p class="P19" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0cm">.</span>Numero ancien inventaire (superadmin only)<span class="odfLiEnd"/> </p></li></ul><p class="P15"> </p><p class="P15"> </p><p class="P20">D - sur un SUIVI et un EMPRUNT</p><p class="P20"> </p><ul><li><p class="P27" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0cm">.</span>Dans tous les cas, on ne doit pas pouvoir emprunter ou suivre un materiel non validé (CREATED)<span class="odfLiEnd"/> </p></li><li><p class="P27" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0cm">.</span>User a les droits C, R, U (si créateur), D (si créateur)<span class="odfLiEnd"/> </p></li><li><p class="P27" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0cm">.</span>Resp+ a les droits C, R, U, D<span class="odfLiEnd"/> </p></li></ul><p class="P29"><span class="T7">Un USER peut modifier/supprimer un emprunt dont il est soit le créateur soit l'emprunteur</span><span class="T21">.</span></p><p class="P34">Un USER qui créé un emprunt ne doit pas pouvoir changer le nom de l'emprunteur (par défaut, c'est lui). Ainsi, il pourra modifier/supprimer cette fiche au besoin plus tard. Par défaut donc, pour un user, emprunt.emprunteur=creator, materiel.responsable=creator</p><p class="P28"> </p><p class="P28"> </p><p class="P22">E - sur les UTILISATEURS</p><p class="P29"><span class="T5">Par défaut, superadmin a tous les droits, et les autres profils n'ont que le droit de lecture (</span><span class="T3">view </span><span class="T5">et </span><span class="T3">index</span><span class="T5">)</span></p><p class="P24"> </p><p class="P24"> </p><p class="P22">F - sur tous les autres objets métiers</p><p class="P24">Voici la liste des autres objets métiers :</p><ul><li><p class="P25" style="margin-left:0cm;"><span class="WW8Num7z0" style="display:block;float:left;min-width:0cm">.</span>Catégories (et domaines et sous-catégories)<span class="odfLiEnd"/> </p></li></ul><ul><li><p class="P26" style="margin-left:0cm;"><span class="WW8Num6z0" style="display:block;float:left;min-width:0cm">.</span>Groupes thématiques<span class="odfLiEnd"/> </p></li><li><p class="P26" style="margin-left:0cm;"><span class="WW8Num6z0" style="display:block;float:left;min-width:0cm">.</span>Groupes métiers<span class="odfLiEnd"/> </p></li></ul><p class="P29"><span class="T5">Par défaut, pour tous ces objets, superadmin a tous les droits, admin a tous les droits sauf « delete », et les autres profils n'ont que le droit de lecture (</span><span class="T3">view </span><span class="T5">et </span><span class="T3">index</span><span class="T5">)</span></p></body></html>
0 103 \ No newline at end of file
... ...
doc/userguide/ACL.pdf 0 → 100755
No preview for this file type
doc/userguide/IRAP-INV-SpecifBDMateriels_V1.2.docx 0 → 100755
No preview for this file type
doc/userguide/Inventirap_AdministrationUser_Manual.docx 0 → 100755
No preview for this file type
doc/userguide/Inventirap_User_Manual.docx 0 → 100755
No preview for this file type
src/Controller/AppController.php
... ... @@ -87,6 +87,38 @@ class AppController extends Controller
87 87 return false;
88 88 }
89 89  
  90 + function userHasRole($roleDefine) {
  91 +
  92 + $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first();
  93 + $role = TableRegistry::get('Users')->find()->where(['username' => $this->LdapAuth->user($configuration->authentificationType_ldap)[0]])->first()['role'];
  94 +
  95 + $isAuthorized = false;
  96 +
  97 + switch($roleDefine) {
  98 + case 'Super Administrateur':
  99 + if(in_array($role, ['Super Administrateur'])) $isAuthorized = true;
  100 + break;
  101 +
  102 + case 'Administration Plus':
  103 + if(in_array($role, ['Administration Plus', 'Super Administrateur'])) $isAuthorized = true;
  104 + break;
  105 +
  106 + case 'Administration':
  107 + if(in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) $isAuthorized = true;
  108 + break;
  109 +
  110 + case 'Responsable':
  111 + if(in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) $isAuthorized = true;
  112 + break;
  113 +
  114 + case 'Utilisateur':
  115 + if(in_array($role, ['Utilisateur', 'Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) $isAuthorized = true;
  116 + break;
  117 + }
  118 +
  119 + return $isAuthorized;
  120 + }
  121 +
90 122  
91 123 /**
92 124 * {@inheritDoc}
... ... @@ -139,8 +171,6 @@ class AppController extends Controller
139 171 $this->set('displayElement', $displayElement);
140 172 }
141 173  
142   -
143   -
144 174 // "le materiel", "le suivi"...
145 175 protected function getArticle() {
146 176 return "Le ";
... ... @@ -155,7 +185,7 @@ class AppController extends Controller
155 185 public function sendEmailToManagementWith($subject, $message) {
156 186  
157 187 //Desactivation de l'envoi des mails pour le moment
158   - if (true) {
  188 + if (false) {
159 189 //$configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first();
160 190 //$to = $configuration->emailGuest2;
161 191  
... ... @@ -172,7 +202,7 @@ class AppController extends Controller
172 202 public function sendEmailToManagement($idObj = null) {
173 203  
174 204 //Desactivation de l'envoi des mails pour le moment
175   - if (true) {
  205 + if (false) {
176 206 $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first();
177 207  
178 208 $userAuth = $this->LdapAuth->user($configuration->authentificationType_ldap)[0];
... ...
src/Controller/CategoriesController.php
... ... @@ -37,7 +37,7 @@ class CategoriesController extends AppController
37 37 return true;
38 38 }
39 39  
40   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  40 + if($this->userHasRole('Administration')) {
41 41 if($action != 'delete') return true;
42 42 }
43 43  
... ...
src/Controller/DocumentsController.php
... ... @@ -27,7 +27,7 @@ class DocumentsController extends AppController
27 27 $action = $this->request->params['action'];
28 28  
29 29 if (in_array($action, ['admission', 'sortie'])) {
30   - if (in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) {
  30 + if ($this->userHasRole('Administration')) {
31 31 return true;
32 32 }
33 33 }
... ...
src/Controller/EmpruntsController.php
... ... @@ -30,7 +30,7 @@ class EmpruntsController extends AppController
30 30  
31 31 $action = $this->request->params['action'];
32 32  
33   - if(in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) return true;
  33 + if($this->userHasRole('Responsable')) return true;
34 34  
35 35 //Pour un "utilisateur"
36 36 if (in_array($action, ['edit', 'delete'])) {
... ...
src/Controller/GroupesMetiersController.php
... ... @@ -32,7 +32,7 @@ class GroupesMetiersController extends AppController
32 32 return true;
33 33 }
34 34  
35   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  35 + if($this->userHasRole('Administration')) {
36 36 if($action != 'delete') return true;
37 37 }
38 38  
... ...
src/Controller/GroupesThematiquesController.php
... ... @@ -33,7 +33,7 @@ class GroupesThematiquesController extends AppController
33 33 return true;
34 34 }
35 35  
36   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  36 + if($this->userHasRole('Administration')) {
37 37 if($action != 'delete') return true;
38 38 }
39 39  
... ...
src/Controller/MaterielsController.php
... ... @@ -32,70 +32,70 @@ class MaterielsController extends AppController
32 32 $action = $this->request->params['action'];
33 33  
34 34  
35   - if (in_array($action, ['edit'])) {
  35 + if ($action == 'edit') {
36 36 $id = (int)$this->request->params['pass'][0];
37 37  
38 38 if($this->isCreated($id) || $this->isValidated($id)) {
39 39 if ($role == 'Utilisateur' && $this->isOwnedBy($id, $user['givenname'][0].' '.$user['sn'][0])) {
40 40 return true;
41 41 }
42   - else if (in_array($role, ['Responsable', 'Administration'])) {
  42 + else if ($this->userHasRole('Responsable')) {
43 43 return true;
44 44 }
45 45 }
46   - if(in_array($role, ['Administration Plus', 'Super Administrateur'])) {
  46 + if($this->userHasRole('Administration Plus')) {
47 47 return true;
48 48 }
49 49 }
50 50  
51   - if (in_array($action, ['delete'])) {
  51 + if ($action == 'delete') {
52 52 $id = (int)$this->request->params['pass'][0];
53 53  
54 54 if($this->isCreated($id)) {
55 55 if ($role == 'Utilisateur' && $this->isOwnedBy($id, $user['givenname'][0].' '.$user['sn'][0])) {
56 56 return true;
57 57 }
58   - else if (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) {
  58 + else if ($this->userHasRole('Responsable')) {
59 59 return true;
60 60 }
61 61 }
62 62 }
63 63  
64   - if (in_array($action, ['statusValidated'])) {
  64 + if ($action == 'statusValidated') {
65 65 $id = (int)$this->request->params['pass'][0];
66   - if (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) {
  66 + if ($this->userHasRole('Responsable')) {
67 67 if($this->isCreated($id)) {
68 68 return true;
69 69 }
70 70 }
71 71 }
72 72  
73   - if (in_array($action, ['statusToBeArchived'])) {
  73 + if ($action == 'statusToBeArchived') {
74 74 $id = (int)$this->request->params['pass'][0];
75   - if (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) {
  75 + if ($this->userHasRole('Responsable')) {
76 76 if($this->isValidated($id)) {
77 77 return true;
78 78 }
79 79 }
80 80 }
81 81  
82   - if (in_array($action, ['statusArchived'])) {
  82 + if ($action == 'statusArchived') {
83 83 $id = (int)$this->request->params['pass'][0];
84   - if (in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) {
  84 + if ($this->userHasRole('Administration')) {
85 85 if($this->isToBeArchived($id)) {
86 86 return true;
87 87 }
88 88 }
89 89 }
90 90  
91   - if (in_array($action, ['export'])) {
92   - if (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) {
  91 + if ($action == 'export') {
  92 + if ($this->userHasRole('Responsable')) {
93 93 return true;
94 94 }
95 95 }
96 96  
97 97 if (in_array($action, ['execActions', 'setLabelIsPlaced', 'setLabelIsPlacedOrNotPlaced', 'setLabelIsNotPlaced', 'printLabelRuban'])) {
98   - if (in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) {
  98 + if ($this->userHasRole('Administration')) {
99 99 return true;
100 100 }
101 101 }
... ...
src/Controller/OrganismesController.php
... ... @@ -36,7 +36,7 @@ class OrganismesController extends AppController
36 36 return true;
37 37 }
38 38  
39   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  39 + if($this->userHasRole('Administration')) {
40 40 if($action != 'delete') return true;
41 41 }
42 42  
... ...
src/Controller/SitesController.php
... ... @@ -32,7 +32,7 @@ class SitesController extends AppController
32 32 return true;
33 33 }
34 34  
35   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  35 + if($this->userHasRole('Administration')) {
36 36 if($action != 'delete') return true;
37 37 }
38 38  
... ...
src/Controller/SousCategoriesController.php
... ... @@ -35,7 +35,7 @@ class SousCategoriesController extends AppController
35 35 return true;
36 36 }
37 37  
38   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  38 + if($this->userHasRole('Administration')) {
39 39 if($action != 'delete') return true;
40 40 }
41 41  
... ...
src/Controller/SuivisController.php
... ... @@ -26,7 +26,7 @@ class SuivisController extends AppController
26 26  
27 27 $action = $this->request->params['action'];
28 28  
29   - if(in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) return true;
  29 + if($this->userHasRole('Responsable')) return true;
30 30  
31 31 //Pour un "utilisateur"
32 32 if (in_array($action, ['edit', 'delete'])) {
... ...
src/Controller/SurCategoriesController.php
... ... @@ -36,7 +36,7 @@ class SurCategoriesController extends AppController
36 36 return true;
37 37 }
38 38  
39   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  39 + if($this->userHasRole('Administration')) {
40 40 if($action != 'delete') return true;
41 41 }
42 42  
... ...
src/Controller/TypeSuivisController.php
... ... @@ -32,7 +32,7 @@ class TypeSuivisController extends AppController
32 32 return true;
33 33 }
34 34  
35   - if(in_array($role, ['Administration', 'Administration Plus'])) {
  35 + if($this->userHasRole('Administration')) {
36 36 if($action != 'delete') return true;
37 37 }
38 38  
... ...
src/Template/Element/menu_view.ctp
... ... @@ -23,46 +23,46 @@
23 23  
24 24 <!-- EDIT action -->
25 25 <li><?php
26   - $bol = false;
  26 + $isAuthorized = false;
27 27  
28 28 if($singularHumanName == 'Matériel') {
29 29 if (in_array($materiel->status, ['CREATED', 'VALIDATED'])) {
30 30 if(($role == 'Utilisateur' && (in_array($username, [$materiel->nom_createur, $materiel->nom_responsable]))) || (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur']))) {
31   - $bol = true;
  31 + $isAuthorized = true;
32 32 }
33 33 }else {
34 34 if(in_array($role, ['Administration Plus', 'Super Administrateur'])) {
35   - $bol = true;
  35 + $isAuthorized = true;
36 36 }
37 37 }
38 38 }
39 39 else if (in_array($singularHumanName, ['Suivi', 'Emprunt'])) {
40 40 if (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) {
41   - $bol = true;
  41 + $isAuthorized = true;
42 42 }else {
43 43 if($singularHumanName == 'Suivi') {
44 44 if(in_array($username, [$suivi->nom_createur])) {
45   - $bol = true;
  45 + $isAuthorized = true;
46 46 }
47 47 } else {
48 48 if(in_array($username, [$emprunt->nom_createur, $emprunt->nom_emprunteur])) {
49   - $bol = true;
  49 + $isAuthorized = true;
50 50 }
51 51 }
52 52 }
53 53 }
54 54 else if ($singularHumanName == 'Utilisateur') {
55 55 if($role == 'Super Administrateur') {
56   - $bol = true;
  56 + $isAuthorized = true;
57 57 }
58 58 }
59 59 else {
60 60 if (in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) {
61   - $bol = true;
  61 + $isAuthorized = true;
62 62 }
63 63 }
64 64  
65   - if ($bol == true) {
  65 + if ($isAuthorized == true) {
66 66 $action = '';
67 67 if(strstr($t, 'catégorie'))
68 68 $action = ' Editer cette';
... ... @@ -88,37 +88,37 @@
88 88 <!-- DELETE action -->
89 89 <li>
90 90 <?php
91   - $bol = false;
  91 + $isAuthorized = false;
92 92  
93 93 if($singularHumanName == 'Matériel') {
94 94 if ($materiel->status == 'CREATED') {
95 95 if(($role == 'Utilisateur' && (in_array($username, [$materiel->nom_createur, $materiel->nom_responsable]))) || (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur']))) {
96   - $bol = true;
  96 + $isAuthorized = true;
97 97 }
98 98 }
99 99 }
100 100 else if (in_array($singularHumanName, ['Suivi', 'Emprunt'])) {
101 101 if (in_array($role, ['Responsable', 'Administration', 'Administration Plus', 'Super Administrateur'])) {
102   - $bol = true;
  102 + $isAuthorized = true;
103 103 }else {
104 104 if($singularHumanName == 'Suivi') {
105 105 if(in_array($username, [$suivi->nom_createur])) {
106   - $bol = true;
  106 + $isAuthorized = true;
107 107 }
108 108 } else {
109 109 if(in_array($username, [$emprunt->nom_createur, $emprunt->nom_emprunteur])) {
110   - $bol = true;
  110 + $isAuthorized = true;
111 111 }
112 112 }
113 113 }
114 114 }
115 115 else {
116 116 if (in_array($role, ['Super Administrateur'])) {
117   - $bol = true;
  117 + $isAuthorized = true;
118 118 }
119 119 }
120 120  
121   - if($bol == true) {
  121 + if($isAuthorized == true) {
122 122 $action = '';
123 123 if(strstr($t, 'catégorie'))
124 124 $action = ' Supprimer cette';
... ...
src/Template/Layout/default.ctp
... ... @@ -93,7 +93,7 @@ $cakeDescription = &#39;Labinvent 2.0&#39;;
93 93 </i></td>
94 94 <td id="version">
95 95 <!-- VERSION M.m.f.b (version (M)ajeure, version (m)ineure, numero de nouvelle (f)onctionnalite, numero de (b)ugfix) -->
96   - <font color="black">VERSION 2.4.2.11 (03/06/2016)</font>
  96 + <font color="black">VERSION 2.4.2.12 (03/06/2016)</font>
97 97 </td>
98 98 </tr>
99 99 </table>
... ...
src/Template/Materiels/view.ctp
... ... @@ -105,7 +105,7 @@
105 105  
106 106 case "TOBEARCHIVED":
107 107 if($role != 'Responsable') {
108   - echo $this->Html->link('<i class="icon-ok-sign"></i> Sortie inventaire',
  108 + echo $this->Html->link('<i class="icon-ok-sign"></i> Sortie inventaire',
109 109 ['action' => 'statusArchived', $materiel->id, 'view'],
110 110 ['title' => 'Sortir définitivement de l\'inventaire', 'style' => 'margin-right: 10px', 'escape' => false,
111 111 'confirm' => 'Êtes-vous sur de bien vouloir archiver ' . $materiel->designation . ' ?']);
... ...
tests/TestCase/Controller/MaterielsControllerTest.php
... ... @@ -610,7 +610,7 @@ class MaterielsControllerTest extends IntegrationTestCase
610 610 *
611 611 * @return void
612 612 */
613   - public function testUpdateStatusSelectedMateriel() {
  613 + public function testUpdateStatusSelectedMateriels() {
614 614 $this->authSuperAdmin();
615 615  
616 616 $this->post('/materiels/execActions', ['updateSelectedStatus' => 'true', 'what' => 'CREATED', 11 => '1', 12 => '1', 13 => '1']);
... ...