Skip to content

Commit

Permalink
🗃️ [#3967] Add model field to store service restriction (branch number)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Jul 3, 2024
1 parent 8da2af6 commit 5313020
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.11 on 2024-07-03 09:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("of_authentication", "0002_add_authentication_context_mandate_fields"),
]

operations = [
migrations.AddField(
model_name="authinfo",
name="legal_subject_service_restriction",
field=models.CharField(
blank=True,
help_text="Optional service restriction information within the bigger legal subject.",
max_length=250,
verbose_name="legal subject service restriction",
),
),
]
12 changes: 11 additions & 1 deletion src/openforms/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ class AuthInfo(BaseAuthInfo):
max_length=250,
blank=True,
)
# generic field for "service restriction", but in practice this means
# vestiging/branch number for eHerkenning.
legal_subject_service_restriction = models.CharField(
verbose_name=_("legal subject service restriction"),
help_text=_(
"Optional service restriction information within the bigger legal subject."
),
max_length=250, # the 250 is quite arbitrary, branch number is 12 chars
blank=True,
)

mandate_context = models.JSONField(
verbose_name=_("mandate context"),
Expand Down Expand Up @@ -230,7 +240,7 @@ class Meta:
"legal_subject_identifier_value",
),
),
# presence of a legal subject implies a mandata context
# presence of a legal subject implies a mandate context
models.CheckConstraint(
name="mandate_context_not_null",
check=(
Expand Down

0 comments on commit 5313020

Please sign in to comment.