errorMode = false;
initComponents();
Enumeration<UserRightsGroup> rightsGroups = rightsSet.rightsGroups();
while (rightsGroups.hasMoreElements()) {
UserRightsGroup urg = rightsGroups.nextElement();
System.out.println("Group: " + urg);
Set<UserRight> rights = urg.getRights();
for (UserRight userRight : rights) {
System.out.print(" right: " + userRight + " mask: " + userRight.getRightsMask());
Set<UserRight> includes = new HashSet<UserRight>();
for (UserRight ur : rights) {
if (!ur.equals(userRight) && UserRight.include(userRight.getRightsMask(), ur.getRightsMask())) {
includes.add(ur);
}
}
if (includes.isEmpty()){
System.out.println();
}else{
System.out.println(" include:");
for (UserRight ur : includes) {
System.out.println(" - " + ur + " mask: " + ur.getRightsMask());
}
}
}
}
panelCollaboratorSelect1.setSelectedCollaborator(null);
panelCollaboratorSelect1.addContentStateListener(new ContentStateListener() {
@Override
public void contentStateChanged() {
setErrorMode(false);
DirectoryCollaboratorItem selectedCollaborator = panelCollaboratorSelect1.getSelectedItem();
if (selectedCollaborator == null) {
return;
}
if (collabLoc != null && collabLoc.isDirty() && selectedCollaborator.getID() != collabLoc.getID()) {
MessageBox.showWarning(MessageBox.W_NOT_CLOSE_EDITING);
try {
panelCollaboratorSelect1.setSelectedCollaborator(dirCollab.getItemFromID(collabLoc.getID()));
} catch (DirectoryItemNotFoundException ex) {
MessageBox.showException(ex);
}
} else {
if (collabLoc != null && selectedCollaborator.getID() == collabLoc.getID()) {
return;
}
try {
spec.setText("");
collabLoc = new CollaboratorLocal(selectedCollaborator.getID(), getAuditManager());
collabLoc.getDetails();//костыль, иначе детали не прогрузятся
collabLoc.addContentStateListener(getContainer());
DefaultListModel model = new DefaultListModel();
Enumeration<UserRightsGroup> enu = rightsSet.rightsGroups();
while(enu.hasMoreElements()) {
UserRightsGroup gr = enu.nextElement();
model.addElement(gr);
}
rightsGroup.setModel(model);
resetTable();