boolean isItemVisible(ItemWrapper item) { ItemDefinition def = item.getItemDefinition(); if (def.isIgnored() || def.isOperational()) { return false; } if (def instanceof PrismPropertyDefinition && skipProperty((PrismPropertyDefinition) def)) { return false; } // we decide not according to status of this container, but according to // the status of the whole object if (objectWrapper.getStatus() == ContainerStatus.ADDING) { return def.canAdd(); } // otherwise, object.getStatus() is MODIFYING if (def.canModify()) { return showEmpty(item); } else { if (def.canRead()) { return showEmpty(item); } return false; } }
private boolean isAccessible(ItemDefinition def, ContainerStatus status) { switch (status) { case ADDING: if (!def.canAdd()) { return false; } break; case MODIFYING: if (!def.canModify()) { return false; } break; } return true; }