Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-6050

Unable to MASK data using odata-sample

XMLWordPrintable

    • Undefined

      According to the data roles documentation, I should be able to do this:

      CREATE DATABASE test VERSION '1.0.0';
      USE DATABASE test VERSION '1.0.0';
      
      CREATE ROLE user_role  WITH FOREIGN ROLE ROLE_user;
      
      CREATE SERVER accounts FOREIGN DATA WRAPPER h2;
      CREATE SCHEMA public SERVER accounts;
      
      IMPORT FOREIGN SCHEMA PUBLIC FROM SERVER accounts INTO public;
      
      GRANT SELECT ON TABLE public.ACCOUNT TO user_role;
      GRANT SELECT ON COLUMN public.ACCOUNT.SSN
          MASK 'xxxx'
          TO user_role;
      

      Unfortunately I can't get it to work.

      I'm using a modified version of the odata sample from the spring-boot project. My modifications are:

      1. Add a dependency on spring-boot-starter-security
      2. Delete the tests (they break due to the dependency)
      3. Add the above SQL to a file called teiid.ddl in the resources folder
      4. Add the following lines to the application.properties
      spring.security.user.username=user
      spring.security.user.password=user
      spring.security.user.roles=user
      

            rhn-engineering-shawkins Steven Hawkins
            alfborge Alf Lervåg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: