mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
981 B
29 lines
981 B
2 years ago
|
from rbac.permissions import RBACPermission
|
||
|
from common.permissions import UserConfirmation, ConfirmType
|
||
|
|
||
|
from common.views.mixins import RecordViewLogMixin
|
||
2 years ago
|
from orgs.mixins.api import OrgBulkModelViewSet
|
||
2 years ago
|
from accounts import serializers
|
||
|
from accounts.models import AccountTemplate
|
||
2 years ago
|
|
||
|
|
||
|
class AccountTemplateViewSet(OrgBulkModelViewSet):
|
||
|
model = AccountTemplate
|
||
|
filterset_fields = ("username", 'name')
|
||
|
search_fields = ('username', 'name')
|
||
|
serializer_classes = {
|
||
|
'default': serializers.AccountTemplateSerializer
|
||
|
}
|
||
2 years ago
|
|
||
|
|
||
|
class AccountTemplateSecretsViewSet(RecordViewLogMixin, AccountTemplateViewSet):
|
||
|
serializer_classes = {
|
||
|
'default': serializers.AccountTemplateSecretSerializer,
|
||
|
}
|
||
|
http_method_names = ['get', 'options']
|
||
2 years ago
|
permission_classes = [RBACPermission, UserConfirmation.require(ConfirmType.MFA)]
|
||
2 years ago
|
rbac_perms = {
|
||
|
'list': 'assets.view_accounttemplatesecret',
|
||
|
'retrieve': 'assets.view_accounttemplatesecret',
|
||
|
}
|