mirror of https://github.com/jumpserver/jumpserver
parent
fc2d7aafce
commit
f7500b8aff
|
@ -30,7 +30,7 @@ class AccountViewSet(OrgBulkModelViewSet):
|
||||||
}
|
}
|
||||||
rbac_perms = {
|
rbac_perms = {
|
||||||
'verify_account': 'accounts.test_account',
|
'verify_account': 'accounts.test_account',
|
||||||
'partial_update': ['accounts.change_accountsecret', 'accounts.change_account'],
|
'partial_update': ['accounts.change_account'],
|
||||||
'su_from_accounts': 'accounts.view_account',
|
'su_from_accounts': 'accounts.view_account',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class AccountSecretsViewSet(RecordViewLogMixin, AccountViewSet):
|
||||||
'default': serializers.AccountSecretSerializer,
|
'default': serializers.AccountSecretSerializer,
|
||||||
}
|
}
|
||||||
http_method_names = ['get', 'options']
|
http_method_names = ['get', 'options']
|
||||||
permission_classes = [RBACPermission, UserConfirmation.require(ConfirmType.MFA)]
|
# permission_classes = [RBACPermission, UserConfirmation.require(ConfirmType.MFA)]
|
||||||
rbac_perms = {
|
rbac_perms = {
|
||||||
'list': 'accounts.view_accountsecret',
|
'list': 'accounts.view_accountsecret',
|
||||||
'retrieve': 'accounts.view_accountsecret',
|
'retrieve': 'accounts.view_accountsecret',
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Generated by Django 3.2.16 on 2023-02-16 11:07
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('accounts', '0006_gatheredaccount'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='account',
|
||||||
|
options={'permissions': [('view_accountsecret', 'Can view asset account secret'), ('view_historyaccount', 'Can view asset history account'), ('view_historyaccountsecret', 'Can view asset history account secret')], 'verbose_name': 'Account'},
|
||||||
|
),
|
||||||
|
]
|
|
@ -62,7 +62,6 @@ class Account(AbsConnectivity, BaseAccount):
|
||||||
]
|
]
|
||||||
permissions = [
|
permissions = [
|
||||||
('view_accountsecret', _('Can view asset account secret')),
|
('view_accountsecret', _('Can view asset account secret')),
|
||||||
('change_accountsecret', _('Can change asset account secret')),
|
|
||||||
('view_historyaccount', _('Can view asset history account')),
|
('view_historyaccount', _('Can view asset history account')),
|
||||||
('view_historyaccountsecret', _('Can view asset history account secret')),
|
('view_historyaccountsecret', _('Can view asset history account secret')),
|
||||||
]
|
]
|
||||||
|
|
|
@ -27,7 +27,7 @@ def migrate_remove_redundant_permission(apps, *args):
|
||||||
|
|
||||||
perm_model = apps.get_model('auth', 'Permission')
|
perm_model = apps.get_model('auth', 'Permission')
|
||||||
perm_model.objects.filter(codename__in=[
|
perm_model.objects.filter(codename__in=[
|
||||||
'view_permusergroupasset', 'view_permuserasset', 'push_assetsystemuser'
|
'view_permusergroupasset', 'view_permuserasset', 'push_assetsystemuser', 'change_accountsecret'
|
||||||
]).delete()
|
]).delete()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue