Add validation for user deletion #244

Merged
pahansith merged 3 commits from prathabanKavin/device-mgt-core:uservalidate into master 11 months 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 12 months ago
pahansith requested changes 12 months ago
username = domain + '/' + username;
}
try {
List<Device> deviceList;

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()) {

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(

Change the response to a Bad request

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

Reviewers

pahansith requested changes 12 months 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.