Projet

Général

Profil

0004-rbac-add-slug-and-name-as-implicit-natural-keys-6201.patch

Benjamin Dauvergne, 13 mai 2022 17:27

Télécharger (1010 octets)

Voir les différences:

Subject: [PATCH 4/9] rbac: add slug and name as implicit natural keys (#62013)

If the natural key is not precise enough, MultipleObjectReturned will be
raised preventing mismatches. But it will help using the API for simple
cases where the name is globally unique.
 src/authentic2/a2_rbac/models.py | 6 ++++++
 1 file changed, 6 insertions(+)
src/authentic2/a2_rbac/models.py
454 454
    ['name', 'ou', 'service'],
455 455
    ['slug', 'ou', 'service__isnull'],
456 456
    ['name', 'ou', 'service__isnull'],
457
    ['slug', 'ou__isnull'],
458
    ['name', 'ou__isnull'],
459
    ['slug', 'ou'],
460
    ['name', 'ou'],
461
    ['slug'],
462
    ['name'],
457 463
]
458 464

  
459 465

  
460
-