String userName = connectionHandler.getUserName();
DBUser user = connectionHandler.getObjectBundle().getUser(userName);
String[] privilegeNames = connectionHandler.getInterfaceProvider().getDebuggerInterface().getRequiredPrivilegeNames();
List<String> missingPrivileges = new ArrayList<String>();
for (String privilegeName : privilegeNames) {
DBPrivilege privilege = connectionHandler.getObjectBundle().getPrivilege(privilegeName);
if (privilege == null || !user.hasPrivilege(privilege)) {
missingPrivileges.add(privilegeName);
}
}