private void setReadOnly(boolean readOnly) {
boolean editable = !readOnly && user != null;
passwordAction.setEnabled(editable);
addToGroupAction.setEnabled(editable);
removeFromGroupAction.setReadOnly(readOnly);
KongaTextField nameField = getNameField();
nameField.setEditable(editable && user.isRenamable());
for (Field f : fields.values()) {
if (f.getWidget() != nameField) {
f.getWidget().setEditable(editable);
}
}