Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Apply Data Security to create security rules for a cube semantic model and assign those rules to a specific user/group. A Data Security rule will contain row level security filters on which the user has access and column level security fields on which the user does not have access.

...

  1. Add data security rule

    Code Block
    /**
    * method to add Data Security Rule on semantic cubemodel object.
    * @param cubeObject: Object of type CubeObject.
    * @param ruleName: Name of the rule.
    * @param ruleDescription: Description of the rule.
    * @param rowLevelFilters: Filters to be applied for row level security.
    * @param columnLevelFields: CubeSemantic model fields on which column level security has to be applied.
    * @param userInfo: Object of type UserInfo containing information about logged in user.
    * @return ResponseStatus: Object of type ResponseStatus.
    */
    public ResponseStatus addDataSecurityRule(CubeObject cubeObject, String ruleName, String ruleDescription, List<com.kyvos.commons.entity.olap.viewer.Filter> rowLevelFilters, List<ColumnLevelSecurityField> columnLevelFields, UserInfo userInfo);
    1. Create row level dimension filter

      Code Block
       /**
      * method to create the row level filters on given dimension and level by dimension name and level name.
      * @param dimensionName: Dimension name to be filter applied.
      * @param levelName: Level or Attribute name of the dimension.
      * @param operator: Operator to be applied e.g. CONTAINS, STARTSWITH. Operators are defined in {@link com.kyvos.commons.globals.Enums.AdhocConfigurations.Operators} class.
      * @param value: Filter value.
      * @return: Newly created Filter object.
      * @throws ISecurityException.
      */
      public com.kyvos.commons.entity.olap.viewer.Filter createRowLevelDimensionFilter(CubeObject cubeObject, String dimensionName, String levelName, String operator, String value);
      /**
      * method to create the list of values of filter on given dimension and level by dimension name and level name.
      * @param dimensionName: Dimension name to be filter applied.
      * @param levelName: Level or Attribute name of the dimension.
      * @param valueList: List of Filter value strings.
      * @return: Newly created Filter object.
      * @throws ISecurityException.
      */
      public com.kyvos.commons.entity.olap.viewer.Filter createRowLevelDimensionFilterByList(CubeObject cubeObject, String dimensionName, String levelName, String operator, List<String> valuesList);
    2. Create column level fields

      Code Block
      /**
      * method to get column level field by dimension.
      * @param cubeObject: Object of type CubeObject.
      * @param dimensionName: Name of the dimension.
      * @return object of type ColumnLevelSecurityField.
      * @throws ISecurityException.
      */
      public ColumnLevelSecurityField createColumnLevelFieldByDimension(CubeObject cubeObject, String dimensionName);
      /**
      * method to get column level field by measure.
      * @param cubeObject: Object of type CubeObject.
      * @param measureName: Name of the measure.
      * @return object of type ColumnLevelSecurityField.
      * @throws ISecurityException.
      */
      public ColumnLevelSecurityField createColumnLevelFieldByMeasure(CubeObject cubeObject, String measureName);
      
      /**
      * method to get column level field by level.
      * @param cubeObject: Object of type CubeObject.
      * @param dimensionName: Name of the dimension.
      * @param levelName: Name of the level.
      * @return object of type ColumnLevelSecurityField.
      * @throws ISecurityException.
      */
      public ColumnLevelSecurityField createColumnLevelFieldByLevel(CubeObject cubeObject, String dimensionName, String levelName);
      /**
      * method to get column level field by attribute.
      * @param cubeObject: Object of type CubeObject.
      * @param dimensionName: Name of the dimension.
      * @param attributeName: Name of the attribute.
      * @return object of type ColumnLevelSecurityField.
      * @throws ISecurityException.
      */
      public ColumnLevelSecurityField createColumnLevelFieldByAttribute(CubeObject cubeObject, String dimensionName, String attributeName);
      /**
      * method to get column level field by hierarchy.
      * @param cubeObject: Object of type CubeObject.
      * @param dimensionName: Name of the dimension.
      * @param hierarchyName: Name of the hierarchy.
      * @return object of type ColumnLevelSecurityField.
      * @throws ISecurityException.
      */
      public ColumnLevelSecurityField createColumnLevelFieldByHierarchy(CubeObject cubeObject, String dimensionName, String hierarchyName);
    3. Add data security rule mapping for user

      Code Block
      /**
      * method to add data security rules mapping for a user.
      * @param cubeObject: Object of type CubeObject.
      * @param username: Name of the user.
      * @param rulesNameList: List of rules name.
      * @param userInfo: Object of type UserInfo containing information about logged in user.
      * @return object of type ResponseStatus.
      * @throws ISecurityException.
      */
      public ResponseStatus addDataSecurityRulesMappingForUser(CubeObject cubeObject, String userName, List<String> rulesNameList, UserInfo userInfo);
    4. Add data security rule mapping for group

      Code Block
      /**
      * method to add data security rules mapping for a group.
      * @param cubeObject: Object of type CubeObject.
      * @param groupName: Name of the group.
      * @param rulesNameList: List of rules name.
      * @param userInfo: Object of type UserInfo containing information about logged in user.
      * @return object of type ResponseStatus.
      * @throws ISecurityException.
      */
      public ResponseStatus addDataSecurityRulesMappingForGroup(CubeObject cubeObject, String groupName, List<String> rulesNameList, UserInfo userInfo);

...