Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
466b922e
Commit
466b922e
authored
May 16, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
9e52579c
1ca1e519
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
3 deletions
+5
-3
node.py
apps/assets/api/node.py
+2
-0
db.py
apps/assets/backends/external/db.py
+1
-1
admin_user.py
apps/assets/backends/internal/admin_user.py
+1
-1
system_user.py
apps/assets/backends/internal/system_user.py
+1
-1
No files found.
apps/assets/api/node.py
View file @
466b922e
...
@@ -39,6 +39,8 @@ __all__ = [
...
@@ -39,6 +39,8 @@ __all__ = [
class
NodeViewSet
(
viewsets
.
ModelViewSet
):
class
NodeViewSet
(
viewsets
.
ModelViewSet
):
filter_fields
=
(
'value'
,
'key'
,
)
search_fields
=
filter_fields
queryset
=
Node
.
objects
.
all
()
queryset
=
Node
.
objects
.
all
()
permission_classes
=
(
IsOrgAdmin
,)
permission_classes
=
(
IsOrgAdmin
,)
serializer_class
=
serializers
.
NodeSerializer
serializer_class
=
serializers
.
NodeSerializer
...
...
apps/assets/backends/external/db.py
View file @
466b922e
...
@@ -11,7 +11,7 @@ class AuthBookBackend(BaseBackend):
...
@@ -11,7 +11,7 @@ class AuthBookBackend(BaseBackend):
@classmethod
@classmethod
def
filter
(
cls
,
username
=
None
,
asset
=
None
,
latest
=
True
):
def
filter
(
cls
,
username
=
None
,
asset
=
None
,
latest
=
True
):
queryset
=
AuthBook
.
objects
.
all
()
queryset
=
AuthBook
.
objects
.
all
()
if
username
:
if
username
is
not
None
:
queryset
=
queryset
.
filter
(
username
=
username
)
queryset
=
queryset
.
filter
(
username
=
username
)
if
asset
:
if
asset
:
queryset
=
queryset
.
filter
(
asset
=
asset
)
queryset
=
queryset
.
filter
(
asset
=
asset
)
...
...
apps/assets/backends/internal/admin_user.py
View file @
466b922e
...
@@ -27,7 +27,7 @@ class AdminUserBackend(BaseBackend):
...
@@ -27,7 +27,7 @@ class AdminUserBackend(BaseBackend):
instances
=
[]
instances
=
[]
assets
=
cls
.
_get_assets
(
asset
)
assets
=
cls
.
_get_assets
(
asset
)
for
asset
in
assets
:
for
asset
in
assets
:
if
username
and
asset
.
admin_user
.
username
!=
username
:
if
username
is
not
None
and
asset
.
admin_user
.
username
!=
username
:
continue
continue
instance
=
construct_authbook_object
(
asset
.
admin_user
,
asset
)
instance
=
construct_authbook_object
(
asset
.
admin_user
,
asset
)
instances
.
append
(
instance
)
instances
.
append
(
instance
)
...
...
apps/assets/backends/internal/system_user.py
View file @
466b922e
...
@@ -30,7 +30,7 @@ class SystemUserBackend(BaseBackend):
...
@@ -30,7 +30,7 @@ class SystemUserBackend(BaseBackend):
@classmethod
@classmethod
def
_filter_system_users_by_username
(
cls
,
system_users
,
username
):
def
_filter_system_users_by_username
(
cls
,
system_users
,
username
):
_system_users
=
cls
.
_distinct_system_users_by_username
(
system_users
)
_system_users
=
cls
.
_distinct_system_users_by_username
(
system_users
)
if
username
:
if
username
is
not
None
:
_system_users
=
[
su
for
su
in
_system_users
if
username
==
su
.
username
]
_system_users
=
[
su
for
su
in
_system_users
if
username
==
su
.
username
]
return
_system_users
return
_system_users
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment