mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-08 12:29:06 +00:00
fix: check_api
This commit is contained in:
parent
77d8083c00
commit
f5d40a787e
@ -71,6 +71,7 @@ known_unauth_urls = [
|
|||||||
"/api/v1/authentication/mfa/select/",
|
"/api/v1/authentication/mfa/select/",
|
||||||
"/api/v1/authentication/mfa/send-code/",
|
"/api/v1/authentication/mfa/send-code/",
|
||||||
"/api/v1/authentication/sso/login/"
|
"/api/v1/authentication/sso/login/"
|
||||||
|
"/api/v1/authentication/user-session/"
|
||||||
]
|
]
|
||||||
|
|
||||||
known_error_urls = [
|
known_error_urls = [
|
||||||
@ -91,7 +92,6 @@ class Command(BaseCommand):
|
|||||||
unauth_urls = []
|
unauth_urls = []
|
||||||
error_urls = []
|
error_urls = []
|
||||||
unformat_urls = []
|
unformat_urls = []
|
||||||
|
|
||||||
for url, ourl in urls:
|
for url, ourl in urls:
|
||||||
if '(' in url or '<' in url:
|
if '(' in url or '<' in url:
|
||||||
unformat_urls.append([url, ourl])
|
unformat_urls.append([url, ourl])
|
||||||
|
@ -9,7 +9,13 @@ __all__ = ['IsSessionAssignee']
|
|||||||
|
|
||||||
class IsSessionAssignee(permissions.IsAuthenticated):
|
class IsSessionAssignee(permissions.IsAuthenticated):
|
||||||
def has_permission(self, request, view):
|
def has_permission(self, request, view):
|
||||||
|
if not request.user:
|
||||||
|
return False
|
||||||
|
if request.user.is_anonymous:
|
||||||
|
return False
|
||||||
|
if view.action == 'retrieve':
|
||||||
return True
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def has_object_permission(self, request, view, obj):
|
def has_object_permission(self, request, view, obj):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user