Skip to content

Cube with examples of roles with MemberGrant Cube1 - access to 'A'

Cube with access MemberGrant

This tutorial discusses role with MemberGrant

role1 role: with member grants [Dimension1].[A] -all, [Dimension1].[B] -none, [Dimension1].[C] -none; (Cube1 - access to 'A' only)

Rollup policy: (Full. Partial. Hidden.) Full. The total for that member includes all children. This is the default policy if you don't specify the rollupPolicy attribute. Partial. The total for that member includes only accessible children. Hidden. If any of the children are inaccessible, the total is hidden.

Database Schema

The Database Schema contains the Fact table with two columns: KEY and VALUE. The KEY column is used as the discriminator in the the Level and Hierarchy definitions.

xml
<roma:DatabaseSchema   id="databaseSchema">
  <tables xsi:type="roma:PhysicalTable" id="_Fact" name="Fact">
    <columns xsi:type="roma:PhysicalColumn" id="_Fact_KEY" name="KEY"/>
    <columns xsi:type="roma:PhysicalColumn" id="_Fact_VALUE" name="VALUE" type="Integer"/>
  </tables>
</roma:DatabaseSchema>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Query

The Query is a simple TableQuery that selects all columns from the Fact table to use in in the hierarchy and in the cube for the measures.

xml
<roma:TableQuery  id="_FactQuery" table="_Fact"/>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Level1

This Example uses one simple Level1 bases on the KEY column.

xml
<roma:Level  id="_Level1" name="Level1" column="_Fact_KEY"/>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Hierarchy1 without hasAll Level1

The Hierarchy1 is defined with the hasAll property set to false and the one level2.

xml
<roma:ExplicitHierarchy  id="_Hierarchy1" name="Hierarchy1" hasAll="false" primaryKey="_Fact_KEY" query="_FactQuery" levels="_Level1"/>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Dimension1

The dimension1 is defined with the one hierarchy1.

xml
<roma:StandardDimension  id="_Dimension1" name="Dimension1" hierarchies="roma:ExplicitHierarchy _Hierarchy1"/>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Cube1 with access all

The cube1 is defines by the DimensionConnector1 and the DimensionConnector2 and the MeasureGroup with measure with aggregation sum.

xml
<roma:PhysicalCube   id="_Cube1" name="Cube1" query="_FactQuery">
  <dimensionConnectors foreignKey="roma:PhysicalColumn _Fact_KEY" dimension="roma:StandardDimension _Dimension1" overrideDimensionName="Dimension1"/>
  <dimensionConnectors foreignKey="roma:PhysicalColumn _Fact_KEY" dimension="roma:StandardDimension _Dimension1" overrideDimensionName="Dimension2"/>
  <measureGroups>
    <measures xsi:type="roma:SumMeasure" id="_Measure1" name="Measure1" column="_Fact_VALUE"/>
  </measureGroups>
</roma:PhysicalCube>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Role1

    The role1 use CatalogGrant access all; CubeGrant cube1 access all; dimensionGrant dimension1 access all;

hierarchyGrant hierarchy1 access custom with member grants [Dimension1].[A] -all, [Dimension1].[B] -none, [Dimension1].[C] -none; (Cube1 - access to "A" Cube2 - no access)

xml
<roma:AccessRole  id="_role1" name="role1">
  <accessCatalogGrants catalogAccess="custom">
    <cubeGrants cubeAccess="custom" cube="roma:PhysicalCube _Cube1">
      <dimensionGrants dimensionAccess="all" dimension="roma:StandardDimension _Dimension1"/>
      <hierarchyGrants hierarchyAccess="custom" hierarchy="roma:ExplicitHierarchy _Hierarchy1" bottomLevel="_Level1" topLevel="_Level1">
        <memberGrants memberAccess="all" member="[Dimension1].[A]"/>
        <memberGrants member="[Dimension1].[B]"/>
        <memberGrants member="[Dimension1].[C]"/>
      </hierarchyGrants>
    </cubeGrants>
    <databaseSchemaGrants databaseSchemaAccess="all" databaseSchema="databaseSchema"/>
  </accessCatalogGrants>
</roma:AccessRole>

Note: This is only a symbolic example. For the exact definition, see the Definition section.

Definition

This files represent the complete definition of the catalog.

xml
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:roma="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping">
  <roma:ExplicitHierarchy id="_Hierarchy1" name="Hierarchy1" hasAll="false" primaryKey="_Fact_KEY" query="_FactQuery" levels="_Level1"/>
  <roma:Catalog description="Schema with access all dimension with cube1 access to A only" name="Cube with access all dimension_cube1 access to A only" cubes="_Cube1" accessRoles="_role1" dbschemas="databaseSchema"/>
  <roma:DatabaseSchema id="databaseSchema">
    <tables xsi:type="roma:PhysicalTable" id="_Fact" name="Fact">
      <columns xsi:type="roma:PhysicalColumn" id="_Fact_KEY" name="KEY"/>
      <columns xsi:type="roma:PhysicalColumn" id="_Fact_VALUE" name="VALUE" type="Integer"/>
    </tables>
  </roma:DatabaseSchema>
  <roma:TableQuery id="_FactQuery" table="_Fact"/>
  <roma:Level id="_Level1" name="Level1" column="_Fact_KEY"/>
  <roma:StandardDimension id="_Dimension1" name="Dimension1" hierarchies="_Hierarchy1"/>
  <roma:PhysicalCube id="_Cube1" name="Cube1" query="_FactQuery">
    <dimensionConnectors foreignKey="_Fact_KEY" dimension="_Dimension1" overrideDimensionName="Dimension1"/>
    <dimensionConnectors foreignKey="_Fact_KEY" dimension="_Dimension1" overrideDimensionName="Dimension2"/>
    <measureGroups>
      <measures xsi:type="roma:SumMeasure" id="_Measure1" name="Measure1" column="_Fact_VALUE"/>
    </measureGroups>
  </roma:PhysicalCube>
  <roma:AccessRole id="_role1" name="role1">
    <accessCatalogGrants catalogAccess="custom">
      <cubeGrants cubeAccess="custom" cube="_Cube1">
        <dimensionGrants dimensionAccess="all" dimension="_Dimension1"/>
        <hierarchyGrants hierarchyAccess="custom" hierarchy="_Hierarchy1" bottomLevel="_Level1" topLevel="_Level1">
          <memberGrants memberAccess="all" member="[Dimension1].[A]"/>
          <memberGrants member="[Dimension1].[B]"/>
          <memberGrants member="[Dimension1].[C]"/>
        </hierarchyGrants>
      </cubeGrants>
      <databaseSchemaGrants databaseSchemaAccess="all" databaseSchema="databaseSchema"/>
    </accessCatalogGrants>
  </roma:AccessRole>
</xmi:XMI>

Turorial Zip

This files contaisn the data-tables as csv and the mapping as xmi file.

Download Zip File

Released under the Eclipse Public License 2.0