Daanse Tutorial - Access Catalog Grant
This tutorial discusses roles with CatalogGrant.
roleAllrole : use CatalogGrant accessall; (accesscube1)roleNonerole : use CatalogGrant accessnone; (no accesscube1)roleAllDimWithCubeGrandrole : use CatalogGrant accessall_dimensions; CubeGrantcube1access all;cube2access none (accesscube1)roleAllDimWithoutCubeGrandrole: use CatalogGrant accessall_dimensionswithout cube grant (As result is 'no access'. For access need CubeGrant withcustomorall)
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.
<roma:DatabaseSchema id="_databaseSchema_CatalogGrand">
<tables xsi:type="roma:PhysicalTable" id="_table_fact" name="Fact">
<columns xsi:type="roma:PhysicalColumn" id="_column_fact_key" name="KEY"/>
<columns xsi:type="roma:PhysicalColumn" id="_column_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.
<roma:TableQuery id="_query_fact" table="_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.
<roma:Level id="_level_key" name="Level1" column="_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 level1.
<roma:ExplicitHierarchy id="_hierarchy_main" name="Hierarchy1" hasAll="false" primaryKey="_column_fact_key" query="_query_fact" levels="_level_key"/>Note: This is only a symbolic example. For the exact definition, see the Definition section.
Dimension1
The dimension1 is defined with the one hierarchy1.
<roma:StandardDimension id="_dimension_main" name="Dimension1" hierarchies="roma:ExplicitHierarchy _hierarchy_main"/>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.
<roma:PhysicalCube id="_cube_main" name="Cube1" query="_query_fact">
<dimensionConnectors foreignKey="roma:PhysicalColumn _column_fact_key" dimension="roma:StandardDimension _dimension_main" overrideDimensionName="Dimension1" id="_dimensionConnector_main"/>
<dimensionConnectors foreignKey="roma:PhysicalColumn _column_fact_key" dimension="roma:StandardDimension _dimension_main" overrideDimensionName="Dimension2" id="_dimensionConnector_secondary"/>
<measureGroups>
<measures xsi:type="roma:SumMeasure" id="_measure_sum" name="Measure1" column="_column_fact_value"/>
</measureGroups>
</roma:PhysicalCube>Note: This is only a symbolic example. For the exact definition, see the Definition section.
roleAll
The roleAll use CatalogGrant access all; (access cube1)
<roma:AccessRole id="_accessRole_all" name="roleAll">
<accessCatalogGrants catalogAccess="all"/>
</roma:AccessRole>Note: This is only a symbolic example. For the exact definition, see the Definition section.
roleNone
The roleNone use CatalogGrant access none; (no access cube1)
<roma:AccessRole id="_accessRole_none" name="roleNone">
<accessCatalogGrants/>
</roma:AccessRole>Note: This is only a symbolic example. For the exact definition, see the Definition section.
roleAllDimWithCubeGrand
The roleAllDimWithCubeGrand use CatalogGrant access all_dimensions; CubeGrant access all; (access cube1)
<roma:AccessRole id="_accessRole_allDimWithCubeGrand" name="roleAllDimWithCubeGrand">
<accessCatalogGrants catalogAccess="all_dimensions">
<cubeGrants cubeAccess="all" cube="roma:PhysicalCube _cube_main"/>
</accessCatalogGrants>
</roma:AccessRole>Note: This is only a symbolic example. For the exact definition, see the Definition section.
roleAllDimWithoutCubeGrand
The roleAllDimWithoutCubeGrand use CatalogGrant access all_dimensions without CubeGrant; (no access cube1)
<roma:AccessRole id="_accessRole_allDimWithoutCubeGrand" name="roleAllDimWithoutCubeGrand">
<accessCatalogGrants catalogAccess="all_dimensions">
<databaseSchemaGrants databaseSchemaAccess="all" databaseSchema="_databaseSchema_CatalogGrand"/>
</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 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:Catalog description="Demonstrates access control with catalog grants and roles" name="Daanse Tutorial - Access Catalog Grant" cubes="_cube_main" accessRoles="_accessRole_all _accessRole_none _accessRole_allDimWithCubeGrand _accessRole_allDimWithoutCubeGrand" dbschemas="_databaseSchema_CatalogGrand"/>
<roma:DatabaseSchema id="_databaseSchema_CatalogGrand">
<tables xsi:type="roma:PhysicalTable" id="_table_fact" name="Fact">
<columns xsi:type="roma:PhysicalColumn" id="_column_fact_key" name="KEY"/>
<columns xsi:type="roma:PhysicalColumn" id="_column_fact_value" name="VALUE" type="Integer"/>
</tables>
</roma:DatabaseSchema>
<roma:TableQuery id="_query_fact" table="_table_fact"/>
<roma:Level id="_level_key" name="Level1" column="_column_fact_key"/>
<roma:ExplicitHierarchy id="_hierarchy_main" name="Hierarchy1" hasAll="false" primaryKey="_column_fact_key" query="_query_fact" levels="_level_key"/>
<roma:StandardDimension id="_dimension_main" name="Dimension1" hierarchies="_hierarchy_main"/>
<roma:PhysicalCube id="_cube_main" name="Cube1" query="_query_fact">
<dimensionConnectors foreignKey="_column_fact_key" dimension="_dimension_main" overrideDimensionName="Dimension1" id="_dimensionConnector_main"/>
<dimensionConnectors foreignKey="_column_fact_key" dimension="_dimension_main" overrideDimensionName="Dimension2" id="_dimensionConnector_secondary"/>
<measureGroups>
<measures xsi:type="roma:SumMeasure" id="_measure_sum" name="Measure1" column="_column_fact_value"/>
</measureGroups>
</roma:PhysicalCube>
<roma:AccessRole id="_accessRole_all" name="roleAll">
<accessCatalogGrants catalogAccess="all"/>
</roma:AccessRole>
<roma:AccessRole id="_accessRole_allDimWithCubeGrand" name="roleAllDimWithCubeGrand">
<accessCatalogGrants catalogAccess="all_dimensions">
<cubeGrants cubeAccess="all" cube="_cube_main"/>
</accessCatalogGrants>
</roma:AccessRole>
<roma:AccessRole id="_accessRole_allDimWithoutCubeGrand" name="roleAllDimWithoutCubeGrand">
<accessCatalogGrants catalogAccess="all_dimensions">
<databaseSchemaGrants databaseSchemaAccess="all" databaseSchema="_databaseSchema_CatalogGrand"/>
</accessCatalogGrants>
</roma:AccessRole>
<roma:AccessRole id="_accessRole_none" name="roleNone">
<accessCatalogGrants/>
</roma:AccessRole>
</xmi:XMI>Tutorial Zip
This files contaisn the data-tables as csv and the mapping as xmi file.