diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/fork/internal/ApplicationForkingServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/fork/internal/ApplicationForkingServiceCEImpl.java index 882d7ff017..d7d11ea8e1 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/fork/internal/ApplicationForkingServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/fork/internal/ApplicationForkingServiceCEImpl.java @@ -595,8 +595,8 @@ public class ApplicationForkingServiceCEImpl implements ApplicationForkingServic .findIdsAndPoliciesByApplicationIdIn(List.of(application.getId())) .map(idPoliciesOnly -> { NewPage newPage = new NewPage(); - newPage.setId(idPoliciesOnly.id()); - newPage.setPolicies(idPoliciesOnly.policies()); + newPage.setId(idPoliciesOnly.getId()); + newPage.setPolicies(idPoliciesOnly.getPolicies()); return newPage; }) .flatMap(newPageRepository::setUserPermissionsInObject)); @@ -605,8 +605,8 @@ public class ApplicationForkingServiceCEImpl implements ApplicationForkingServic .findIdsAndPoliciesByApplicationIdIn(List.of(application.getId())) .map(idPoliciesOnly -> { NewAction newAction = new NewAction(); - newAction.setId(idPoliciesOnly.id()); - newAction.setPolicies(idPoliciesOnly.policies()); + newAction.setId(idPoliciesOnly.getId()); + newAction.setPolicies(idPoliciesOnly.getPolicies()); return newAction; }) .flatMap(newActionRepository::setUserPermissionsInObject)); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/projections/IdPoliciesOnly.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/projections/IdPoliciesOnly.java index 852cb022a6..2f5be1b8f8 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/projections/IdPoliciesOnly.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/projections/IdPoliciesOnly.java @@ -1,8 +1,11 @@ package com.appsmith.server.projections; import com.appsmith.external.models.Policy; -import lombok.NonNull; import java.util.Set; -public record IdPoliciesOnly(@NonNull String id, Set policies) {} +public interface IdPoliciesOnly { + String getId(); + + Set getPolicies(); +} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java index cca0502645..5cdb345ed3 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java @@ -1470,8 +1470,8 @@ public class ApplicationPageServiceCEImpl implements ApplicationPageServiceCE { .findIdsAndPoliciesByApplicationIdIn(List.of(application.getId())) .map(idPoliciesOnly -> { NewPage newPage = new NewPage(); - newPage.setId(idPoliciesOnly.id()); - newPage.setPolicies(idPoliciesOnly.policies()); + newPage.setId(idPoliciesOnly.getId()); + newPage.setPolicies(idPoliciesOnly.getPolicies()); return newPage; }) .flatMap(newPageRepository::setUserPermissionsInObject)); @@ -1479,8 +1479,8 @@ public class ApplicationPageServiceCEImpl implements ApplicationPageServiceCE { .findIdsAndPoliciesByApplicationIdIn(List.of(application.getId())) .map(idPoliciesOnly -> { NewAction newAction = new NewAction(); - newAction.setId(idPoliciesOnly.id()); - newAction.setPolicies(idPoliciesOnly.policies()); + newAction.setId(idPoliciesOnly.getId()); + newAction.setPolicies(idPoliciesOnly.getPolicies()); return newAction; }) .flatMap(newActionRepository::setUserPermissionsInObject)); @@ -1488,8 +1488,8 @@ public class ApplicationPageServiceCEImpl implements ApplicationPageServiceCE { .findIdsAndPoliciesByApplicationIdIn(List.of(application.getId())) .map(idPoliciesOnly -> { ActionCollection actionCollection = new ActionCollection(); - actionCollection.setId(idPoliciesOnly.id()); - actionCollection.setPolicies(idPoliciesOnly.policies()); + actionCollection.setId(idPoliciesOnly.getId()); + actionCollection.setPolicies(idPoliciesOnly.getPolicies()); return actionCollection; }) .flatMap(actionCollectionRepository::setUserPermissionsInObject)); @@ -1538,8 +1538,8 @@ public class ApplicationPageServiceCEImpl implements ApplicationPageServiceCE { .findIdsAndPoliciesByIdIn(datasourceIds) .flatMap(idPolicy -> { Datasource datasource = new Datasource(); - datasource.setId(idPolicy.id()); - datasource.setPolicies(idPolicy.policies()); + datasource.setId(idPolicy.getId()); + datasource.setPolicies(idPolicy.getPolicies()); return datasourceRepository.setUserPermissionsInObject(datasource); })); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java index 7d0c0fa605..31ca2b39e6 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java @@ -608,7 +608,7 @@ public class UserServiceCEImpl extends BaseService updates.setName(inputName); updatedUserMono = sessionUserService .getCurrentUser() - .flatMap(user -> update(user.getEmail(), updates, User.Fields.email) + .flatMap(user -> update(user.getId(), updates, User.Fields.id) .then( exchange == null ? repository.findByEmail(user.getEmail()) diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceUnitTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceUnitTest.java index 27ab280072..139c87b94f 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceUnitTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceUnitTest.java @@ -103,8 +103,7 @@ public class UserWorkspaceServiceUnitTest { List workspaceList = new ArrayList<>(4); for (int i = 1; i <= 4; i++) { Workspace workspace = new Workspace(); - workspace.setId("org-" + i); - workspace.setName(workspace.getId()); + workspace.setName(UUID.randomUUID().toString()); workspaceList.add(workspace); } return Flux.fromIterable(workspaceList)