Data Level Entitlements Configuration Explained with Scenarios

Let us understand the data level entitlements configuration by taking the Loan Summary app in CT Modelhouse application as an example.

This app currently displays Personal Loan, Home Loan, and  Car Loan information:


Now, let us see how the entitlements can be configured at the data level for the Loan Summary app to show data relevant and authorized for the user who is viewing it.

  • It is assumed that the user details, product codes and sub product codes are already specified in the relevant tables.
  • As stated earlier, you can define your own entitlement criteria which can also be reused for different product and sub product.
  • You do not have to map any of the defined entitlement criteria to a user if the user has access to all products or services (for example, cards, loans) and if there is no restriction on the information displayed in the app for that user.

Scenario 1 – Using the Default Source Type V

Let us assume that James and Albert are in charge of Home Loan and Personal Loan sales, respectively in a bank. Therefore, the mobile banking app must display Home Loan details for James and Personal Loan details for Albert when they click the loan summary link in the app. Here, the data level entitlement configuration can be as follows:

  1. In the OO_CRITERIA_TYPE_MASTER table, provide the following details:
  • CRITERIA_TYPE = LOAN_CRI
  • DESCRIPTION = Loan type criteria
  • SOURCE_TYPE = V
  • SOURCE_VALUE = Home Loan, Personal Loan

To provide multiple values in the SOURCE_VALUE column, separate the values with comma. However, it is recommended you use source type Q or C if there are many values to be given.

    2. Save the updates done to the OO_CRITERIA_TYPE_MASTER table.

    3. In the OD_USER_FUNCTION_MB table, add a row for James and Albert each and provide the following details:

  • OD_USER_NO: Provide James and Albert's user number as 201206000010 and 201206000003, respectively.
  • CRITERIA_TYPE: Provide LOAN_CRI as the criteria type.
  • OD_ACC_NO: Specify Home Loan for James and Personal Loan for Albert.
  • Save the updates done to the table.



      4. Map the entitlement criteria (LOAN_CRI) to the LOAN TYPE view column while creating the app using App Designer in Canvas Studio.

App Designer: 


For more information, refer Designing Apps using App Designer. The Loan Summary app displays the Home Loan details for James: 


The Loan Summary app displays the Personal Loan details for Albert: 

Scenario 2 – No Entitlement Criteria Defined

Let us assume that William - the Loan Department Head of a bank is entitled to all the loan products (Home Loan, Personal Loan, and Car Loan) and hence, the Loan Summary app must display data pertaining to all the loan types. In this scenario, there is no need to map any entitlement criteria for William. The Loan Summary app displays all loan type details for William: 

Scenario 3 – Using the $ALL Keyword with the Source Type V or C

Let us assume a scenario where the bank currently offers 3 loans - Home Loan, Personal Loan and Car Loan. William, the Loan Department Head is entitled to all loan products. However, the bank for some reason has decided that the app must show only Home Loan and Personal Loan to William. Now let us see how to achieve this scenario using source type V or C.

$ALL Keyword with the Source Type V

In this scenario, the loan types offered by the bank are less. Hence, the $ALL keyword with source type V approach can be used to achieve the desired result.

1: In the OO_CRITERIA_TYPE_MASTER table, provide the following details:

  • CRITERIA_TYPE = LOAN_CRI
  • DESCRIPTION = Loan type criteria
  • SOURCE_TYPE = V
  • SOURCE_VALUE = Home Loan, Personal Loan

To provide multiple values in the SOURCE_VALUE column, separate the values with comma. However, it is recommended you use source type Q or C if there are many values to be given.


2: Save the updates done to the OO_CRITERIA_TYPE_MASTER table.



3: In the OD_USER_FUNCTION_MB table, provide the following details:

  • OD_USER_NO: Provide William's user number - 201206000012
  • CRITERIA_TYPE: Provide LOAN_CRI as the criteria type.
  • OD_ACC_NO: Specify the $ALL keyword.
  • Save the updates done to the table.



4: Map the entitlement criteria (LOAN_CRI) to the LOAN TYPE view column while creating the app using App Designer in Canvas Studio.


App Designer:

For more information, refer Designing Apps using App Designer. The Loan Summary app only displays Home Loan and Personal Loan details for William:

$ALL Keyword with the Source Type C

We can also achieve the above mentioned scenario by using the $ALL keyword with the source type C approach.

When using the source type C, a Java class must be invoked to return data for the specified values. This source type is recommended if you want to apply some logic to filter data in a scenario or if the source is a Web service, database, Excel file, text file and so on. There is no restriction with respect to the data source when you use a Java class.


1: In the OO_CRITERIA_TYPE_MASTER table, provide the following details:

  • CRITERIA_TYPE = LOAN_CRI
  • DESCRIPTION = Loan type criteria
  • SOURCE_TYPE = C
  • SOURCE_VALUE = com.intellectdesign.modelhouse.LoanTypesEntitlmentProvider

2: Save the updates done to the OO_CRITERIA_TYPE_MASTER table.


SampleCritValues.txt is the source file containing the possible values for data filtering.


This is a sample entitlement provider where we will read possible values from a text file. Implementation teams are free to decide the source of this data, which can be a file, DB, Web service or anywhere else.

/*
 * Copyright 2018. Intellect Design Arena Limited. All rights reserved.
 * These materials are confidential and proprietary to Intellect Design Arena Limited
 * and no part of these materials should be reproduced, published, transmitted
 * or distributed in any form or by any means, electronic, mechanical, photocopying,
 * recording or otherwise, or stored in any information storage or retrieval system
 * of any nature nor should the materials be disclosed to third parties or used in any
 * other manner for which this is not authorized, without the prior express written
 * authorization of Intellect Design Arena Limited.
 */
package com.intellectdesign.modelhouse;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import com.intellectdesign.canvas.entitlement.EntitlementException;
import com.intellectdesign.canvas.entitlement.IEntitlementDataProvider;

/*
 * Link this class as the source for all possible values for a given entitlement
 * criteria
 * @Version 1.0
 */

public class LoanTypesEntitlmentProvider implements IEntitlementDataProvider 
{
    /**
     * Implementation teams have to implement this method and return all
     * possible values for a given entitlement criteria.
     * @param product
     * @param subProduct
     * @param function
     * @param criteriaName the name of the entitlement criteria
     * @return a list of String which are the possible values for given entitlement criteria
     * @throws EntitlementException in case of any exception in preparing the list
     * @see com.intellectdesign.canvas.entitlement.IEntitlementDataProvider#getCriteriaValues(java.lang.String,
     *java.lang.String, java.lang.String, java.lang.String)
     **/

    @Override
    public List getCriteriaValues(String product, String subProduct,
									String function, String criteriaName) throws EntitlementException 
	{
		List<String> possibleCriteriaValues = new ArrayList<String>();

      	// This is a sample entitlement provider where we will read possible values from a text file
      	// Implementation teams are free to decide the source of this data (from a DB/Web service/File or anywhere else)

      	File sourceFile = new File("D:\\SampleCritValues.txt");
      	Scanner fileScanner;
      	try 
		{
			fileScanner = new Scanner(sourceFile);
          	while (fileScanner.hasNextLine())
	            possibleCriteriaValues.add(fileScanner.nextLine());
      	} catch (FileNotFoundException e) 
		{
			// Throw exception if the file is not found
			e.printStackTrace();
			throw new EntitlementException(e);
		}
      	return possibleCriteriaValues;
    }
}


