public RolapMember getDefaultMember() { RolapMember defaultMember = (RolapMember) getHierarchy().getDefaultMember(); if (defaultMember != null) { Access i = hierarchyAccess.getAccess(defaultMember); if (i != Access.NONE) { return defaultMember; } } return getRootMembers().get(0); }
private boolean canSee(final RolapMember member) { if (ragged && member.isHidden()) { return false; } if (hierarchyAccess != null) { final Access access = hierarchyAccess.getAccess(member); return access != Access.NONE; } return true; }
public RolapMember getMemberParent(RolapMember member) { RolapMember parentMember = member.getParentMember(); // Skip over hidden parents. while (parentMember != null && parentMember.isHidden()) { parentMember = parentMember.getParentMember(); } // Skip over non-accessible parents. if (parentMember != null) { if (hierarchyAccess.getAccess(parentMember) == Access.NONE) { return null; } } return parentMember; }
private void processMemberChildren( List<RolapMember> fullChildren, List<RolapMember> children, MemberChildrenConstraint constraint) { // todo: optimize if parentMember is beyond last level List<RolapMember> grandChildren = null; for (int i = 0; i < fullChildren.size(); i++) { RolapMember member = fullChildren.get(i); // If a child is hidden (due to raggedness) include its children. // This must be done before applying access-control. if (ragged) { if (member.isHidden()) { // Replace this member with all of its children. // They might be hidden too, but we'll get to them in due // course. They also might be access-controlled; that's why // we deal with raggedness before we apply access-control. fullChildren.remove(i); if (grandChildren == null) { grandChildren = new ArrayList<RolapMember>(); } else { grandChildren.clear(); } memberReader.getMemberChildren(member, grandChildren, constraint); fullChildren.addAll(i, grandChildren); // Step back to before the first child we just inserted, // and go through the loop again. --i; continue; } } // Filter out children which are invisible because of // access-control. final Access access; if (hierarchyAccess != null) { access = hierarchyAccess.getAccess(member); } else { access = Access.ALL; } switch (access) { case NONE: break; default: children.add(member); break; } } }