public void enable(List<String> usernames, LocalizedOperationResult result) { synchronized (enableUserMutex) { Set<String> potentialEnabledUsers = new HashSet<String>(toUserNames(userDao.enabledUsers())); potentialEnabledUsers.addAll(usernames); userDao.enableUsers(usernames); } }
private boolean willDisableAllAdmins(List<String> usersToBeDisabled) { List<String> enabledUserNames = toUserNames(userDao.enabledUsers()); enabledUserNames.removeAll(usersToBeDisabled); return !userNameListContainsAdmin(enabledUserNames); }