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
e731c01c
Commit
e731c01c
authored
Nov 13, 2019
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改 sytem-user-asset-auth-info API 的权限(只允许 App)访问
parent
6067dbcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
system_user.py
apps/assets/api/system_user.py
+2
-7
No files found.
apps/assets/api/system_user.py
View file @
e731c01c
...
...
@@ -19,7 +19,7 @@ from rest_framework.response import Response
from
common.serializers
import
CeleryTaskSerializer
from
common.utils
import
get_logger
from
common.permissions
import
IsOrgAdmin
,
IsOrgAdminOrAppUser
,
NeedMFAVerify
from
common.permissions
import
IsOrgAdmin
,
IsOrgAdminOrAppUser
,
IsAppUser
from
orgs.mixins.api
import
OrgBulkModelViewSet
from
orgs.mixins
import
generics
from
..models
import
SystemUser
,
Asset
...
...
@@ -70,14 +70,9 @@ class SystemUserAssetAuthInfoApi(generics.RetrieveAPIView):
Get system user with asset auth info
"""
model
=
SystemUser
permission_classes
=
(
Is
OrgAdminOr
AppUser
,)
permission_classes
=
(
IsAppUser
,)
serializer_class
=
serializers
.
SystemUserAuthSerializer
def
get_permissions
(
self
):
if
settings
.
CONFIG
.
SECURITY_VIEW_AUTH_NEED_MFA
:
self
.
permission_classes
=
(
IsOrgAdminOrAppUser
,
NeedMFAVerify
)
return
super
()
.
get_permissions
()
def
get_object
(
self
):
instance
=
super
()
.
get_object
()
aid
=
self
.
kwargs
.
get
(
'aid'
)
...
...
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