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
2c413e8d
Commit
2c413e8d
authored
Jun 06, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复权限查看引起的bug
parent
482d1bb2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
utils.py
apps/perms/utils.py
+2
-2
No files found.
apps/perms/utils.py
View file @
2c413e8d
...
...
@@ -14,7 +14,7 @@ logger = get_logger(__file__)
def
get_user_permissions
(
user
,
include_group
=
True
):
if
include_group
:
groups
=
user
.
groups
.
all
()
arg
=
Q
(
users
=
user
)
|
Q
(
user_groups
=
groups
)
arg
=
Q
(
users
=
user
)
|
Q
(
user_groups
__in
=
groups
)
else
:
arg
=
Q
(
users
=
user
)
return
AssetPermission
.
objects
.
all
()
.
valid
()
.
filter
(
arg
)
...
...
@@ -29,7 +29,7 @@ def get_user_group_permissions(user_group):
def
get_asset_permissions
(
asset
,
include_node
=
True
):
if
include_node
:
nodes
=
asset
.
get_all_nodes
(
flat
=
True
)
arg
=
Q
(
assets
=
asset
)
|
Q
(
nodes
=
nodes
)
arg
=
Q
(
assets
=
asset
)
|
Q
(
nodes
__in
=
nodes
)
else
:
arg
=
Q
(
assets
=
asset
)
return
AssetPermission
.
objects
.
all
()
.
valid
()
.
filter
(
arg
)
...
...
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