mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-03 20:29:39 +00:00
* perf(orgs): 默认组织改为实体组织 * perf: 添加获取当前组织信息的api * perf: 资产列表在 root 组织下的表现 * fix: 修复 root 组织引起的问题 * perf: 优化OrgModelMixin save; org_root获取; org_roles获取; UserCanUseCurrentOrg权限类 Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Bai <bugatti_it@163.com>
16 lines
399 B
Python
16 lines
399 B
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
from .. import utils
|
|
from users.models import User
|
|
|
|
from orgs.utils import current_org
|
|
|
|
|
|
class UserQuerysetMixin:
|
|
def get_queryset(self):
|
|
if self.request.query_params.get('all') or current_org.is_root():
|
|
queryset = User.objects.exclude(role=User.ROLE.APP)
|
|
else:
|
|
queryset = utils.get_current_org_members()
|
|
return queryset
|