From 95380eac89442f7a25cc9fe691aca75eff0d4069 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Fri, 14 Aug 2026 00:03:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(ram):=20App=20=E5=AE=89=E8=A3=85=20API=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20GrantRoles=EF=BC=88=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E6=97=B6=20RAM=20=E8=A7=92=E8=89=B2=E6=8E=88=E6=9D=83=EF=BC=89?= =?UTF-8?q?+=20ManageCompanies=20=E8=BF=94=E5=9B=9E=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gvsds/apps/gerp/views/app.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gvsds/apps/gerp/views/app.py b/gvsds/apps/gerp/views/app.py index 9122d470..b02dc0bc 100644 --- a/gvsds/apps/gerp/views/app.py +++ b/gvsds/apps/gerp/views/app.py @@ -221,7 +221,15 @@ class AppManageCompaniesView(ELTAuthenticatedAPIView): if app_uuid_str: row['Installed'] = 1 if install_map.get(c, 0) else 0 rows.append(row) - return Response({'code': 0, 'data': {'Scope': scope, 'Companies': rows}}) + # RAM 角色粒度授权候选:当前租户启用角色列表(安装弹窗选角色用) + roles = [] + tenant_bytes = _GetTenantBytes(request) + if tenant_bytes: + from gvsdsdk.models import Role as SdkRole + for r in SdkRole.objects.filter( + TenantUUID=tenant_bytes, RoleStatus=1).order_by('RoleName'): + roles.append({'RoleUUID': UUIDObj(r.RoleUUID).str, 'RoleName': r.RoleName}) + return Response({'code': 0, 'data': {'Scope': scope, 'Companies': rows, 'Roles': roles}}) class AppInstallView(ELTAuthenticatedAPIView):