mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-12-15 08:32:48 +00:00
Compare commits
7 Commits
revert-162
...
v2.21.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
622bef07ad | ||
|
|
a23bd4b3eb | ||
|
|
9bd9d443b4 | ||
|
|
e56fc93a6e | ||
|
|
eb17183d97 | ||
|
|
b0057ecb9d | ||
|
|
a141a8d2c2 |
@@ -301,7 +301,7 @@ class Asset(AbsConnectivity, AbsHardwareInfo, ProtocolsMixin, NodesRelationMixin
|
||||
'private_key': auth_user.private_key_file
|
||||
}
|
||||
|
||||
if not with_become:
|
||||
if not with_become or self.is_windows():
|
||||
return info
|
||||
|
||||
if become_user:
|
||||
|
||||
@@ -8,6 +8,7 @@ from ..filters import RoleFilter
|
||||
from ..serializers import RoleSerializer, RoleUserSerializer
|
||||
from ..models import Role, SystemRole, OrgRole
|
||||
from .permission import PermissionViewSet
|
||||
from common.mixins.api import PaginatedResponseMixin
|
||||
|
||||
__all__ = [
|
||||
'RoleViewSet', 'SystemRoleViewSet', 'OrgRoleViewSet',
|
||||
@@ -15,7 +16,7 @@ __all__ = [
|
||||
]
|
||||
|
||||
|
||||
class RoleViewSet(JMSModelViewSet):
|
||||
class RoleViewSet(PaginatedResponseMixin, JMSModelViewSet):
|
||||
queryset = Role.objects.all()
|
||||
serializer_classes = {
|
||||
'default': RoleSerializer,
|
||||
@@ -54,7 +55,7 @@ class RoleViewSet(JMSModelViewSet):
|
||||
def users(self, *args, **kwargs):
|
||||
role = self.get_object()
|
||||
queryset = role.users
|
||||
return self.get_paginated_response_with_query_set(queryset)
|
||||
return self.get_paginated_response_from_queryset(queryset)
|
||||
|
||||
|
||||
class SystemRoleViewSet(RoleViewSet):
|
||||
|
||||
@@ -91,7 +91,7 @@ exclude_permissions = (
|
||||
|
||||
|
||||
only_system_permissions = (
|
||||
('assets', 'platform', '*', '*'),
|
||||
('assets', 'platform', 'add,change,delete', 'platform'),
|
||||
('users', 'user', 'delete', 'user'),
|
||||
('rbac', 'role', 'delete,add,change', 'role'),
|
||||
('rbac', 'systemrole', '*', '*'),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from rest_framework.serializers import ValidationError
|
||||
|
||||
@@ -111,10 +112,13 @@ class RoleBinding(JMSModel):
|
||||
system_bindings = [b for b in bindings if b.scope == Role.Scope.system.value]
|
||||
# 工作台仅限于自己加入的组织
|
||||
if perm == 'rbac.view_workbench':
|
||||
all_orgs = user.orgs.all()
|
||||
all_orgs = user.orgs.all().distinct()
|
||||
else:
|
||||
all_orgs = Organization.objects.all()
|
||||
|
||||
if not settings.XPACK_ENABLED:
|
||||
all_orgs = all_orgs.filter(id=Organization.DEFAULT_ID)
|
||||
|
||||
# 有系统级别的绑定,就代表在所有组织有这个权限
|
||||
if system_bindings:
|
||||
orgs = all_orgs
|
||||
|
||||
@@ -15,45 +15,33 @@ p {
|
||||
</style>
|
||||
<div style="margin: 0 200px">
|
||||
<div class="group">
|
||||
<h2>JumpServer {% trans 'Client' %}</h2>
|
||||
<h2>JumpServer {% trans 'Client' %} v1.1.4</h2>
|
||||
<p>
|
||||
{% trans 'JumpServer Client, currently used to launch the client, now only support launch RDP SSH client, The Telnet client will next' %}
|
||||
{# //JumpServer 客户端,支持 RDP 的本地拉起,后续会支持拉起 ssh。#}
|
||||
</p>
|
||||
<ul>
|
||||
<li> <a href="/download/JumpServer-Client-Installer.msi">Windows {% trans 'Client' %}</a></li>
|
||||
<li> <a href="/download/JumpServer-Client-Installer.dmg">macOS {% trans 'Client' %}</a></li>
|
||||
<li> <a href="/download/JumpServer-Client-Installer-x86_64.msi">jumpserver-client-windows-x86_64.msi</a></li>
|
||||
<li> <a href="/download/JumpServer-Client-Installer-arm64.msi">jumpserver-client-windows-arm64.msi</a></li>
|
||||
<li> <a href="/download/JumpServer-Client-Installer.dmg">jumpserver-client-darwin.dmg</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="group">
|
||||
<h2>{% trans 'Microsoft' %} RDP {% trans 'Official' %}{% trans 'Client' %}</h2>
|
||||
<h2>{% trans 'Microsoft' %} RDP {% trans 'Official' %}{% trans 'Client' %} v10.6.7</h2>
|
||||
<p>
|
||||
{% trans 'macOS needs to download the client to connect RDP asset, which comes with Windows' %}
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="/download/Microsoft_Remote_Desktop_10.6.7_installer.pkg">Microsoft_Remote_Desktop_10.6.7_installer.pkg</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="group">
|
||||
<h2>SSH {% trans 'Client' %}</h2>
|
||||
<p>
|
||||
{% trans 'Windows needs to download the client to connect SSH assets, and the MacOS system uses its own terminal' %}
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="/download/putty/w64/putty.exe">64-bit x86: Putty.exe</a></li>
|
||||
<li><a href="/download/putty/wa64/putty.exe">64-bit Arm: Putty.exe</a></li>
|
||||
<li><a href="/download/putty/w32/putty.exe">32-bit x86: Putty.exe</a></li>
|
||||
<li><a href="/download/Microsoft_Remote_Desktop_10.6.7_installer.pkg">microsoft-remote-desktop-installer.pkg</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if XPACK_ENABLED %}
|
||||
<div class="group">
|
||||
<h2>{% trans 'Windows Remote application publisher tools' %}</h2>
|
||||
<h2>{% trans 'Windows Remote application publisher tools' %} v2.0</h2>
|
||||
<p>{% trans 'Jmservisor is the program used to pull up remote applications in Windows Remote Application publisher' %}</p>
|
||||
<ul>
|
||||
<li><a href="/download/Jmservisor.msi">Jmservisor</a></li>
|
||||
<li><a href="/download/Jmservisor.msi">jmservisor.msi</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -89,16 +89,20 @@ class CommandStorage(CommonStorageModelMixin, CommonModelMixin):
|
||||
return Terminal.objects.filter(command_storage=self.name, is_deleted=False).exists()
|
||||
|
||||
def get_command_queryset(self):
|
||||
if self.type_null:
|
||||
return Command.objects.none()
|
||||
|
||||
if self.type_server:
|
||||
qs = Command.objects.all()
|
||||
else:
|
||||
if self.type not in TYPE_ENGINE_MAPPING:
|
||||
logger.error(f'Command storage `{self.type}` not support')
|
||||
return Command.objects.none()
|
||||
return Command.objects.all()
|
||||
|
||||
if self.type in TYPE_ENGINE_MAPPING:
|
||||
engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type])
|
||||
qs = engine_mod.QuerySet(self.config)
|
||||
qs.model = Command
|
||||
return qs
|
||||
return qs
|
||||
|
||||
logger.error(f'Command storage `{self.type}` not support')
|
||||
return Command.objects.none()
|
||||
|
||||
def save(self, force_insert=False, force_update=False, using=None,
|
||||
update_fields=None):
|
||||
|
||||
Reference in New Issue
Block a user