diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index 3b8f2dbb9..09c5dcd3d 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -386,8 +386,12 @@ def get_members(tenant_id): - COALESCE(basic_authentication.invited_at,'2000-01-01'::timestamp ))>=1 AS expired_invitation, basic_authentication.password IS NOT NULL AS joined, invitation_token, - role_id - FROM public.users LEFT JOIN public.basic_authentication ON users.user_id=basic_authentication.user_id + role_id, + roles.name AS role_name, + roles.permissions + FROM public.users + LEFT JOIN public.basic_authentication ON users.user_id=basic_authentication.user_id + LEFT JOIN public.roles USING (role_id) WHERE users.tenant_id = %(tenantId)s AND users.deleted_at IS NULL ORDER BY name, id""", {"tenantId": tenant_id})