From 1a8bc043f3a51a71e241dbc19c5824949577c0b8 Mon Sep 17 00:00:00 2001 From: Tassilo Weidner Date: Mon, 9 Dec 2019 09:27:34 +0100 Subject: [PATCH] fix(rest): make group query in check auth resource unlimited related to CAM-11148 --- .../engine/rest/impl/AuthorizationRestServiceImpl.java | 8 ++++++-- .../rest/AuthorizationRestServiceInteractionTest.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/AuthorizationRestServiceImpl.java b/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/AuthorizationRestServiceImpl.java index fc7e3c4db66..3c4d83a54e0 100644 --- a/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/AuthorizationRestServiceImpl.java +++ b/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/AuthorizationRestServiceImpl.java @@ -204,11 +204,15 @@ protected IdentityService getIdentityService() { } protected List getUserGroups(String userId) { - List groupIds= new ArrayList<>(); - List userGroups = getIdentityService().createGroupQuery().groupMember(userId).list(); + List userGroups = getIdentityService().createGroupQuery() + .groupMember(userId) + .unlimitedList(); + + List groupIds = new ArrayList<>(); for (Group group : userGroups) { groupIds.add(group.getId()); } + return groupIds; } diff --git a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/AuthorizationRestServiceInteractionTest.java b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/AuthorizationRestServiceInteractionTest.java index 194fa16fd92..44bfd9d6fbe 100644 --- a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/AuthorizationRestServiceInteractionTest.java +++ b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/AuthorizationRestServiceInteractionTest.java @@ -1109,7 +1109,7 @@ protected List setupGroupQueryMock() { List groupMocks = MockProvider.createMockGroups(); when(identityServiceMock.createGroupQuery()).thenReturn(mockGroupQuery); when(mockGroupQuery.groupMember(anyString())).thenReturn(mockGroupQuery); - when(mockGroupQuery.list()).thenReturn(groupMocks); + when(mockGroupQuery.unlimitedList()).thenReturn(groupMocks); List groupIds = new ArrayList(); for (Group group : groupMocks) { groupIds.add(group.getId());