mirror of https://github.com/jumpserver/jumpserver
perf: Account push
parent
709b676ec7
commit
36301503e9
|
@ -30,6 +30,7 @@ class PushAccountExecutionViewSet(AutomationExecutionViewSet):
|
||||||
("list", "accounts.view_pushaccountexecution"),
|
("list", "accounts.view_pushaccountexecution"),
|
||||||
("retrieve", "accounts.view_pushaccountexecution"),
|
("retrieve", "accounts.view_pushaccountexecution"),
|
||||||
("create", "accounts.add_pushaccountexecution"),
|
("create", "accounts.add_pushaccountexecution"),
|
||||||
|
("report", "accounts.view_pushaccountexecution"),
|
||||||
)
|
)
|
||||||
|
|
||||||
tp = AutomationTypes.push_account
|
tp = AutomationTypes.push_account
|
||||||
|
@ -44,9 +45,15 @@ class PushAccountRecordViewSet(ChangeSecretRecordViewSet):
|
||||||
serializer_class = serializers.ChangeSecretRecordSerializer
|
serializer_class = serializers.ChangeSecretRecordSerializer
|
||||||
tp = AutomationTypes.push_account
|
tp = AutomationTypes.push_account
|
||||||
|
|
||||||
|
rbac_perms = {
|
||||||
|
'list': 'accounts.view_pushsecretrecord',
|
||||||
|
'execute': 'accounts.add_pushsecretexecution',
|
||||||
|
'secret': 'accounts.view_pushsecretrecord',
|
||||||
|
}
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = ChangeSecretRecord.get_valid_records()
|
qs = ChangeSecretRecord.get_valid_records()
|
||||||
return qs.objects.filter(
|
return qs.filter(
|
||||||
execution__automation__type=self.tp
|
execution__automation__type=self.tp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 4.1.13 on 2024-12-09 03:15
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import private_storage.fields
|
||||||
|
import private_storage.storage.files
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('accounts', '0021_remove_pushaccountautomation_action_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='changesecretrecord',
|
||||||
|
options={'permissions': [('view_pushsecretrecord', 'Can view change secret execution'), ('add_pushsecretexecution', 'Can add change secret execution')], 'verbose_name': 'Change secret record'},
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='integrationapplication',
|
||||||
|
name='logo',
|
||||||
|
field=private_storage.fields.PrivateImageField(max_length=128, storage=private_storage.storage.files.PrivateFileSystemStorage(), upload_to='images', verbose_name='Logo'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -45,8 +45,11 @@ class ChangeSecretRecord(JMSBaseModel):
|
||||||
error = models.TextField(blank=True, null=True, verbose_name=_('Error'))
|
error = models.TextField(blank=True, null=True, verbose_name=_('Error'))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('-date_created',)
|
|
||||||
verbose_name = _("Change secret record")
|
verbose_name = _("Change secret record")
|
||||||
|
permissions = [
|
||||||
|
('view_pushsecretrecord', _('Can view change secret execution')),
|
||||||
|
('add_pushsecretexecution', _('Can add change secret execution')),
|
||||||
|
]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.account.username}@{self.asset}'
|
return f'{self.account.username}@{self.asset}'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<div class='summary'>
|
<div class='summary'>
|
||||||
<p>{% trans 'The following is a summary of account change secret tasks, please review and handle them' %}</p>
|
<p>{% trans 'The following is a summary of account change secret or push tasks, please read and process' %}</p>
|
||||||
<table>
|
<table>
|
||||||
<caption></caption>
|
<caption></caption>
|
||||||
<thead>
|
<thead>
|
||||||
|
|
Loading…
Reference in New Issue