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
9499a16a
Unverified
Commit
9499a16a
authored
6 years ago
by
老广
Committed by
GitHub
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 默认中可以看到所有用户 (#2102)
parent
f380d82b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
models.py
apps/orgs/models.py
+3
-7
user.py
apps/users/api/user.py
+1
-4
No files found.
apps/orgs/models.py
View file @
9499a16a
...
...
@@ -68,14 +68,10 @@ class Organization(models.Model):
def
get_org_users
(
self
,
include_app
=
False
):
from
users.models
import
User
if
self
.
is_default
():
users
=
User
.
objects
.
filter
(
orgs__isnull
=
True
)
elif
not
self
.
is_real
():
users
=
User
.
objects
.
all
()
elif
self
.
is_root
():
users
=
User
.
objects
.
all
()
else
:
if
self
.
is_real
():
users
=
self
.
users
.
all
()
else
:
users
=
User
.
objects
.
all
()
if
not
include_app
:
users
=
users
.
exclude
(
role
=
User
.
ROLE_APP
)
return
users
...
...
This diff is collapsed.
Click to expand it.
apps/users/api/user.py
View file @
9499a16a
...
...
@@ -38,10 +38,7 @@ class UserViewSet(IDInFilterMixin, BulkModelViewSet):
pagination_class
=
LimitOffsetPagination
def
get_queryset
(
self
):
queryset
=
super
()
.
get_queryset
()
if
current_org
.
is_real
()
or
current_org
.
is_default
():
org_users
=
current_org
.
get_org_users
()
queryset
=
queryset
.
filter
(
id__in
=
org_users
)
queryset
=
current_org
.
get_org_users
()
return
queryset
def
get_permissions
(
self
):
...
...
This diff is collapsed.
Click to expand it.
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