fix: Enable Roles and Groups Display on Cloud Instances (#41068)

This commit is contained in:
Abhijeet 2025-07-02 12:12:48 +05:30 committed by GitHub
parent f379f16bdd
commit be3aef333b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 7 deletions

View File

@ -5,6 +5,5 @@ import com.appsmith.server.dtos.UserProfileDTO;
import reactor.core.publisher.Mono;
public interface PACConfigurationServiceCE {
Mono<UserProfileDTO> setRolesAndGroups(
UserProfileDTO profile, User user, boolean showUsersAndGroups, boolean isCloudHosting);
Mono<UserProfileDTO> setRolesAndGroups(UserProfileDTO profile, User user, boolean showUsersAndGroups);
}

View File

@ -12,8 +12,7 @@ import static com.appsmith.server.constants.ce.AccessControlConstantsCE.UPGRADE_
@Service
public class PACConfigurationServiceCEImpl implements PACConfigurationServiceCE {
@Override
public Mono<UserProfileDTO> setRolesAndGroups(
UserProfileDTO profile, User user, boolean showUsersAndGroups, boolean isCloudHosting) {
public Mono<UserProfileDTO> setRolesAndGroups(UserProfileDTO profile, User user, boolean showUsersAndGroups) {
profile.setRoles(
List.of(UPGRADE_TO_BUSINESS_EDITION_TO_ACCESS_ROLES_AND_GROUPS_FOR_CONDITIONAL_BUSINESS_LOGIC));
profile.setGroups(

View File

@ -775,8 +775,7 @@ public class UserServiceCEImpl extends BaseService<UserRepository, User, String>
commonConfig.isCloudHosting() ? true : userData.isIntercomConsentGiven());
profile.setSuperUser(isSuperUser);
profile.setConfigurable(!StringUtils.isEmpty(commonConfig.getEnvFilePath()));
return pacConfigurationService.setRolesAndGroups(
profile, userFromDb, true, commonConfig.isCloudHosting());
return pacConfigurationService.setRolesAndGroups(profile, userFromDb, true);
});
}

View File

@ -22,7 +22,7 @@ class PACConfigurationServiceCETest {
public void test_setRolesAndGroups_featureFlagDisabled() {
UserProfileDTO userProfileDTO = new UserProfileDTO();
Mono<UserProfileDTO> userProfileDTOMono =
pacConfigurationService.setRolesAndGroups(userProfileDTO, null, false, false);
pacConfigurationService.setRolesAndGroups(userProfileDTO, null, false);
StepVerifier.create(userProfileDTOMono)
.assertNext(userProfileDTO1 -> {
assertThat(userProfileDTO1.getRoles())