mirror of https://github.com/jumpserver/jumpserver
parent
11e538d417
commit
2abca39597
|
@ -29,7 +29,8 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet):
|
|||
serializer_class = serializers.TicketDisplaySerializer
|
||||
serializer_classes = {
|
||||
'list': serializers.TicketListSerializer,
|
||||
'open': serializers.TicketApplySerializer
|
||||
'open': serializers.TicketApplySerializer,
|
||||
'approve': serializers.TicketApproveSerializer
|
||||
}
|
||||
model = Ticket
|
||||
perm_model = Ticket
|
||||
|
|
|
@ -139,7 +139,7 @@ class Migration(migrations.Migration):
|
|||
('ticket_ptr',
|
||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
||||
primary_key=True, serialize=False, to='tickets.ticket')),
|
||||
('apply_permission_name', models.CharField(max_length=128, verbose_name='Apply name')),
|
||||
('apply_permission_name', models.CharField(max_length=128, verbose_name='Permission name')),
|
||||
('apply_actions', models.IntegerField(
|
||||
choices=[(255, 'All'), (1, 'Connect'), (2, 'Upload file'), (4, 'Download file'),
|
||||
(6, 'Upload download'), (8, 'Clipboard copy'), (16, 'Clipboard paste'),
|
||||
|
@ -162,7 +162,7 @@ class Migration(migrations.Migration):
|
|||
('ticket_ptr',
|
||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
||||
primary_key=True, serialize=False, to='tickets.ticket')),
|
||||
('apply_permission_name', models.CharField(max_length=128, verbose_name='Apply name')),
|
||||
('apply_permission_name', models.CharField(max_length=128, verbose_name='Permission name')),
|
||||
('apply_category',
|
||||
models.CharField(choices=[('db', 'Database'), ('remote_app', 'Remote app'), ('cloud', 'Cloud')],
|
||||
max_length=16, verbose_name='Category')),
|
||||
|
|
|
@ -9,7 +9,7 @@ from tickets.models import Ticket, TicketFlow
|
|||
from tickets.const import TicketType
|
||||
|
||||
__all__ = [
|
||||
'TicketDisplaySerializer', 'TicketApplySerializer', 'TicketListSerializer'
|
||||
'TicketDisplaySerializer', 'TicketApplySerializer', 'TicketListSerializer', 'TicketApproveSerializer'
|
||||
]
|
||||
|
||||
|
||||
|
@ -59,6 +59,13 @@ class TicketDisplaySerializer(TicketSerializer):
|
|||
read_only_fields = fields
|
||||
|
||||
|
||||
class TicketApproveSerializer(TicketSerializer):
|
||||
class Meta:
|
||||
model = Ticket
|
||||
fields = TicketSerializer.Meta.fields
|
||||
read_only_fields = fields
|
||||
|
||||
|
||||
class TicketApplySerializer(TicketSerializer):
|
||||
org_id = serializers.CharField(
|
||||
required=True, max_length=36, allow_blank=True, label=_("Organization")
|
||||
|
|
Loading…
Reference in New Issue