mirror of https://github.com/jumpserver/jumpserver
perf: 修复一把数据 (#7789)
* fix: 优化 perm exclude * perf: 修复一把数据 perf: 修复一些数据 Co-authored-by: ibuler <ibuler@qq.com>pull/7791/head
parent
64e0860d24
commit
29b9adb684
|
@ -3,6 +3,12 @@
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
def drop_old_permissions(apps, schema_editor):
|
||||||
|
content_type_model = apps.get_model("rbac", "ContentType")
|
||||||
|
db_alias = schema_editor.connection.alias
|
||||||
|
content_type_model.objects.using(db_alias).filter(platform__startswith='Win').update(protocol='rdp')
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
@ -119,7 +119,8 @@ class AppAccountSerializer(AppSerializerMixin, AuthSerializerMixin, BulkOrgResou
|
||||||
'username': {'default': '', 'required': False},
|
'username': {'default': '', 'required': False},
|
||||||
'password': {'write_only': True},
|
'password': {'write_only': True},
|
||||||
'app_display': {'label': _('Application display')},
|
'app_display': {'label': _('Application display')},
|
||||||
'systemuser_display': {'label': _('System User')}
|
'systemuser_display': {'label': _('System User')},
|
||||||
|
'account': {'label': _('account')}
|
||||||
}
|
}
|
||||||
use_model_bulk_create = True
|
use_model_bulk_create = True
|
||||||
model_bulk_create_kwargs = {
|
model_bulk_create_kwargs = {
|
||||||
|
|
|
@ -6,6 +6,7 @@ from .. import const
|
||||||
from .base import INSTALLED_APPS, TEMPLATES
|
from .base import INSTALLED_APPS, TEMPLATES
|
||||||
|
|
||||||
XPACK_DIR = os.path.join(const.BASE_DIR, 'xpack')
|
XPACK_DIR = os.path.join(const.BASE_DIR, 'xpack')
|
||||||
|
# XPACK_ENABLED = False
|
||||||
XPACK_ENABLED = os.path.isdir(XPACK_DIR)
|
XPACK_ENABLED = os.path.isdir(XPACK_DIR)
|
||||||
XPACK_TEMPLATES_DIR = []
|
XPACK_TEMPLATES_DIR = []
|
||||||
XPACK_CONTEXT_PROCESSOR = []
|
XPACK_CONTEXT_PROCESSOR = []
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2f386ac5fff4a8cb0aeb156601148716981c2bbbb14b9162955b3d0dc95da70d
|
oid sha256:4503a69c7536bf3ae9c6ad4c7ec5e5ad48e3a1672239b8ccdb7b100cb79860c1
|
||||||
size 107823
|
size 107862
|
||||||
|
|
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: JumpServer 0.3.3\n"
|
"Project-Id-Version: JumpServer 0.3.3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-03-10 15:35+0800\n"
|
"POT-Creation-Date: 2022-03-10 10:33+0800\n"
|
||||||
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
|
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
|
||||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||||
"Language-Team: JumpServer team<ibuler@qq.com>\n"
|
"Language-Team: JumpServer team<ibuler@qq.com>\n"
|
||||||
|
@ -129,7 +129,7 @@ msgstr "登录访问控制"
|
||||||
|
|
||||||
#: acls/models/login_asset_acl.py:21
|
#: acls/models/login_asset_acl.py:21
|
||||||
#: applications/serializers/application.py:122
|
#: applications/serializers/application.py:122
|
||||||
#: applications/serializers/application.py:166
|
#: applications/serializers/application.py:167
|
||||||
msgid "System User"
|
msgid "System User"
|
||||||
msgstr "系统用户"
|
msgstr "系统用户"
|
||||||
|
|
||||||
|
@ -397,10 +397,14 @@ msgid "Date updated"
|
||||||
msgstr "更新日期"
|
msgstr "更新日期"
|
||||||
|
|
||||||
#: applications/serializers/application.py:121
|
#: applications/serializers/application.py:121
|
||||||
#: applications/serializers/application.py:165
|
#: applications/serializers/application.py:166
|
||||||
msgid "Application display"
|
msgid "Application display"
|
||||||
msgstr "应用名称"
|
msgstr "应用名称"
|
||||||
|
|
||||||
|
#: applications/serializers/application.py:123
|
||||||
|
msgid "account"
|
||||||
|
msgstr "账号"
|
||||||
|
|
||||||
#: applications/serializers/attrs/application_category/cloud.py:8
|
#: applications/serializers/attrs/application_category/cloud.py:8
|
||||||
#: assets/models/cluster.py:40
|
#: assets/models/cluster.py:40
|
||||||
msgid "Cluster"
|
msgid "Cluster"
|
||||||
|
|
|
@ -26,6 +26,9 @@ user_perms = (
|
||||||
('rbac', 'menupermission', 'view', 'filemanager'),
|
('rbac', 'menupermission', 'view', 'filemanager'),
|
||||||
('perms', 'permedasset', 'view,connect', 'myassets'),
|
('perms', 'permedasset', 'view,connect', 'myassets'),
|
||||||
('perms', 'permedapplication', 'view,connect', 'myapps'),
|
('perms', 'permedapplication', 'view,connect', 'myapps'),
|
||||||
|
('perms', 'permedkubernetesapp', 'view,connect', 'mykubernetesapp'),
|
||||||
|
('perms', 'permedremoteApp', 'view,connect', 'myremoteapp'),
|
||||||
|
('perms', 'permeddatabaseapp', 'view,connect', 'mydatabaseapp'),
|
||||||
('assets', 'asset', 'match', 'asset'),
|
('assets', 'asset', 'match', 'asset'),
|
||||||
('assets', 'systemuser', 'match', 'systemuser'),
|
('assets', 'systemuser', 'match', 'systemuser'),
|
||||||
('assets', 'node', 'match', 'node'),
|
('assets', 'node', 'match', 'node'),
|
||||||
|
|
|
@ -26,9 +26,6 @@ exclude_permissions = (
|
||||||
('users', 'userpasswordhistory', '*', '*'),
|
('users', 'userpasswordhistory', '*', '*'),
|
||||||
('applications', 'applicationuser', '*', '*'),
|
('applications', 'applicationuser', '*', '*'),
|
||||||
('applications', 'historicalaccount', '*', '*'),
|
('applications', 'historicalaccount', '*', '*'),
|
||||||
('applications', 'databaseapp', '*', '*'),
|
|
||||||
('applications', 'k8sapp', '*', '*'),
|
|
||||||
('applications', 'remoteapp', '*', '*'),
|
|
||||||
('assets', 'adminuser', '*', '*'),
|
('assets', 'adminuser', '*', '*'),
|
||||||
('assets', 'assetgroup', '*', '*'),
|
('assets', 'assetgroup', '*', '*'),
|
||||||
('assets', 'cluster', '*', '*'),
|
('assets', 'cluster', '*', '*'),
|
||||||
|
|
|
@ -8,6 +8,7 @@ def delete_unused_permissions(apps, schema_editor):
|
||||||
content_type_model = apps.get_model('rbac', 'ContentType')
|
content_type_model = apps.get_model('rbac', 'ContentType')
|
||||||
content_type_delete_required = [
|
content_type_delete_required = [
|
||||||
('common', 'permission'),
|
('common', 'permission'),
|
||||||
|
('applications', 'k8sapp'),
|
||||||
]
|
]
|
||||||
for app, model in content_type_delete_required:
|
for app, model in content_type_delete_required:
|
||||||
content_type_model.objects.filter(app_label=app, model=model).delete()
|
content_type_model.objects.filter(app_label=app, model=model).delete()
|
||||||
|
|
|
@ -72,7 +72,7 @@ special_pid_mapper = {
|
||||||
'xpack.applicationchangeauthplanexecution': 'app_change_plan_node',
|
'xpack.applicationchangeauthplanexecution': 'app_change_plan_node',
|
||||||
'xpack.applicationchangeauthplantask': 'app_change_plan_node',
|
'xpack.applicationchangeauthplantask': 'app_change_plan_node',
|
||||||
'xpack.changeauthplan': 'asset_change_plan_node',
|
'xpack.changeauthplan': 'asset_change_plan_node',
|
||||||
'xpack.changeauthplanexecution': 'asset_change_plan_node',
|
'xpack.changeauthplanexecution': 'gather_account_node',
|
||||||
'xpack.changeauthplantask': 'asset_change_plan_node',
|
'xpack.changeauthplantask': 'asset_change_plan_node',
|
||||||
"assets.gathereduser": "gather_account_node",
|
"assets.gathereduser": "gather_account_node",
|
||||||
'xpack.gatherusertask': 'gather_account_node',
|
'xpack.gatherusertask': 'gather_account_node',
|
||||||
|
@ -91,6 +91,12 @@ special_pid_mapper = {
|
||||||
'perms.view_myapps': 'my_apps',
|
'perms.view_myapps': 'my_apps',
|
||||||
'perms.connect_myapps': 'my_apps',
|
'perms.connect_myapps': 'my_apps',
|
||||||
'ops.commandexecution': 'view_workspace',
|
'ops.commandexecution': 'view_workspace',
|
||||||
|
"perms.view_mykubernetsapp": "my_apps",
|
||||||
|
"perms.connect_mykubernetsapp": "my_apps",
|
||||||
|
"perms.view_myremoteapp": "my_apps",
|
||||||
|
"perms.connect_myremoteapp": "my_apps",
|
||||||
|
"perms.view_mydatabaseapp": "my_apps",
|
||||||
|
"perms.connect_mydatabaseapp": "my_apps",
|
||||||
}
|
}
|
||||||
|
|
||||||
verbose_name_mapper = {
|
verbose_name_mapper = {
|
||||||
|
@ -100,7 +106,9 @@ verbose_name_mapper = {
|
||||||
}
|
}
|
||||||
|
|
||||||
xpack_nodes = [
|
xpack_nodes = [
|
||||||
'xpack', 'tickets',
|
'xpack', 'tickets', 'applications.remoteapp',
|
||||||
|
"assets.accountbackupplan", "assets.accountbackupplanexecution",
|
||||||
|
"rbac.orgrole", "rbac.orgrolebinding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue