-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a constraint to UnitRole for AD group based roles
- Loading branch information
1 parent
e5c4b01
commit 3ea6c2a
Showing
3 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
tilavarauspalvelu/migrations/0056_unitrole_unique_role_user_for_ad_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 5.1.3 on 2024-12-16 10:21 | ||
from __future__ import annotations | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tilavarauspalvelu", "0055_unit_allow_permissions_from_ad_groups_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddConstraint( | ||
model_name="unitrole", | ||
constraint=models.UniqueConstraint( | ||
condition=models.Q(("is_from_ad_group", True)), | ||
fields=("role", "user"), | ||
name="unique_role_user_if_is_from_ad_group", | ||
violation_error_message="Role for user must be unique for AD group based roles.", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters