1. Manage Tenant Groups

1.1. Add a Tenant Group

Use the script API_SCURTY.ADD_TENANT_GROUP to add a tenant group. The example below sets the all-tenant code to ‘ALL’ (which is the default). Thos means that later you may grant access to a user on an object group to ALL tenants, i.e. with no restriction, instead of granting each and every single tenant code.

Example

1EXECUTE SCRIPT API_SCURTY.ADD_TENANT_GROUP (
2     'TEST_Tenant'    -- p_tnt_group
3     ,'Tenant-Test'   -- p_tnt_group_desc
4     ,null            -- p_all_tnt_code
5);

The newly added tenant group can be found in the table REP_TENANT_GROUPS.

TNT_GROUP

TNT_GROUP_DESC

ALL_TNT_CODE

TEST_TENANT

Tenant-Test

ALL

1.2. Change a Tenant Group

Modify the parameters using the script API_SCURTY.CHANGE_TENANT_GROUP. Providing NULL leaves the parameters as is, while a blank (’ ‘) restores the default value.

In this example the description and the tenant code will be changed. With this change the keyword ‘ALL’ in the tenant acces configuration will be inerprated as a real tenant code while ‘ALL-TNT’ would be interprated as the dummy code for really all possible tenant codes.

Example

1EXECUTE SCRIPT API_SCURTY.CHANGE_TENANT_GROUP (
2     'TEST_TENANT'           -- p_tnt_group
3     ,'Test Tenant-Change'   -- p_tnt_group_desc
4     ,'ALL-TNT'                 -- p_all_tnt_code
5);

The modifications can be seen in the table REP_TENANT_GROUPS.

TNT_GROUP

TNT_GROUP_DESC

ALL_TNT_CODE

TEST_TENANT

Test Tenant-Change

TEST

1.3. Remove a Tenant Group

To remove a tenant group use the script API_SCURTY.REMOVE_TENANT_GROUP.

Example

1EXECUTE SCRIPT API_SCURTY.REMOVE_TENANT_GROUP (
2     'TEST_TENANT'   -- p_tnt_group
3);

After successfully running the command above the entry with the TNT_GROUP variable set to ‘TEST_TENANT’ in the table REP_TENANT_GROUPS is gone.