diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index ca1ad45d1d3..fcb5a7db6cf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -238,6 +238,7 @@ public class UserManagementServiceImpl implements UserManagementService { } } rolesToDelete.remove(ROLE_EVERYONE); + rolesToAdd.remove(ROLE_EVERYONE); userStoreManager.updateRoleListOfUser(username, rolesToDelete.toArray(new String[rolesToDelete.size()]), rolesToAdd.toArray(new String[rolesToAdd.size()]));