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
4057064b
Commit
4057064b
authored
Nov 12, 2019
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改获取系统用户-资产-认证信息API,添加 NeedMFAVerify 权限类
parent
200ca65d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
system_user.py
apps/assets/api/system_user.py
+7
-1
No files found.
apps/assets/api/system_user.py
View file @
4057064b
...
...
@@ -14,11 +14,12 @@
# limitations under the License.
from
django.shortcuts
import
get_object_or_404
from
django.conf
import
settings
from
rest_framework.response
import
Response
from
common.serializers
import
CeleryTaskSerializer
from
common.utils
import
get_logger
from
common.permissions
import
IsOrgAdmin
,
IsOrgAdminOrAppUser
from
common.permissions
import
IsOrgAdmin
,
IsOrgAdminOrAppUser
,
NeedMFAVerify
from
orgs.mixins.api
import
OrgBulkModelViewSet
from
orgs.mixins
import
generics
from
..models
import
SystemUser
,
Asset
...
...
@@ -72,6 +73,11 @@ class SystemUserAssetAuthInfoApi(generics.RetrieveAPIView):
permission_classes
=
(
IsOrgAdminOrAppUser
,)
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