fix: 修复社区版跳转问题

pull/8141/head
ibuler 2022-04-21 22:37:29 +08:00 committed by 老广
parent a6d61721dd
commit d25cde1bd5
1 changed files with 4 additions and 0 deletions

View File

@ -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
@ -115,6 +116,9 @@ class RoleBinding(JMSModel):
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