La restriction SharedOnly devient une disable condition


Cette page ne doit être appliquée que si le script vous demande de passer la migration manuelle code.20260714.ODF-NotShared2DisableCondition

La restriction sur les ELPs non mutualisés a été transformée en disable condition.

Pour cette migration, il y a plusieurs cas de figure, tous représentés dans les PR du ODF-4064

Ajouter la condition

Dans tous les cas, si elle n'est pas présente, il faut ajouter la disable condition suivante sur le champ :

<condition class="org.ametys.odf.course.NotShared2DisableCondition" />

Si le champ a déjà des disable condition, vérifier ou ajouter le type "or". Exemple :

<disable-conditions type="or">
   <condition id="../isEvaluated" operator="eq">false</condition>
   <condition class="org.ametys.odf.course.NotShared2DisableCondition" />
</disable-conditions>

Modifier / supprimer la restriction

Ensuite, il faut supprimer la restriction.

RepeaterWithEducationalPathRestriction

Si la restriction existante est une RepeaterWithEducationalPathRestriction, il suffit de supprimer la ligne avec shared-program-item-only

<restrict-to>
   <custom-restriction class="org.ametys.plugins.odfpilotage.restriction.RepeaterWithEducationalPathRestriction">
       <right read-write-direction="write" id="ODF_Rights_Pilotage_MCC_Fields"/>
       <shared-program-item-only>true</shared-program-item-only>
   </custom-restriction>
</restrict-to>

devient 

<restrict-to>
   <custom-restriction class="org.ametys.plugins.odfpilotage.restriction.RepeaterWithEducationalPathRestriction">
       <right read-write-direction="write" id="ODF_Rights_Pilotage_MCC_Fields"/>
   </custom-restriction>
</restrict-to>

SharedOnlyRestriction

Si la restriction est un SharedOnlyRestriction, il faut complètement supprimer la restriction custom

<restrict-to>
   <custom-restriction class="org.ametys.odf.restriction.SharedOnlyRestriction">
       <right read-write-direction="write" id="ODF_Rights_Pilotage_MCC_Fields" />
       <shared-program-item-only>true</shared-program-item-only>
   </custom-restriction>
</restrict-to>

devient

<restrict-to>
   <right read-write-direction="write" id="ODF_Rights_Pilotage_MCC_Fields"/>
</restrict-to>
Retour en haut