Search Results get_security_access




Overview

APPS.MSC_X_SECURITY is a PL/SQL package in the Oracle E-Business Suite Advanced Supply Chain Planning (ASCP) module that enforces company-level data security for the MSC schema. Its central responsibility is twofold: it establishes the session context under which planning data queries are evaluated, and it resolves the applicable security privilege for a given transaction in the supply/demand stream. The package body carries a low-level header marker (MSCXSECB.pls 115.4), indicating it is a long-standing component that has changed little since its original shipment.

The package depends on Oracle's application context facility, writing values into the MSC namespace via DBMS_SESSION.SET_CONTEXT. Downstream planning views and queries reference this context to filter records so that a user sees only the company or companies to which they have been granted access through MSC_COMPANY_USERS. Because the context is session-scoped, the package must be invoked each time a new database session begins work on planning data.

Key Procedures and Functions

The ETRM metadata documents one procedure for this package, SET_CONTEXT, along with an internal function GET_SECURITY_ACCESS visible in the source excerpt.

  • SET_CONTEXT — Initializes the MSC application context for the current session. It first nulls out the COMPANY_ID and COMPANY_NAME context values, then queries MSC_COMPANY_USERS and MSC_COMPANIES using the current FND_GLOBAL.USER_ID to retrieve the user's associated company name and identifier. If no matching company is found or an error occurs, the procedure assigns sentinel values (company id -666 and name '###UNDEFINED####'), ensuring the session fails safe to an undefined state. The resolved values are then written back into the MSC context namespace.
  • GET_SECURITY_ACCESS — Accepts a transaction identifier and returns a privilege string. It iterates over a join of MSC_SUP_DEM_ENTRIES and MSC_X_SECURITY_RULES, matching on publisher, order type, item, customer, supplier, and their respective sites, while honoring effective-from and effective-to date ranges on the rules. An internal comment in the source notes the function's performance is a known concern.

Tables Accessed

  • MSC_COMPANY_USERS — Association between application users and planning companies; drives the company lookup in SET_CONTEXT.
  • MSC_COMPANIES — Master company definition, supplying the company name and id for the session context.
  • MSC_SUP_DEM_ENTRIES — Supply/demand records whose publisher, item, customer, supplier, and site attributes are matched against security rules.
  • MSC_X_SECURITY_RULES — The rule repository defining which privilege applies to which combination of company, order type, item, party, and site within a validity window.
  • DBMS_SESSION — Oracle-supplied package used to set context values in the MSC namespace.

Usage Notes

SET_CONTEXT is typically invoked at the start of user sessions that access ASCP planning forms, dashboards, or reports, so that all subsequent queries are filtered by the session's company context. GET_SECURITY_ACCESS is used within planning logic that must determine, for an individual supply or demand transaction, whether the current user holds an appropriate privilege. Because the ETRM classification for this package is OTHER rather than a public API, customers and partners should treat both routines as internal. Customizations should prefer supported security configuration mechanisms, and any direct call should be aware of the fixed sentinel values used when no company is resolved and of the documented performance limitations of GET_SECURITY_ACCESS. The package is referenced by one other package, confirming its role as a shared infrastructure utility rather than an entry point.