Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
1a84661c
J
jumpserver
项目概览
gjl2004yn
/
jumpserver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jumpserver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1a84661c
编写于
6月 02, 2020
作者:
baltery
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 修改filterset_fields => filter_fields,option方法不支持filterset
上级
c87b9f20
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
26 addition
and
22 deletion
+26
-22
apps/assets/api/asset.py
apps/assets/api/asset.py
+1
-1
apps/assets/api/system_user_relation.py
apps/assets/api/system_user_relation.py
+3
-3
apps/audits/api.py
apps/audits/api.py
+5
-6
apps/perms/api/asset_permission_relation.py
apps/perms/api/asset_permission_relation.py
+5
-5
apps/perms/api/database_app_permission_relation.py
apps/perms/api/database_app_permission_relation.py
+4
-4
apps/perms/api/remote_app_permission_relation.py
apps/perms/api/remote_app_permission_relation.py
+2
-2
apps/terminal/api/session.py
apps/terminal/api/session.py
+1
-1
apps/terminal/serializers/session.py
apps/terminal/serializers/session.py
+5
-0
未找到文件。
apps/assets/api/asset.py
浏览文件 @
1a84661c
...
...
@@ -74,7 +74,7 @@ class AssetPlatformViewSet(ModelViewSet):
queryset
=
Platform
.
objects
.
all
()
permission_classes
=
(
IsSuperUser
,)
serializer_class
=
serializers
.
PlatformSerializer
filter
set
_fields
=
[
'name'
,
'base'
]
filter_fields
=
[
'name'
,
'base'
]
search_fields
=
[
'name'
]
def
check_object_permissions
(
self
,
request
,
obj
):
...
...
apps/assets/api/system_user_relation.py
浏览文件 @
1a84661c
...
...
@@ -65,7 +65,7 @@ class SystemUserAssetRelationViewSet(BaseRelationViewSet):
serializer_class
=
serializers
.
SystemUserAssetRelationSerializer
model
=
models
.
SystemUser
.
assets
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'asset'
,
'systemuser'
,
]
search_fields
=
[
...
...
@@ -91,7 +91,7 @@ class SystemUserNodeRelationViewSet(BaseRelationViewSet):
serializer_class
=
serializers
.
SystemUserNodeRelationSerializer
model
=
models
.
SystemUser
.
nodes
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'node'
,
'systemuser'
,
]
search_fields
=
[
...
...
@@ -112,7 +112,7 @@ class SystemUserUserRelationViewSet(BaseRelationViewSet):
serializer_class
=
serializers
.
SystemUserUserRelationSerializer
model
=
models
.
SystemUser
.
users
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'user'
,
'systemuser'
,
]
search_fields
=
[
...
...
apps/audits/api.py
浏览文件 @
1a84661c
...
...
@@ -24,12 +24,11 @@ class FTPLogViewSet(ListModelMixin, OrgGenericViewSet):
date_range_filter_fields
=
[
(
'date_start'
,
(
'date_from'
,
'date_to'
))
]
filter_fields
=
[
'user'
,
'asset'
,
'system_user'
]
search_fields
=
[
'filename'
]
filter_fields
=
[
'user'
,
'asset'
,
'system_user'
,
'filename'
]
search_fields
=
filter_fields
class
UserLoginLogViewSet
(
ListModelMixin
,
CommonGenericViewSet
):
class
UserLoginLogViewSet
(
ListModelMixin
,
CommonGenericViewSet
):
queryset
=
UserLoginLog
.
objects
.
all
()
permission_classes
=
[
IsOrgAdmin
|
IsOrgAuditor
]
serializer_class
=
UserLoginLogSerializer
...
...
@@ -61,7 +60,7 @@ class OperateLogViewSet(ListModelMixin, OrgGenericViewSet):
date_range_filter_fields
=
[
(
'datetime'
,
(
'date_from'
,
'date_to'
))
]
filter_fields
=
[
'user'
,
'action'
,
'resource_type'
,
'resource'
]
filter_fields
=
[
'user'
,
'action'
,
'resource_type'
,
'resource'
,
'remote_addr'
]
search_fields
=
[
'resource'
]
ordering
=
[
'-datetime'
]
...
...
@@ -74,7 +73,7 @@ class PasswordChangeLogViewSet(ListModelMixin, CommonGenericViewSet):
date_range_filter_fields
=
[
(
'datetime'
,
(
'date_from'
,
'date_to'
))
]
filter
set_fields
=
[
'use
r'
]
filter
_fields
=
[
'user'
,
'change_by'
,
'remote_add
r'
]
ordering
=
[
'-datetime'
]
def
get_queryset
(
self
):
...
...
apps/perms/api/asset_permission_relation.py
浏览文件 @
1a84661c
...
...
@@ -33,7 +33,7 @@ class AssetPermissionUserRelationViewSet(RelationMixin):
serializer_class
=
serializers
.
AssetPermissionUserRelationSerializer
model
=
models
.
AssetPermission
.
users
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
"user"
,
"assetpermission"
,
]
search_fields
=
(
"user__name"
,
"user__username"
,
"assetpermission__name"
)
...
...
@@ -64,7 +64,7 @@ class AssetPermissionUserGroupRelationViewSet(RelationMixin):
serializer_class
=
serializers
.
AssetPermissionUserGroupRelationSerializer
model
=
models
.
AssetPermission
.
user_groups
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
"usergroup"
,
"assetpermission"
]
search_fields
=
[
"usergroup__name"
,
"assetpermission__name"
]
...
...
@@ -80,7 +80,7 @@ class AssetPermissionAssetRelationViewSet(RelationMixin):
serializer_class
=
serializers
.
AssetPermissionAssetRelationSerializer
model
=
models
.
AssetPermission
.
assets
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'asset'
,
'assetpermission'
,
]
search_fields
=
[
"id"
,
"asset__hostname"
,
"asset__ip"
,
"assetpermission__name"
]
...
...
@@ -111,7 +111,7 @@ class AssetPermissionNodeRelationViewSet(RelationMixin):
serializer_class
=
serializers
.
AssetPermissionNodeRelationSerializer
model
=
models
.
AssetPermission
.
nodes
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'node'
,
'assetpermission'
,
]
search_fields
=
[
"node__value"
,
"assetpermission__name"
]
...
...
@@ -127,7 +127,7 @@ class AssetPermissionSystemUserRelationViewSet(RelationMixin):
serializer_class
=
serializers
.
AssetPermissionSystemUserRelationSerializer
model
=
models
.
AssetPermission
.
system_users
.
through
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'systemuser'
,
'assetpermission'
,
]
search_fields
=
[
...
...
apps/perms/api/database_app_permission_relation.py
浏览文件 @
1a84661c
...
...
@@ -23,7 +23,7 @@ class DatabaseAppPermissionUserRelationViewSet(RelationViewSet):
serializer_class
=
serializers
.
DatabaseAppPermissionUserRelationSerializer
m2m_field
=
models
.
DatabaseAppPermission
.
users
.
field
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'user'
,
'databaseapppermission'
]
search_fields
=
(
'user__name'
,
'user__username'
,
'databaseapppermission__name'
)
...
...
@@ -38,7 +38,7 @@ class DatabaseAppPermissionUserGroupRelationViewSet(RelationViewSet):
serializer_class
=
serializers
.
DatabaseAppPermissionUserGroupRelationSerializer
m2m_field
=
models
.
DatabaseAppPermission
.
user_groups
.
field
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
"usergroup"
,
"databaseapppermission"
]
search_fields
=
[
"usergroup__name"
,
"databaseapppermission__name"
]
...
...
@@ -69,7 +69,7 @@ class DatabaseAppPermissionDatabaseAppRelationViewSet(RelationViewSet):
serializer_class
=
serializers
.
DatabaseAppPermissionDatabaseAppRelationSerializer
m2m_field
=
models
.
DatabaseAppPermission
.
database_apps
.
field
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'databaseapp'
,
'databaseapppermission'
,
]
search_fields
=
[
...
...
@@ -102,7 +102,7 @@ class DatabaseAppPermissionSystemUserRelationViewSet(RelationViewSet):
serializer_class
=
serializers
.
DatabaseAppPermissionSystemUserRelationSerializer
m2m_field
=
models
.
DatabaseAppPermission
.
system_users
.
field
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'systemuser'
,
'databaseapppermission'
]
search_fields
=
[
...
...
apps/perms/api/remote_app_permission_relation.py
浏览文件 @
1a84661c
...
...
@@ -35,7 +35,7 @@ class RemoteAppPermissionUserRelationViewSet(RelationViewSet):
serializer_class
=
serializers
.
RemoteAppPermissionUserRelationSerializer
m2m_field
=
models
.
RemoteAppPermission
.
users
.
field
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'user'
,
'remoteapppermission'
]
search_fields
=
(
'user__name'
,
'user__username'
,
'remoteapppermission__name'
)
...
...
@@ -50,7 +50,7 @@ class RemoteAppPermissionRemoteAppRelationViewSet(RelationViewSet):
serializer_class
=
serializers
.
RemoteAppPermissionRemoteAppRelationSerializer
m2m_field
=
models
.
RemoteAppPermission
.
remote_apps
.
field
permission_classes
=
(
IsOrgAdmin
,)
filter
set
_fields
=
[
filter_fields
=
[
'id'
,
'remoteapp'
,
'remoteapppermission'
,
]
search_fields
=
[
...
...
apps/terminal/api/session.py
浏览文件 @
1a84661c
...
...
@@ -32,7 +32,7 @@ class SessionViewSet(OrgBulkModelViewSet):
'display'
:
serializers
.
SessionDisplaySerializer
,
}
permission_classes
=
(
IsOrgAdminOrAppUser
,
)
filter
set
_fields
=
[
filter_fields
=
[
"user"
,
"asset"
,
"system_user"
,
"remote_addr"
,
"protocol"
,
"terminal"
,
"is_finished"
,
]
...
...
apps/terminal/serializers/session.py
浏览文件 @
1a84661c
from
rest_framework
import
serializers
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins.serializers
import
BulkOrgResourceModelSerializer
from
common.serializers
import
AdaptedBulkListSerializer
from
..models
import
Session
...
...
@@ -24,6 +25,10 @@ class SessionSerializer(BulkOrgResourceModelSerializer):
"can_join"
,
"protocol"
,
"date_start"
,
"date_end"
,
"terminal"
,
]
extra_kwargs
=
{
"protocol"
:
{
'label'
:
_
(
'Protocol'
)},
'is_finished'
:
{
'label'
:
_
(
'Is finished'
)}
}
class
SessionDisplaySerializer
(
SessionSerializer
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录