access permissions can now also be given by group
This commit is contained in:
parent
c4a8e1d874
commit
3477354688
6 changed files with 139 additions and 28 deletions
|
@ -0,0 +1,49 @@
|
|||
# Generated by Django 4.2.7 on 2023-12-19 17:51
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("mapdata", "0091_area_main_point"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="accesspermission",
|
||||
name="access_restriction_group",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="mapdata.accessrestrictiongroup",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accesspermission",
|
||||
name="access_restriction",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="mapdata.accessrestriction",
|
||||
),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="accesspermission",
|
||||
constraint=models.CheckConstraint(
|
||||
check=models.Q(
|
||||
models.Q(
|
||||
("access_restriction__isnull", True),
|
||||
("access_restriction_group__isnull", True),
|
||||
_negated=True,
|
||||
),
|
||||
models.Q(
|
||||
("access_restriction__isnull", False),
|
||||
("access_restriction_group__isnull", False),
|
||||
_negated=True,
|
||||
),
|
||||
),
|
||||
name="permission_needs_restriction_or_restriction_group",
|
||||
),
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue