Commit b01af5a1 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Utilisation des classes plutôt que d'une string pour définir les RessourceId des entités

parent bc0f6de8
Loading
Loading
Loading
Loading
Loading
+4 −1
Changes for module/Agrement/config/module.config.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@ namespace Agrement;
use Agrement\Assertion\AgrementAssertion;
use Agrement\Controller\AgrementController;
use Agrement\Controller\Factory\AgrementControllerFactory;
use Agrement\Entity\Db\Agrement;
use Agrement\Entity\Db\TblAgrement;
use Agrement\Entity\Db\TypeAgrement;
use Agrement\Form\Factory\AgrementFormFactory;
use Agrement\Form\Saisie;
@@ -16,6 +18,7 @@ use Agrement\Service\TypeAgrementService;
use Agrement\Service\TypeAgrementServiceFactory;
use Agrement\View\Helper\AgrementVewHelperFactory;
use Application\Provider\Privileges;
use Lieu\Entity\Db\Structure;


return [
@@ -222,7 +225,7 @@ return [
                Privileges::AGREMENT_CONSEIL_ACADEMIQUE_SUPPRESSION,
                Privileges::AGREMENT_CONSEIL_RESTREINT_SUPPRESSION,
            ],
            'resources'  => ['TblAgrement', 'Agrement', 'Structure'],
            'resources'  => [TblAgrement::class, Agrement::class, Structure::class],
            'assertion'  => AgrementAssertion::class,
        ],
    ],
+2 −7
Changes for module/Agrement/src/Entity/Db/Agrement.php: 2 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -210,13 +210,8 @@ class Agrement implements HistoriqueAwareInterface, ResourceInterface



    /**
     * Returns the string identifier of the Resource
     *
     * @return string
     */
    public function getResourceId()
    public function getResourceId(): string
    {
        return 'Agrement';
        return self::class;
    }
}
+1 −1
Changes for module/Agrement/src/Entity/Db/TblAgrement.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -64,6 +64,6 @@ class TblAgrement implements ResourceInterface

    public function getResourceId(): string
    {
        return 'TblAgrement';
        return self::class;
    }
}
 No newline at end of file
+2 −11
Changes for module/Application/src/Entity/Db/Fichier.php: 2 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -19,10 +19,6 @@ class Fichier implements HistoriqueAwareInterface, ResourceInterface, UploadedFi
    use HistoriqueAwareTrait;
    use FichierServiceAwareTrait;

    /**
     *
     */
    const RESOURCE_ID = 'Fichier';

    /**
     * @var integer
@@ -348,13 +344,8 @@ class Fichier implements HistoriqueAwareInterface, ResourceInterface, UploadedFi



    /**
     * Returns the string identifier of the Resource
     *
     * @return string
     */
    public function getResourceId()
    public function getResourceId(): string
    {
        return self::RESOURCE_ID;
        return self::class;
    }
}
+4 −2
Changes for module/Chargens/config/module.config.php: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ namespace Chargens;

use Application\Provider\Privileges;
use Chargens\Assertion\ChargensAssertion;
use Chargens\Entity\Db\Scenario;
use Lieu\Entity\Db\Structure;
use Unicaen\Framework\Authorize\Authorize;

return [
@@ -224,7 +226,7 @@ return [
    'rules' => [
        [
            'privileges' => ChargensAssertion::SCENARIO_EDITION,
            'resources'  => ['Scenario', 'Structure'],
            'resources'  => [Scenario::class, Structure::class],
            'assertion'  => Assertion\ChargensAssertion::class,
        ],
        [
@@ -232,7 +234,7 @@ return [
                Privileges::CHARGENS_SEUIL_ETABLISSEMENT_EDITION,
                Privileges::CHARGENS_SEUIL_COMPOSANTE_EDITION,
            ],
            'resources'  => ['Structure'],
            'resources'  => [Structure::class],
            'assertion'  => Assertion\ChargensAssertion::class,
        ],
    ],
Loading