Always commit user transactions on save when modifying the security model via the UI
[lgpl/argeo-commons.git] / org.argeo.security.ui.admin / src / org / argeo / security / ui / admin / internal / commands / DeleteUsers.java
index 87da43cdf14f7495c14ee3ba45837baf9cb014d3..e583bef53bd610b5d99af00ab2266271536760d1 100644 (file)
@@ -81,7 +81,6 @@ public class DeleteUsers extends AbstractHandler {
 
                for (User user : users) {
                        String userName = user.getName();
-
                        // TODO find a way to close the editor cleanly if opened. Cannot be
                        // done through the UserAdminListeners, it causes a
                        // java.util.ConcurrentModificationException because disposing the
@@ -89,8 +88,11 @@ public class DeleteUsers extends AbstractHandler {
                        IEditorPart part = iwp.findEditor(new UserEditorInput(userName));
                        if (part != null)
                                iwp.closeEditor(part, false);
-
                        userAdmin.removeRole(userName);
+               }
+               userAdminWrapper.commitOrNotifyTransactionStateChange();
+
+               for (User user : users) {
                        userAdminWrapper.notifyListeners(new UserAdminEvent(null,
                                        UserAdminEvent.ROLE_REMOVED, user));
                }