diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCE.java index 8a2fe482bf..82f295645d 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCE.java @@ -27,6 +27,8 @@ public interface ActionCollectionServiceCE extends CrudService saveAll(List collections); + Mono findByIdAndBranchName(String id, String branchName); + Flux getPopulatedActionCollectionsByViewMode( MultiValueMap params, Boolean viewMode); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java index 1686d2c1af..6906857d3d 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java @@ -17,6 +17,10 @@ import java.util.Optional; public interface ApplicationServiceCE extends CrudService { + Mono getById(String id); + + Mono findByIdAndBranchName(String id, String branchName); + Mono findByIdAndBranchName(String id, List projectionFieldNames, String branchName); Mono findById(String id); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java index 9449967e8a..53ced69c3e 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java @@ -75,7 +75,7 @@ public class UpdateLayoutServiceCEImpl implements UpdateLayoutServiceCE { boolean isSuccess, Throwable error, CreatorContextType creatorType) { - return Mono.zip(sessionUserService.getCurrentUser(), newPageService.getById(creatorId)) + return Mono.zip(sessionUserService.getCurrentUser(), newPageService.getByIdWithoutPermissionCheck(creatorId)) .flatMap(tuple -> { User t1 = tuple.getT1(); NewPage t2 = tuple.getT2(); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCE.java index 55bd6bde08..734c043163 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCE.java @@ -29,6 +29,8 @@ public interface NewActionServiceCE extends CrudService { void setCommonFieldsFromActionDTOIntoNewAction(ActionDTO action, NewAction newAction); + Mono findByIdAndBranchName(String id, String branchName); + ActionDTO generateActionByViewMode(NewAction newAction, Boolean viewMode); void generateAndSetActionPolicies(NewPage page, NewAction action); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCEImpl.java index d0f789f66e..fe280730b7 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCEImpl.java @@ -653,7 +653,7 @@ public class NewActionServiceCEImpl extends BaseService extractAndSetNativeQueryFromFormData(NewAction action) { - Mono pluginMono = pluginService.getById(action.getPluginId()); + Mono pluginMono = pluginService.getByIdWithoutPermissionCheck(action.getPluginId()); Mono pluginExecutorMono = pluginExecutorHelper.getPluginExecutor(pluginMono); return pluginExecutorMono @@ -1175,7 +1175,7 @@ public class NewActionServiceCEImpl extends BaseService fillSelfReferencingDataPaths(ActionDTO actionDTO) { - Mono pluginMono = pluginService.getById(actionDTO.getPluginId()); + Mono pluginMono = pluginService.getByIdWithoutPermissionCheck(actionDTO.getPluginId()); Mono pluginExecutorMono = pluginExecutorHelper.getPluginExecutor(pluginMono); return pluginExecutorMono.map(pluginExecutor -> { diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/base/NewPageServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/base/NewPageServiceCE.java index fbb8162bfc..4ff02f8620 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/base/NewPageServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/base/NewPageServiceCE.java @@ -30,6 +30,8 @@ public interface NewPageServiceCE extends CrudService { Flux findNewPagesByApplicationId(String applicationId, AclPermission permission); + Mono findByIdAndBranchName(String id, String branchName); + Mono saveUnpublishedPage(PageDTO page); Mono createDefault(PageDTO object); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java index 75eeb0f792..d47c7ca09f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/refactors/applications/RefactoringServiceCEImpl.java @@ -204,7 +204,7 @@ public class RefactoringServiceCEImpl implements RefactoringServiceCE { Map analyticsProperties) { return contextIdMono.flatMap(branchedPageId -> { refactorEntityNameDTO.setPageId(branchedPageId); - return newPageService.getById(branchedPageId).map(page -> { + return newPageService.getByIdWithoutPermissionCheck(branchedPageId).map(page -> { analyticsProperties.put(FieldName.APPLICATION_ID, page.getApplicationId()); analyticsProperties.put(FieldName.PAGE_ID, refactorEntityNameDTO.getPageId()); return analyticsProperties; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/BaseService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/BaseService.java index 8598724571..4c9fcf3c86 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/BaseService.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/BaseService.java @@ -62,7 +62,7 @@ public abstract class BaseService< } @Override - public Mono getById(ID id) { + public Mono getByIdWithoutPermissionCheck(ID id) { if (id == null) { return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.ID)); } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CrudService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CrudService.java index 0ead1a370f..fad5880539 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CrudService.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CrudService.java @@ -16,11 +16,7 @@ public interface CrudService { Mono update(ID id, T resource); - Mono getById(ID id); - - default Mono findByIdAndBranchName(ID id, String branchName) { - return this.getById(id); - } + Mono getByIdWithoutPermissionCheck(ID id); Map getAnalyticsProperties(T savedResource); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java index c6c4936811..11d738918e 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java @@ -78,7 +78,7 @@ public class LayoutActionServiceCEImpl implements LayoutActionServiceCE { } else if (action.getCollectionId().length() == 0) { // The Action has been removed from existing collection. return newActionService - .getById(id) + .getByIdWithoutPermissionCheck(id) .flatMap(action1 -> collectionService.removeSingleActionFromCollection( action1.getUnpublishedAction().getCollectionId(), Mono.just(action1))) .flatMap(action1 -> { @@ -93,7 +93,7 @@ public class LayoutActionServiceCEImpl implements LayoutActionServiceCE { // collection. // Remove the action from previous collection and add it to the new collection. return newActionService - .getById(id) + .getByIdWithoutPermissionCheck(id) .flatMap(action1 -> { if (action1.getUnpublishedAction().getCollectionId() != null) { return collectionService.removeSingleActionFromCollection( diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/WorkspaceServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/WorkspaceServiceCE.java index 438144a97a..0e737c2b14 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/WorkspaceServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/WorkspaceServiceCE.java @@ -21,6 +21,8 @@ public interface WorkspaceServiceCE extends CrudService { Mono create(Workspace workspace, User user, Boolean isDefault); + Mono getById(String id); + Mono findById(String id, AclPermission permission); Mono findById(String id, Optional permission); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java index 18bba2e575..47d1918bdb 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImpl.java @@ -1000,7 +1000,7 @@ public class ActionExecutionSolutionCEImpl implements ActionExecutionSolutionCE Mono.just(application), sessionUserService.getCurrentUser(), newPageService.getNameByPageId(actionDTO.getPageId(), executeActionDto.getViewMode()), - pluginService.getById(actionDTO.getPluginId()), + pluginService.getByIdWithoutPermissionCheck(actionDTO.getPluginId()), datasourceStorageService.getEnvironmentNameFromEnvironmentIdForAnalytics( datasourceStorage.getEnvironmentId()))) .flatMap(tuple -> { diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/themes/base/ThemeServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/themes/base/ThemeServiceCEImpl.java index 34c1b56e1e..158bc5433a 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/themes/base/ThemeServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/themes/base/ThemeServiceCEImpl.java @@ -61,7 +61,7 @@ public class ThemeServiceCEImpl extends BaseService getById(String s) { + public Mono getByIdWithoutPermissionCheck(String s) { // we don't allow to get a theme by id from DB throw new AppsmithException(AppsmithError.UNSUPPORTED_OPERATION); } diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java index 563bb9acf5..ad19c18564 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java @@ -1952,7 +1952,7 @@ public class ImportServiceTests { action.setPageId(application.getPages().get(0).getId()); return layoutActionService.createAction(action); }) - .flatMap(actionDTO -> newActionService.getById(actionDTO.getId())) + .flatMap(actionDTO -> newActionService.getByIdWithoutPermissionCheck(actionDTO.getId())) .flatMap(newAction -> applicationRepository.findById(newAction.getApplicationId())) .cache(); @@ -2055,7 +2055,8 @@ public class ImportServiceTests { return layoutCollectionService.createCollection(actionCollectionDTO1, null); }) - .flatMap(actionCollectionDTO -> actionCollectionService.getById(actionCollectionDTO.getId())) + .flatMap(actionCollectionDTO -> + actionCollectionService.getByIdWithoutPermissionCheck(actionCollectionDTO.getId())) .flatMap(actionCollection -> applicationRepository.findById(actionCollection.getApplicationId())) .cache(); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java index 0625256862..3c26bb00a5 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java @@ -168,7 +168,8 @@ class RefactoringServiceCEImplTest { layout1.setId("testLayoutId"); layout1.setDsl(jsonObject); pageDTO.setLayouts(List.of(layout1)); - Mockito.when(newPageService.getById(Mockito.anyString())).thenReturn(Mono.just(newPage)); + Mockito.when(newPageService.getByIdWithoutPermissionCheck(Mockito.anyString())) + .thenReturn(Mono.just(newPage)); Mockito.when(newPageService.findPageById(Mockito.anyString(), Mockito.any(), Mockito.anyBoolean())) .thenReturn(Mono.just(pageDTO)); @@ -242,7 +243,8 @@ class RefactoringServiceCEImplTest { newPage.setUnpublishedPage(pageDTO); Mockito.when(newPageService.findPageById(Mockito.anyString(), Mockito.any(), Mockito.anyBoolean())) .thenReturn(Mono.just(pageDTO)); - Mockito.when(newPageService.getById(Mockito.anyString())).thenReturn(Mono.just(newPage)); + Mockito.when(newPageService.getByIdWithoutPermissionCheck(Mockito.anyString())) + .thenReturn(Mono.just(newPage)); final Mono layoutDTOMono = refactoringServiceCE.refactorEntityName(refactorActionCollectionNameDTO, null); @@ -295,7 +297,8 @@ class RefactoringServiceCEImplTest { layout1.setId("testLayoutId"); layout1.setDsl(new JSONObject()); pageDTO.setLayouts(List.of(layout1)); - Mockito.when(newPageService.getById(Mockito.anyString())).thenReturn(Mono.just(newPage)); + Mockito.when(newPageService.getByIdWithoutPermissionCheck(Mockito.anyString())) + .thenReturn(Mono.just(newPage)); Mockito.when(newPageService.findPageById(Mockito.anyString(), Mockito.any(), Mockito.anyBoolean())) .thenReturn(Mono.just(pageDTO)); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCETest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCETest.java index b16cee0402..abe0608c98 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCETest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCETest.java @@ -812,7 +812,7 @@ class RefactoringServiceCETest { assert createdActionCollectionDTO1 != null; final Mono actionCollectionMono = - actionCollectionService.getById(createdActionCollectionDTO1.getId()); + actionCollectionService.getByIdWithoutPermissionCheck(createdActionCollectionDTO1.getId()); final Mono actionMono = newActionService .findByCollectionIdAndViewMode(createdActionCollectionDTO1.getId(), false, null) .next(); @@ -881,7 +881,7 @@ class RefactoringServiceCETest { final Mono> tuple2Mono = refactoringService .refactorEntityName(refactorActionNameInCollectionDTO, null) .then(actionCollectionService - .getById(dto.getId()) + .getByIdWithoutPermissionCheck(dto.getId()) .zipWith(newActionService.findById( dto.getActions().get(0).getId()))); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java index 968fda5113..661c0bcea9 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java @@ -467,7 +467,7 @@ public class ActionCollectionServiceTest { assert createdActionCollectionDTO2 != null; final Mono actionCollectionMono = - actionCollectionService.getById(createdActionCollectionDTO2.getId()); + actionCollectionService.getByIdWithoutPermissionCheck(createdActionCollectionDTO2.getId()); StepVerifier.create(actionCollectionMono) .assertNext(actionCollection -> { @@ -477,10 +477,11 @@ public class ActionCollectionServiceTest { }) .verifyComplete(); - final Mono actionMono = newActionService.getById(createdActionCollectionDTO2.getActions().stream() - .findFirst() - .get() - .getId()); + final Mono actionMono = + newActionService.getByIdWithoutPermissionCheck(createdActionCollectionDTO2.getActions().stream() + .findFirst() + .get() + .getId()); StepVerifier.create(actionMono) .assertNext(action -> { @@ -561,7 +562,7 @@ public class ActionCollectionServiceTest { assert createdActionCollectionDTO2 != null; final Mono actionCollectionMono = - actionCollectionService.getById(createdActionCollectionDTO2.getId()); + actionCollectionService.getByIdWithoutPermissionCheck(createdActionCollectionDTO2.getId()); StepVerifier.create(actionCollectionMono) .assertNext(actionCollection -> { @@ -571,10 +572,11 @@ public class ActionCollectionServiceTest { }) .verifyComplete(); - final Mono actionMono = newActionService.getById(createdActionCollectionDTO2.getActions().stream() - .findFirst() - .get() - .getId()); + final Mono actionMono = + newActionService.getByIdWithoutPermissionCheck(createdActionCollectionDTO2.getActions().stream() + .findFirst() + .get() + .getId()); StepVerifier.create(actionMono) .assertNext(action -> { diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationPageServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationPageServiceTest.java index 4a89adb22f..30bf562bf5 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationPageServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationPageServiceTest.java @@ -190,8 +190,8 @@ public class ApplicationPageServiceTest { String uuid = UUID.randomUUID().toString(); NewPage newPage = createApplication("App_" + uuid) - .flatMap(application -> - newPageService.getById(application.getPages().get(0).getId())) + .flatMap(application -> newPageService.getByIdWithoutPermissionCheck( + application.getPages().get(0).getId())) .block(); // mock the dsMigrationUtils to return the current DSL version as the latest DSL version @@ -220,8 +220,8 @@ public class ApplicationPageServiceTest { public void getPageAndMigrateDslByBranchAndDefaultPageId_WhenEditModeDslIsNotLatest_EditModeDslMigrated() { String uuid = UUID.randomUUID().toString(); NewPage newPage = createApplication("App_" + uuid) - .flatMap(application -> - newPageService.getById(application.getPages().get(0).getId())) + .flatMap(application -> newPageService.getByIdWithoutPermissionCheck( + application.getPages().get(0).getId())) .block(); // mock the dsMigrationUtils to return the (current DSL version-1) as the latest DSL version @@ -246,7 +246,7 @@ public class ApplicationPageServiceTest { Mono newPageMono = applicationPageService .getPageAndMigrateDslByBranchAndDefaultPageId(newPage.getId(), null, false, true) - .then(newPageService.getById(newPage.getId())); + .then(newPageService.getByIdWithoutPermissionCheck(newPage.getId())); StepVerifier.create(newPageMono) .assertNext(newpage -> { @@ -279,8 +279,8 @@ public class ApplicationPageServiceTest { public void getPageAndMigrateDslByBranchAndDefaultPageId_WhenDSLHasNotVersion_DslMigratedToLatest() { String uuid = UUID.randomUUID().toString(); NewPage newPage = createApplication("App_" + uuid) - .flatMap(application -> - newPageService.getById(application.getPages().get(0).getId())) + .flatMap(application -> newPageService.getByIdWithoutPermissionCheck( + application.getPages().get(0).getId())) .flatMap(page -> { Layout layout = page.getUnpublishedPage().getLayouts().get(0); JSONObject unpublishedDsl = layout.getDsl(); @@ -306,7 +306,7 @@ public class ApplicationPageServiceTest { Mono newPageMono = applicationPageService .getPageAndMigrateDslByBranchAndDefaultPageId(newPage.getId(), null, false, true) - .then(newPageService.getById(newPage.getId())); + .then(newPageService.getByIdWithoutPermissionCheck(newPage.getId())); StepVerifier.create(newPageMono) .assertNext(newpage -> { @@ -328,8 +328,8 @@ public class ApplicationPageServiceTest { public void getPageAndMigrateDslByBranchAndDefaultPageId_WhenViewModeDslIsNotLatest_ViewModeDslMigrated() { String uuid = UUID.randomUUID().toString(); NewPage newPage = createApplication("App_" + uuid) - .flatMap(application -> - newPageService.getById(application.getPages().get(0).getId())) + .flatMap(application -> newPageService.getByIdWithoutPermissionCheck( + application.getPages().get(0).getId())) .block(); // mock the dsMigrationUtils to return the (current DSL version-1) as the latest DSL version @@ -354,7 +354,7 @@ public class ApplicationPageServiceTest { Mono newPageMono = applicationPageService .getPageAndMigrateDslByBranchAndDefaultPageId(newPage.getId(), null, true, true) - .then(newPageService.getById(newPage.getId())); + .then(newPageService.getByIdWithoutPermissionCheck(newPage.getId())); StepVerifier.create(newPageMono) .assertNext(newpage -> { diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/CurlImporterServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/CurlImporterServiceTest.java index 54ba24f855..ead16a4859 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/CurlImporterServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/CurlImporterServiceTest.java @@ -422,7 +422,8 @@ public class CurlImporterServiceTest { command, null, page.getId(), "actionName", workspaceId, "main")) .cache(); - Mono savedActionMono = resultMono.flatMap(actionDTO -> newActionService.getById(actionDTO.getId())); + Mono savedActionMono = + resultMono.flatMap(actionDTO -> newActionService.getByIdWithoutPermissionCheck(actionDTO.getId())); StepVerifier.create(Mono.zip(resultMono, defaultPageMono, savedActionMono)) .assertNext(tuple -> { diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/PageServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/PageServiceTest.java index 57a18db8cc..e09d641635 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/PageServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/PageServiceTest.java @@ -305,7 +305,8 @@ public class PageServiceTest { .verifyComplete(); // Check if defaultResources - Mono newPageMono = pageMono.flatMap(pageDTO -> newPageService.getById(pageDTO.getId())); + Mono newPageMono = + pageMono.flatMap(pageDTO -> newPageService.getByIdWithoutPermissionCheck(pageDTO.getId())); StepVerifier.create(newPageMono) .assertNext(newPage -> { assertThat(newPage.getDefaultResources()).isNotNull(); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserDataServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserDataServiceTest.java index 04ab59e5d3..27dc61ad78 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserDataServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserDataServiceTest.java @@ -496,8 +496,9 @@ public class UserDataServiceTest { Mono gitConfigMono = gitService.getDefaultGitProfileOrCreateIfEmpty(); - Mono userData = - userDataService.getForCurrentUser().flatMap(userData1 -> userService.getById(userData1.getUserId())); + Mono userData = userDataService + .getForCurrentUser() + .flatMap(userData1 -> userService.getByIdWithoutPermissionCheck(userData1.getUserId())); StepVerifier.create(gitConfigMono.zipWhen(gitProfile -> userData)) .assertNext(tuple -> { diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/TenantServiceCETest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/TenantServiceCETest.java index 4710801319..a1b583047c 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/TenantServiceCETest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/TenantServiceCETest.java @@ -310,7 +310,7 @@ class TenantServiceCETest { .verify(); // Verify that the tenant is updated for the feature flag migration failure - StepVerifier.create(tenantService.getById(tenant.getId())) + StepVerifier.create(tenantService.getByIdWithoutPermissionCheck(tenant.getId())) .assertNext(updatedTenant -> { assertThat(updatedTenant.getTenantConfiguration().getFeaturesWithPendingMigration()) .hasSize(1);