Compare commits

...

7 Commits

Author SHA1 Message Date
Jiangjie.Bai
622bef07ad fix: 修复获取类型为null的命令显示不支持的问题
fix: 修复获取类型为null的命令显示不支持的问题
2022-05-07 17:56:33 +08:00
fit2bot
a23bd4b3eb fix: 修复system-role获取users失败的问题 (#8197)
Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
2022-05-07 10:40:01 +08:00
Jiangjie.Bai
9bd9d443b4 fix: 修复windows执行ansible显示sudo失败的问题 2022-05-05 11:40:37 +08:00
feng626
e56fc93a6e fix: 组织管理员 添加 view platform perm 2022-04-28 19:10:15 +08:00
fit2bot
eb17183d97 fix: workbench_orgs 去重 (#8151)
Co-authored-by: feng626 <1304903146@qq.com>
2022-04-25 11:39:51 +08:00
feng626
b0057ecb9d perf: client download 2022-04-24 15:09:50 +08:00
ibuler
a141a8d2c2 fix: 修复社区版跳转问题 2022-04-21 22:48:34 +08:00
6 changed files with 28 additions and 31 deletions

View File

@@ -301,7 +301,7 @@ class Asset(AbsConnectivity, AbsHardwareInfo, ProtocolsMixin, NodesRelationMixin
'private_key': auth_user.private_key_file 'private_key': auth_user.private_key_file
} }
if not with_become: if not with_become or self.is_windows():
return info return info
if become_user: if become_user:

View File

@@ -8,6 +8,7 @@ from ..filters import RoleFilter
from ..serializers import RoleSerializer, RoleUserSerializer from ..serializers import RoleSerializer, RoleUserSerializer
from ..models import Role, SystemRole, OrgRole from ..models import Role, SystemRole, OrgRole
from .permission import PermissionViewSet from .permission import PermissionViewSet
from common.mixins.api import PaginatedResponseMixin
__all__ = [ __all__ = [
'RoleViewSet', 'SystemRoleViewSet', 'OrgRoleViewSet', 'RoleViewSet', 'SystemRoleViewSet', 'OrgRoleViewSet',
@@ -15,7 +16,7 @@ __all__ = [
] ]
class RoleViewSet(JMSModelViewSet): class RoleViewSet(PaginatedResponseMixin, JMSModelViewSet):
queryset = Role.objects.all() queryset = Role.objects.all()
serializer_classes = { serializer_classes = {
'default': RoleSerializer, 'default': RoleSerializer,
@@ -54,7 +55,7 @@ class RoleViewSet(JMSModelViewSet):
def users(self, *args, **kwargs): def users(self, *args, **kwargs):
role = self.get_object() role = self.get_object()
queryset = role.users queryset = role.users
return self.get_paginated_response_with_query_set(queryset) return self.get_paginated_response_from_queryset(queryset)
class SystemRoleViewSet(RoleViewSet): class SystemRoleViewSet(RoleViewSet):

View File

@@ -91,7 +91,7 @@ exclude_permissions = (
only_system_permissions = ( only_system_permissions = (
('assets', 'platform', '*', '*'), ('assets', 'platform', 'add,change,delete', 'platform'),
('users', 'user', 'delete', 'user'), ('users', 'user', 'delete', 'user'),
('rbac', 'role', 'delete,add,change', 'role'), ('rbac', 'role', 'delete,add,change', 'role'),
('rbac', 'systemrole', '*', '*'), ('rbac', 'systemrole', '*', '*'),

View File

@@ -1,6 +1,7 @@
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.db import models from django.db import models
from django.db.models import Q from django.db.models import Q
from django.conf import settings
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from rest_framework.serializers 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] system_bindings = [b for b in bindings if b.scope == Role.Scope.system.value]
# 工作台仅限于自己加入的组织 # 工作台仅限于自己加入的组织
if perm == 'rbac.view_workbench': if perm == 'rbac.view_workbench':
all_orgs = user.orgs.all() all_orgs = user.orgs.all().distinct()
else: else:
all_orgs = Organization.objects.all() all_orgs = Organization.objects.all()
if not settings.XPACK_ENABLED:
all_orgs = all_orgs.filter(id=Organization.DEFAULT_ID)
# 有系统级别的绑定,就代表在所有组织有这个权限 # 有系统级别的绑定,就代表在所有组织有这个权限
if system_bindings: if system_bindings:
orgs = all_orgs orgs = all_orgs

View File

@@ -15,45 +15,33 @@ p {
</style> </style>
<div style="margin: 0 200px"> <div style="margin: 0 200px">
<div class="group"> <div class="group">
<h2>JumpServer {% trans 'Client' %}</h2> <h2>JumpServer {% trans 'Client' %} v1.1.4</h2>
<p> <p>
{% trans 'JumpServer Client, currently used to launch the client, now only support launch RDP SSH client, The Telnet client will next' %} {% 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> </p>
<ul> <ul>
<li> <a href="/download/JumpServer-Client-Installer.msi">Windows {% 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.dmg">macOS {% trans 'Client' %}</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> </ul>
</div> </div>
<div class="group"> <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> <p>
{% trans 'macOS needs to download the client to connect RDP asset, which comes with Windows' %} {% trans 'macOS needs to download the client to connect RDP asset, which comes with Windows' %}
</p> </p>
<ul> <ul>
<li><a href="/download/Microsoft_Remote_Desktop_10.6.7_installer.pkg">Microsoft_Remote_Desktop_10.6.7_installer.pkg</a></li> <li><a href="/download/Microsoft_Remote_Desktop_10.6.7_installer.pkg">microsoft-remote-desktop-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>
</ul> </ul>
</div> </div>
{% if XPACK_ENABLED %} {% if XPACK_ENABLED %}
<div class="group"> <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> <p>{% trans 'Jmservisor is the program used to pull up remote applications in Windows Remote Application publisher' %}</p>
<ul> <ul>
<li><a href="/download/Jmservisor.msi">Jmservisor</a></li> <li><a href="/download/Jmservisor.msi">jmservisor.msi</a></li>
</ul> </ul>
</div> </div>
{% endif %} {% endif %}

View File

@@ -89,17 +89,21 @@ class CommandStorage(CommonStorageModelMixin, CommonModelMixin):
return Terminal.objects.filter(command_storage=self.name, is_deleted=False).exists() return Terminal.objects.filter(command_storage=self.name, is_deleted=False).exists()
def get_command_queryset(self): def get_command_queryset(self):
if self.type_server: if self.type_null:
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.none()
if self.type_server:
return Command.objects.all()
if self.type in TYPE_ENGINE_MAPPING:
engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type]) engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type])
qs = engine_mod.QuerySet(self.config) qs = engine_mod.QuerySet(self.config)
qs.model = Command 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, def save(self, force_insert=False, force_update=False, using=None,
update_fields=None): update_fields=None):
super().save() super().save()