mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-12 10:38:16 -06:00
16138 update users and groups in perm selection
This commit is contained in:
parent
5b6ae28422
commit
6385b0b0b5
@ -3,8 +3,7 @@ from django.db.models import Q
|
|||||||
|
|
||||||
OBJECTPERMISSION_OBJECT_TYPES = Q(
|
OBJECTPERMISSION_OBJECT_TYPES = Q(
|
||||||
~Q(app_label__in=['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users']) |
|
~Q(app_label__in=['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users']) |
|
||||||
Q(app_label='auth', model__in=['group', 'user']) |
|
Q(app_label='users', model__in=['objectpermission', 'token', 'group', 'user'])
|
||||||
Q(app_label='users', model__in=['objectpermission', 'token'])
|
|
||||||
)
|
)
|
||||||
|
|
||||||
CONSTRAINT_TOKEN_USER = '$user'
|
CONSTRAINT_TOKEN_USER = '$user'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Generated by Django 5.0.5 on 2024-05-15 18:05
|
# Generated by Django 5.0.5 on 2024-05-15 18:05
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
def update_content_types(apps, schema_editor):
|
def update_content_types(apps, schema_editor):
|
||||||
@ -29,4 +29,25 @@ class Migration(migrations.Migration):
|
|||||||
code=update_content_types,
|
code=update_content_types,
|
||||||
reverse_code=migrations.RunPython.noop
|
reverse_code=migrations.RunPython.noop
|
||||||
),
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='objectpermission',
|
||||||
|
name='object_types',
|
||||||
|
field=models.ManyToManyField(
|
||||||
|
limit_choices_to=models.Q(
|
||||||
|
models.Q(
|
||||||
|
models.Q(
|
||||||
|
(
|
||||||
|
'app_label__in',
|
||||||
|
['account', 'admin', 'auth', 'contenttypes', 'sessions', 'taggit', 'users'],
|
||||||
|
),
|
||||||
|
_negated=True,
|
||||||
|
),
|
||||||
|
models.Q(('app_label', 'users'), ('model__in', ['objectpermission', 'token', 'group', 'user'])),
|
||||||
|
_connector='OR',
|
||||||
|
)
|
||||||
|
),
|
||||||
|
related_name='object_permissions',
|
||||||
|
to='core.objecttype',
|
||||||
|
),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user