0003-django_rbac-add-missing-constraints-57500.patch
src/django_rbac/migrations/0007_add_unique_constraints.py | ||
---|---|---|
1 |
# Generated by Django 2.2.23 on 2022-01-31 13:10 |
|
2 | ||
3 |
from django.db import migrations |
|
4 | ||
5 | ||
6 |
class Migration(migrations.Migration): |
|
7 | ||
8 |
dependencies = [ |
|
9 |
('contenttypes', '0002_remove_content_type_name'), |
|
10 |
('django_rbac', '0006_remove_operation_name'), |
|
11 |
] |
|
12 | ||
13 |
operations = [ |
|
14 |
migrations.AlterUniqueTogether( |
|
15 |
name='permission', |
|
16 |
unique_together={('operation', 'ou', 'target_ct', 'target_id')}, |
|
17 |
), |
|
18 |
migrations.AlterUniqueTogether( |
|
19 |
name='roleparenting', |
|
20 |
unique_together={('parent', 'child', 'direct')}, |
|
21 |
), |
|
22 |
migrations.AlterIndexTogether( |
|
23 |
name='roleparenting', |
|
24 |
index_together={('child', 'parent', 'direct')}, |
|
25 |
), |
|
26 |
] |
src/django_rbac/models.py | ||
---|---|---|
83 | 83 | |
84 | 84 | |
85 | 85 |
class OrganizationalUnit(OrganizationalUnitAbstractBase): |
86 |
class Meta: |
|
86 |
class Meta(OrganizationalUnitAbstractBase.Meta):
|
|
87 | 87 |
verbose_name = _('organizational unit') |
88 | 88 |
verbose_name_plural = _('organizational units') |
89 | 89 |
swappable = constants.RBAC_OU_MODEL_SETTING |
... | ... | |
168 | 168 | |
169 | 169 | |
170 | 170 |
class Permission(PermissionAbstractBase): |
171 |
class Meta: |
|
171 |
class Meta(PermissionAbstractBase.Meta):
|
|
172 | 172 |
swappable = constants.RBAC_PERMISSION_MODEL_SETTING |
173 | 173 |
verbose_name = _('permission') |
174 | 174 |
verbose_name_plural = _('permissions') |
... | ... | |
229 | 229 | |
230 | 230 | |
231 | 231 |
class Role(RoleAbstractBase): |
232 |
class Meta: |
|
232 |
class Meta(RoleAbstractBase.Meta):
|
|
233 | 233 |
verbose_name = _('role') |
234 | 234 |
verbose_name_plural = _('roles') |
235 | 235 |
swappable = constants.RBAC_ROLE_MODEL_SETTING |
... | ... | |
263 | 263 | |
264 | 264 | |
265 | 265 |
class RoleParenting(RoleParentingAbstractBase): |
266 |
class Meta: |
|
266 |
class Meta(RoleParentingAbstractBase.Meta):
|
|
267 | 267 |
verbose_name = _('role parenting relation') |
268 | 268 |
verbose_name_plural = _('role parenting relations') |
269 | 269 |
swappable = constants.RBAC_ROLE_PARENTING_MODEL_SETTING |
270 |
- |