Add validation for user deletion #244

Merged
pahansith merged 3 commits from prathabanKavin/device-mgt-core:uservalidate into master 1 year ago

Purpose

Description

  • Add validation to check whether the user has enrolled devices
## Purpose * Fixes https://roadmap.entgra.net/issues/10337 ## Description * Add validation to check whether the user has enrolled devices
prathabanKavin added 2 commits 1 year ago
pahansith requested changes 1 year ago
username = domain + '/' + username;
}
try {
List<Device> deviceList;
Owner

Remove the list and use an integer variable to check the size of the list

Remove the list and use an integer variable to check the size of the list
prathabanKavin marked this conversation as resolved
userStoreManager.deleteUser(username);
if (log.isDebugEnabled()) {
log.debug("User '" + username + "' was successfully removed.");
if (domain != null && !domain.isEmpty()) {
Owner

Same condition is checking twice. Handle it in an appropriate way

Same condition is checking twice. Handle it in an appropriate way
prathabanKavin marked this conversation as resolved
} else {
String msg = "There are enrolled devices for username: " + username;
log.error(msg);
return Response.serverError().entity(
Owner

Change the response to a Bad request

Change the response to a Bad request
prathabanKavin marked this conversation as resolved
prathabanKavin added 1 commit 1 year ago
pahansith merged commit 9767f7e90f into master 1 year ago

Reviewers

pahansith requested changes 1 year ago
The pull request has been merged as 9767f7e90f.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: community/device-mgt-core#244
Loading…
There is no content yet.