Your browser does not support JavaScript. This help page requires JavaScript to render correctly.
Skip Headers
Previous
Previous
 
Next
Next

Step 9: Test the ACCESS_LOCATIONS Policy

The ACCESS_LOCATIONS policy is complete and ready to be tested. You can test it by logging in to SQL*Plus as each of the three users and performing a SELECT on the HR.LOCATIONS table.

To test the ACCESS_LOCATIONS policy: 

  1. In SQL*Plus, connect as user sking.

    CONNECT sking
    Enter password: password
    
  2. Enter the following:

    The following commands format the width of the table columns so that you can read them easier. You only need to perform this step once for the entire session (including when kpartner and ldoran log in.)

    COL city HEADING City FORMAT a25
    COL country_id HEADING Country FORMAT a11
    COL Label format a10
    

    Now enter the SELECT statement as follows:

    SELECT city, country_id, LABEL_TO_CHAR (OLS_COLUMN)
       AS Label FROM hr.locations ORDER BY ols_column;
    

    User sking is able to access all 23 rows of the HR.LOCATIONS table. Even though he is only authorized to access rows that are labeled CONF and SENS, he can still read (but not write to) rows labeled PUB.

    City                      Country     LABEL
    ------------------------- ----------- ----------
    Venice                    IT          PUB
    Utrecht                   NL          PUB
    Bern                      CH          PUB
    Geneva                    CH          PUB
    Sao Paulo                 BR          PUB
    Stretford                 UK          PUB
    Mexico City               MX          PUB
    Hiroshima                 JP          PUB
    Southlake                 US          PUB
    South San Francisco       US          PUB
    South Brunswick           US          PUB
    Seattle                   US          PUB
    Toronto                   CA          PUB
    Whitehorse                CA          PUB
    Bombay                    IN          PUB
    Sydney                    AU          PUB
    London                    UK          PUB
    Oxford                    UK          CONF
    Munich                    DE          CONF
    Roma                      IT          CONF
    Singapore                 SG          SENS
    Tokyo                     JP          SENS
    Beijing                   CN          SENS
    
    23 rows selected.
    
  3. Repeat Steps 1 and 2 for users kpartner and ldoran.

    User KPARTNER can access the rows labeled CONF and PUB:

    City                      Country     LABEL
    ------------------------- ----------- ----------
    Venice                    IT          PUB
    Utrecht                   NL          PUB
    Bern                      CH          PUB
    Mexico City               MX          PUB
    Hiroshima                 JP          PUB
    Southlake                 US          PUB
    South San Francisco       US          PUB
    South Brunswick           US          PUB
    Seattle                   US          PUB
    Toronto                   CA          PUB
    Whitehorse                CA          PUB
    Bombay                    IN          PUB
    Sydney                    AU          PUB
    London                    UK          PUB
    Stretford                 UK          PUB
    Sao Paulo                 BR          PUB
    Geneva                    CH          PUB
    Oxford                    UK          CONF
    Munich                    DE          CONF
    Roma                      IT          CONF
     
    20 rows selected.
    

    User LDORAN can access the rows labeled PUB:

    City                      Country     LABEL
    ------------------------- ----------- ----------
    Venice                    IT          PUB
    Hiroshima                 JP          PUB
    Southlake                 US          PUB
    South San Francisco       US          PUB
    South Brunswick           US          PUB
    Seattle                   US          PUB
    Toronto                   CA          PUB
    Whitehorse                CA          PUB
    Bombay                    IN          PUB
    Sydney                    AU          PUB
    London                    UK          PUB
    Stretford                 UK          PUB
    Sao Paulo                 BR          PUB
    Geneva                    CH          PUB
    Bern                      CH          PUB
    Utrecht                   NL          PUB
    Mexico City               MX          PUB
     
    17 rows selected.
    
  4. Exit SQL*Plus.

Related Topics

About Oracle Label Security