Question

Dans mes appareils ACL j'ai les ressources et les actions, la plupart des ressources partagent des actions communes comme CRUD, est-il un moyen dans la doctrine (yaml) pour étendre un autre élément?

Voici un texte de présentation de mon yaml actuel:


Resource:
  R1:
    title: Article
    system_name: ARTICLE
    Actions:
        A1:
            title: Create
            system_name: CREATE
        A2:
            title: Read
            system_name: READ
        A3:
            title: Update
            system_name: UPDATE
        A4:
            title: Delete
            system_name: DELETE

Comment pourrais-je prolonger R1 avec une nouvelle ressource, appelée « article Nouvelles » par exemple, qui héritera A1 à A4 + comprennent ses propres actions?

Était-ce utile?

La solution

"Ancres et alias" + fusion est la réponse:

http://yaml.github.com/yaml-spec/#id2768357

(Utilisez http://instantyaml.appspot.com/ pour voir comment l'YAML canonique ressemble )

Resource:
  R1:
    title: Article
    system_name: ARTICLE
    Actions: &id1
        A1:
            title: Create
            system_name: CREATE
        A2:
            title: Read
            system_name: READ
  R2:
    system_name: New ARTICLE
    Actions:
       <<: *id1
       A5:
            title: Drop
            system_name: DROP
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top