feat(core): Model tag for Access/Role

ref: #712 #683
This commit is contained in:
2025-04-06 13:49:20 +09:30
parent 7289758ed9
commit 8a8023f510
4 changed files with 28 additions and 0 deletions

View File

@ -201,6 +201,14 @@ For this command to process the following conditions must be met:
item_type = TicketLinkedItem.Modules.ORGANIZATION
elif model_type == 'role':
from access.models.role import Role
model = Role
item_type = TicketLinkedItem.Modules.ROLE
elif model_type == 'service':
from itim.models.services import Service

View File

@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-06 03:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0021_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.AlterField(
model_name='ticketlinkeditem',
name='item_type',
field=models.IntegerField(choices=[(1, 'Cluster'), (2, 'Config Group'), (3, 'Device'), (4, 'Operating System'), (5, 'Service'), (6, 'Software'), (7, 'Knowledge Base'), (8, 'Organization'), (9, 'Team'), (10, 'Feature Flag'), (11, 'Software Version'), (12, 'Ticket Category'), (13, 'Ticket Comment Category'), (14, 'Project State'), (15, 'Git Repository'), (16, 'Entity'), (17, 'Role')], help_text='Python Model location for linked item', verbose_name='Item Type'),
),
]

View File

@ -54,6 +54,7 @@ class TicketLinkedItem(TenancyObject):
PROJECT_STATE = 14, 'Project State'
GIT_REPOSITORY = 15, 'Git Repository'
ENTITY = 16, 'Entity'
ROLE = 17, 'Role'
is_global = None