|
| 1 | +--- |
| 2 | +title: Cube with roles access catalog |
| 3 | +group: Access |
| 4 | +kind: TUTORIAL |
| 5 | +number: 2.4.4 |
| 6 | +--- |
| 7 | + Cube with with CatalogGrant. |
| 8 | +roleAll role : use CatalogGrant access all; (access cube1) |
| 9 | +roleNone role : use CatalogGrant access none; (no access cube1) |
| 10 | +roleAllDimWithCubeGrand role : use CatalogGrant access all_dimensions; CubeGrant cube1 access all; cube2 access none (access cube1) |
| 11 | +roleAllDimWithoutCubeGrand role: use CatalogGrant access all_dimensions without cube grant (As result is 'no access'. For access need CubeGrant with custom or all); |
| 12 | + |
| 13 | + |
| 14 | +# Cube with roles access catalog |
| 15 | + |
| 16 | +This tutorial discusses roles with CatalogGrant. |
| 17 | + |
| 18 | +roleAll role : use CatalogGrant access all; (access cube1) |
| 19 | +roleNone role : use CatalogGrant access none; (no access cube1) |
| 20 | +roleAllDimWithCubeGrand role : use CatalogGrant access all_dimensions; CubeGrant cube1 access all; cube2 access none (access cube1) |
| 21 | +roleAllDimWithoutCubeGrand role: use CatalogGrant access all_dimensions without cube grant (As result is 'no access'. For access need CubeGrant with custom or all); |
| 22 | + |
| 23 | + |
| 24 | +## Database Schema |
| 25 | + |
| 26 | +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. |
| 27 | + |
| 28 | + |
| 29 | +```xml |
| 30 | +<roma:DatabaseSchema id="databaseSchema"> |
| 31 | + <tables xsi:type="roma:PhysicalTable" id="_Fact" name="Fact"> |
| 32 | + <columns xsi:type="roma:PhysicalColumn" id="_Fact_KEY" name="KEY"/> |
| 33 | + <columns xsi:type="roma:PhysicalColumn" id="_Fact_VALUE" name="VALUE" type="Integer"/> |
| 34 | + </tables> |
| 35 | +</roma:DatabaseSchema> |
| 36 | + |
| 37 | +``` |
| 38 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 39 | +## Query |
| 40 | + |
| 41 | +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. |
| 42 | + |
| 43 | + |
| 44 | +```xml |
| 45 | +<roma:TableQuery id="_FactQuery" table="_Fact"/> |
| 46 | + |
| 47 | +``` |
| 48 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 49 | +## Level1 |
| 50 | + |
| 51 | +This Example uses one simple Level1 bases on the KEY column. |
| 52 | + |
| 53 | + |
| 54 | +```xml |
| 55 | +<roma:Level id="_Level1" name="Level1" column="_Fact_KEY"/> |
| 56 | + |
| 57 | +``` |
| 58 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 59 | +## Hierarchy1 without hasAll Level1 |
| 60 | + |
| 61 | +The Hierarchy1 is defined with the hasAll property set to false and the one level1. |
| 62 | + |
| 63 | + |
| 64 | +```xml |
| 65 | +<roma:ExplicitHierarchy id="_Hierarchy1" name="Hierarchy1" hasAll="false" primaryKey="_Fact_KEY" query="_FactQuery" levels="_Level1"/> |
| 66 | + |
| 67 | +``` |
| 68 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 69 | +## Dimension1 |
| 70 | + |
| 71 | +The dimension1 is defined with the one hierarchy1. |
| 72 | + |
| 73 | + |
| 74 | +```xml |
| 75 | +<roma:StandardDimension id="_Dimension1" name="Dimension1" hierarchies="roma:ExplicitHierarchy _Hierarchy1"/> |
| 76 | + |
| 77 | +``` |
| 78 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 79 | +## Cube1 with access all |
| 80 | + |
| 81 | +The cube1 is defines by the DimensionConnector1 and the DimensionConnector2 and the MeasureGroup with measure with aggregation sum. |
| 82 | + |
| 83 | + |
| 84 | +```xml |
| 85 | +<roma:PhysicalCube id="_Cube1" name="Cube1" query="_FactQuery"> |
| 86 | + <dimensionConnectors foreignKey="roma:PhysicalColumn _Fact_KEY" dimension="roma:StandardDimension _Dimension1" overrideDimensionName="Dimension1"/> |
| 87 | + <dimensionConnectors foreignKey="roma:PhysicalColumn _Fact_KEY" dimension="roma:StandardDimension _Dimension1" overrideDimensionName="Dimension2"/> |
| 88 | + <measureGroups> |
| 89 | + <measures xsi:type="roma:SumMeasure" id="_Measure1" name="Measure1" column="_Fact_VALUE"/> |
| 90 | + </measureGroups> |
| 91 | +</roma:PhysicalCube> |
| 92 | + |
| 93 | +``` |
| 94 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 95 | +## roleAll |
| 96 | + |
| 97 | +The roleAll use CatalogGrant access all; (access cube1) |
| 98 | + |
| 99 | + |
| 100 | +```xml |
| 101 | +<roma:AccessRole id="_roleAll" name="roleAll"> |
| 102 | + <accessCatalogGrants catalogAccess="all"/> |
| 103 | +</roma:AccessRole> |
| 104 | + |
| 105 | +``` |
| 106 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 107 | +## roleNone |
| 108 | + |
| 109 | +The roleNone use CatalogGrant access none; (no access cube1) |
| 110 | + |
| 111 | + |
| 112 | +```xml |
| 113 | +<roma:AccessRole id="_roleNone" name="roleNone"> |
| 114 | + <accessCatalogGrants/> |
| 115 | +</roma:AccessRole> |
| 116 | + |
| 117 | +``` |
| 118 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 119 | +## roleAllDimWithCubeGrand |
| 120 | + |
| 121 | +The roleAll use CatalogGrant access all_dimensions; CubeGrant access all; (access cube1) |
| 122 | + |
| 123 | + |
| 124 | +```xml |
| 125 | +<roma:AccessRole id="_roleAllDimWithCubeGrand" name="roleAllDimWithCubeGrand"> |
| 126 | + <accessCatalogGrants catalogAccess="all_dimensions"> |
| 127 | + <cubeGrants cubeAccess="all" cube="roma:PhysicalCube _Cube1"/> |
| 128 | + </accessCatalogGrants> |
| 129 | +</roma:AccessRole> |
| 130 | + |
| 131 | +``` |
| 132 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 133 | +## roleAllDimWithoutCubeGrand |
| 134 | + |
| 135 | +The roleAll use CatalogGrant access all_dimensions without CubeGrant; (no access cube1) |
| 136 | + |
| 137 | + |
| 138 | +```xml |
| 139 | +<roma:AccessRole id="_roleAllDimWithoutCubeGrand" name="roleAllDimWithoutCubeGrand"> |
| 140 | + <accessCatalogGrants catalogAccess="all_dimensions"> |
| 141 | + <databaseSchemaGrants databaseSchemaAccess="all" databaseSchema="databaseSchema"/> |
| 142 | + </accessCatalogGrants> |
| 143 | +</roma:AccessRole> |
| 144 | + |
| 145 | +``` |
| 146 | +*<small>Note: This is only a symbolic example. For the exact definition, see the [Definition](#definition) section.</small>* |
| 147 | + |
| 148 | +## Definition |
| 149 | + |
| 150 | +This files represent the complete definition of the catalog. |
| 151 | + |
| 152 | +```xml |
| 153 | +<?xml version="1.0" encoding="UTF-8"?> |
| 154 | +<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"> |
| 155 | + <roma:ExplicitHierarchy id="_Hierarchy1" name="Hierarchy1" hasAll="false" primaryKey="_Fact_KEY" query="_FactQuery" levels="_Level1"/> |
| 156 | + <roma:Catalog description="Schema with roles access catalog" name="Cube with roles access catalog" cubes="_Cube1" accessRoles="_roleAll _roleNone _roleAllDimWithCubeGrand _roleAllDimWithoutCubeGrand" dbschemas="databaseSchema"/> |
| 157 | + <roma:DatabaseSchema id="databaseSchema"> |
| 158 | + <tables xsi:type="roma:PhysicalTable" id="_Fact" name="Fact"> |
| 159 | + <columns xsi:type="roma:PhysicalColumn" id="_Fact_KEY" name="KEY"/> |
| 160 | + <columns xsi:type="roma:PhysicalColumn" id="_Fact_VALUE" name="VALUE" type="Integer"/> |
| 161 | + </tables> |
| 162 | + </roma:DatabaseSchema> |
| 163 | + <roma:TableQuery id="_FactQuery" table="_Fact"/> |
| 164 | + <roma:Level id="_Level1" name="Level1" column="_Fact_KEY"/> |
| 165 | + <roma:StandardDimension id="_Dimension1" name="Dimension1" hierarchies="_Hierarchy1"/> |
| 166 | + <roma:PhysicalCube id="_Cube1" name="Cube1" query="_FactQuery"> |
| 167 | + <dimensionConnectors foreignKey="_Fact_KEY" dimension="_Dimension1" overrideDimensionName="Dimension1"/> |
| 168 | + <dimensionConnectors foreignKey="_Fact_KEY" dimension="_Dimension1" overrideDimensionName="Dimension2"/> |
| 169 | + <measureGroups> |
| 170 | + <measures xsi:type="roma:SumMeasure" id="_Measure1" name="Measure1" column="_Fact_VALUE"/> |
| 171 | + </measureGroups> |
| 172 | + </roma:PhysicalCube> |
| 173 | + <roma:AccessRole id="_roleAllDimWithoutCubeGrand" name="roleAllDimWithoutCubeGrand"> |
| 174 | + <accessCatalogGrants catalogAccess="all_dimensions"> |
| 175 | + <databaseSchemaGrants databaseSchemaAccess="all" databaseSchema="databaseSchema"/> |
| 176 | + </accessCatalogGrants> |
| 177 | + </roma:AccessRole> |
| 178 | + <roma:AccessRole id="_roleAllDimWithCubeGrand" name="roleAllDimWithCubeGrand"> |
| 179 | + <accessCatalogGrants catalogAccess="all_dimensions"> |
| 180 | + <cubeGrants cubeAccess="all" cube="_Cube1"/> |
| 181 | + </accessCatalogGrants> |
| 182 | + </roma:AccessRole> |
| 183 | + <roma:AccessRole id="_roleAll" name="roleAll"> |
| 184 | + <accessCatalogGrants catalogAccess="all"/> |
| 185 | + </roma:AccessRole> |
| 186 | + <roma:AccessRole id="_roleNone" name="roleNone"> |
| 187 | + <accessCatalogGrants/> |
| 188 | + </roma:AccessRole> |
| 189 | +</xmi:XMI> |
| 190 | + |
| 191 | +``` |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | +## Turorial Zip |
| 196 | +This files contaisn the data-tables as csv and the mapping as xmi file. |
| 197 | + |
| 198 | +<a href="./zip/tutorial.access.cataloggrand.zip" download>Download Zip File</a> |
0 commit comments