A sample Java class named LoanTypesEntitlmentProvider for the SampleCritValues.txt source file is as follows.
Note: The Java class written by you must implement the IEntitlementDataProvider interface.

  1. In the OD_USER_FUNCTION_MB table, provide the following details:

    • OD_USER_NO: Provide William's user number – 01206000012
    • CRITERIA_TYPE: Provide LOAN_CRI as the criteria type.
    • OD_ACC_NO: Specify the $ALL keyword.
    • Save the updates done to the table.


  2. Map the entitlement criteria (LOAN_CRI) to the LOAN TYPE view column while creating the app using App Designer in Canvas Studio.


App Designer:

For more information, refer Designing Apps using App Designer. The Loan Summary app only displays Home Loan and Personal Loan details for William:

Scenario 4 – Using the $ALL Keyword with the Source Type Q

Let us assume a scenario where a bank currently offers 2 loans - Home Loan and Personal Loan and is planning to offer Car Loan and Venture Loan after testing the response in the pilot stage. The response for the Car Loan was good and hence, the bank decides to launch the product and adds 'Y' in the LAUNCHED column of the master table maintained for loans (for example, LOAN_TYPE_MASTER). The LOAN_TYPE_MASTER table also consists of an entry for Venture Loan which has not been launched yet.

The table used for the view (for example, LOAN_SUMMARY_DATA) consists of an entry for Venture Loan and Car Loan. Initially the app showed only Home Loan and Personal Loan details to Williams - the Loan Department Head. However, now it must also show Car Loan details to William. That is, all the loans that have been launched must be shown in the app for William.

It is assumed that you will be maintaining master tables to make any updates with respect to addition or deletion of products or services.


The sample screen shot of the master table for loans named LOAN_TYPE_MASTER is as follows:


The sample screen shot of the LOAN_SUMMARY_DATA used for the view is as follows:


ALL keyword with source type Q - In scenarios like these, it is best to fetch data through a query.

  1. In the OO_CRITERIA_TYPE_MASTER table, provide the following details:
  • CRITERIA_TYPE = LOAN_CRI
  • DESCRIPTION = Loan type criteria
  • SOURCE_TYPE = Q
  • SOURCE_VALUE = select LOAN_TYPE from LOAN_TYPE_MASTER where LAUNCHED='Y';


     2. Save the updates done to the OO_CRITERIA_TYPE_MASTER table.



    3. In the OD_USER_FUNCTION_MB table, provide the following details:

  • OD_USER_NO: Provide William's user number - 201206000012
  • CRITERIA_TYPE: Provide LOAN_CRI as the criteria type.
  • OD_ACC_NO: Specify the $ALL keyword.
  • Save the updates done to the table.



   4. Map the entitlement criteria (LOAN_CRI) to the LOAN TYPE view column while creating the app using App Designer in Canvas Studio.


App Designer:

For more information, refer Designing Apps using App Designer. The Loan Summary app displays details pertaining to all the loans that have been launched to William:


Scenario 5 – Using the Predefined Entitlement Criteria


Let us assume a scenario where you have created a view using the LOAN_SUMMARY_DATA table which consists of columns for the product and sub product.
Sample screen shot of LOAN_SUMMARY_DATA table:


At the app/view level in App Designer you have provided RETAIL (product) and LOANS (sub product) as the access level entitlements and want to further filter data for the specified access level entitlements. That is, all types of loans excluding Venture Loans (the product code for it is CORPORATE) must display in the app.

Sample screen shot of the App Designer screen for the CT_LOAN_SUMMARY_VIEW:


In such scenarios, you can make the product and sub product as the entitlement criteria by using the predefined criteria – 'CT_INPUT_PRODUCT' and 'CT_INPUT_SUB_PRODUCT'.
Map the entitlement criteria (CT_INPUT_PRODUCT) to the PRODUCT view column and (CT_INPUT_SUB_PRODUCT) to the SUB PRODUCT view column, respectively while creating the app using App Designer in Canvas Studio.

App Designer:


For more information, refer Designing Apps using App Designer. Users who are entitled to RETAIL (product) and LOANS (Sub product) will be able to view Home Loan, Car Loan, and Personal Loan details in the Loan Summary app: