OracleAppsDNA

MOAC – Oracle Apps ORG_ID, Multi Org Concept

Its quite obvious that an organization may have its operations in different locations of the globe which we call as operating units in-terms of oracle ERP.

Multi-Org Architecture Prior to Release 12

Multi-Org Architecture in Release 12

In release 12 a more flexible architecture has been put in place to support Multi-Org Access Control (MOAC). This architecture allows users to define security profiles so that users may access data for more than one operating unit within a single responsibility.

To accomplish this

More about ‘MO_GLOBAL.ORG_SECURITY’

The purpose of Row-Level-Security is to hide certain data [based on some conditions]. RLS does so by appending a where clause to the secured object.

  1.  MO_GLOBAL.ORG_SECURITY is a function that returns a predicate for the WHERE CLAUSE
  2. The where clause will be appended to Table/Synonym/View for which Multi Org Row Level security is enabled

How to set Org Context in R12?

BEGIN
  execute mo_global.set_policy_context('S',&org_id);
END;
--'S' means Single Org Context.

Where

  1. option ‘S’ is used to fetch records from specified org_id
  2. option ‘M’ is used to fetch records from all accessible Operating Units
  3. option ‘A’ is used to fetch records from all Operating Units

If you want access to multiple organization data, you can change the first parameter to ‘M’ (for multiple orgs), all organizations accessible by user:

BEGIN
apps.mo_global.set_policy_context('M','');
END;

How to check if user has access to a particular organization?

SELECT organization_id,
  name,
  mo_global.check_access(ORGANIZATION_ID) accessible
FROM HR_OPERATING_UNITS;

Other procedures/functions of MO_GLOBAL API are listed below:

Purpose Procedure/Function Description
Initialize INIT Set up multiple organizations context.
JTT initialize JTT_INIT Initialize multiple organizations for JTT based application.
Is multi-org enabled is_multi_org_enabled Check if the multiple organizations instance is enabled.
Check access check_access Check if the operating unit is accessible.
Get OU name get_ou_name Get the operating unit name.
Check valid org check_valid_org Check if the organization is valid.
Set policy context set_policy_context Set the application policy context.
Get current org Id get_current_org_id Get the current organization ID in the application context.
Get access mode get_access_mode Get the application context mode.
Get OU count get_ou_count Get the operating unit count on the access control list.
Get valid org get_valid_org Get the current default/valid organization.
Validate org id public API validate_orgid_pub_api Get the default organization and check if the organization is valid.
Is MO initialization done is_mo_init_done Check if the multiple organization is initialized.

For more information on the above APIs and how to use them, please go through Oracle’s Integration Repository

How to check if an Organization is present is Security Profile or not?

We have another MOAC utility API ‘MO_UTILS’ which can be used in reports and extensions.

SELECT organization_id,
  name,
  mo_utils.check_org_in_sp(ORGANIZATION_ID, 'OPERATING_UNIT') accessible
FROM HR_OPERATING_UNITS;
-- Returns Y or N depending on whether user has access to given organization

Other procedures/functions of MO_UTILS API are listed below:

Purpose Procedure/Function Description
Purpose Procedure/Function Description
Get Ledger Name Get_Ledger_Name Returns the ledger name.
Get ledger information Get_Ledger_Info Returns information about the ledger.
Get Default operating unit get_default_ou Gets the default operating unit from MO: Default Operating Unit profile or from current organization.
Get Default operating unit Id get_default_org_id Returns the organization ID of the default operating unit.
Check org in security profile check_org_in_sp Checks if the specified organization is present in the security profile.
Check ledger in security profile check_ledger_in_sp Checks if all operating units of a ledger are included in the security profile.
Get organization name Get_Org_Name Returns the operating unit name for an organization ID.
Get organization IDs for the ledger get_orgid_fr_ledger Returns the operating unit ID and the number of operating units in the given ledger.

Please drop a comment if you need any more additional information, I will do my best to help you out.

Exit mobile version