public HierarchyAccess clone() { HierarchyAccessImpl hierarchyAccess = new HierarchyAccessImpl( role, hierarchy, access, topLevel, bottomLevel, rollupPolicy); hierarchyAccess.memberGrants.putAll(memberGrants); return hierarchyAccess; }
protected RoleImpl clone() { RoleImpl role = new RoleImpl(); role.mutable = mutable; role.schemaGrants.putAll(schemaGrants); role.cubeGrants.putAll(cubeGrants); role.dimensionGrants.putAll(dimensionGrants); role.hashCache.addAll(hashCache); for (Map.Entry<Hierarchy, HierarchyAccessImpl> entry : hierarchyGrants.entrySet()) { role.hierarchyGrants.put( entry.getKey(), (HierarchyAccessImpl) entry.getValue().clone()); } return role; }
hierarchyGrants.put( hierarchy, new HierarchyAccessImpl( this, hierarchy, access, topLevel, bottomLevel, rollupPolicy));
assert hierarchyAccess != null; assert hierarchyAccess.access == Access.CUSTOM; hierarchyAccess.grant(this, member, access); hashCache.add( new Object[] {
public HierarchyAccess getAccessDetails(Hierarchy hierarchy) { Util.assertPrecondition(hierarchy != null, "hierarchy != null"); if (hierarchyGrants.containsKey(hierarchy)) { return hierarchyGrants.get(hierarchy); } final Access hierarchyAccess; final Access schemaGrant = schemaGrants.get(hierarchy.getDimension().getSchema()); if (schemaGrant != null) { if (schemaGrant == Access.ALL) { hierarchyAccess = Access.ALL; } else { // Let's check the parent dimension Access dimAccess = getAccess( hierarchy.getDimension() ); hierarchyAccess = dimAccess == Access.ALL ? Access.ALL : Access.NONE; } } else { hierarchyAccess = Access.ALL; } return new HierarchyAccessImpl( this, hierarchy, hierarchyAccess, null, null, RollupPolicy.HIDDEN); }
public Access getAccess(Member member) { assert member != null; // Always allow access to calculated members. if (member.isCalculatedInQuery()) { return Access.ALL; } // Check if the parent hierarchy has any access // rules for this. final HierarchyAccessImpl hierarchyAccess = hierarchyGrants.get(member.getHierarchy()); if (hierarchyAccess != null) { return hierarchyAccess.getAccess(member); } // Then let's check ask the parent level. Access access = getAccess(member.getLevel()); LOGGER.trace( "Access level " + access + " granted to level " + member.getUniqueName() + " because of the grant to level " + member.getLevel().getUniqueName()); return access; }
/** * Creates an element which represents all access to a hierarchy. * * @param hierarchy Hierarchy * @return element representing all access to a given hierarchy */ public static HierarchyAccess createAllAccess(Hierarchy hierarchy) { return new HierarchyAccessImpl( Util.createRootRole(hierarchy.getDimension().getSchema()), hierarchy, Access.ALL, null, null, Role.RollupPolicy.FULL); }