Oracle Retail18 min readBy Priyanshu Pandey

The Oracle RMS Security Model: Roles, Data-Level Security & VPD Policies

A comprehensive guide to the Oracle RMS security architecture. Learn how role-based access control works through SEC_USER_ROLE and SEC_PRIV tables, data-level security filtering, VPD (Virtual Private Database) policies, LDAP integration, and the ADMIN_USER_PRIV setup process.

Phase 10 · Administration & Operations

Ensuring the right people see the right data and can perform the right actions — from menu-level access to row-level data filtering.

18 min read📅Jun 9, 2026✍️Priyanshu Pandey📚Oracle RMS Series
SECURITY LAYERS

Security Architecture Overview

Oracle RMS implements security at two distinct levels:

Both layers work together. A user might have functional access to the Purchase Order screen (they can open it), but data-level security restricts them to seeing only POs for Department 1000 (their assigned department).

FUNCTIONAL SECURITY

Functional Security (Roles & Privileges)

Functional security in RMS is based on a Role → Privilege → Screen model:

The Hierarchy

USER (john.doe)
  │
  ├── ROLE: BUYER
  │     ├── PRIV: PO_CREATE        → Can create Purchase Orders
  │     ├── PRIV: PO_APPROVE       → Can approve POs up to $50,000
  │     ├── PRIV: ITEM_VIEW        → Can view item details
  │     └── PRIV: ITEM_EDIT        → Can modify item attributes
  │
  └── ROLE: REPORTING
        ├── PRIV: REPORT_INVENTORY → Can run inventory reports
        └── PRIV: REPORT_SALES    → Can run sales reports

Privilege Types

  • Menu Access: Controls which menu items/screens the user can see in the navigation
  • Function Access: Controls which actions within a screen are available (Create, Edit, Delete, Approve)
  • Value Threshold: Controls limits (e.g., PO approval limit of $50,000 vs $500,000)
  • Report Access: Controls which reports the user can execute
DATA FILTERING

Data-Level Security

Data-level security restricts which rows a user can see based on their organizational assignments. This is implemented through security filters applied to every query.

Security Dimensions

DimensionExampleEffect
DepartmentUser assigned to Dept 1000, 2000User only sees items, POs, and inventory in those departments
LocationUser assigned to District "Northeast"User only sees stores and warehouses in the Northeast district
SupplierUser assigned to Supplier Group "Apparel"User only sees suppliers in the Apparel group

How It Works Internally

When a user queries the Item Master screen, RMS does NOT simply run SELECT * FROM ITEM_MASTER. Instead, it adds a security filter:

Security Filter Applied Internally
SQL
-- What the user THINKS the query is:
SELECT item, item_desc, dept, class FROM item_master;

-- What RMS ACTUALLY executes:
SELECT im.item, im.item_desc, im.dept, im.class 
FROM   item_master im
WHERE  im.dept IN (
    SELECT sur.dept 
    FROM   sec_user_role sur 
    WHERE  sur.user_id = SYS_CONTEXT('USERENV', 'CLIENT_IDENTIFIER')
      AND  sur.role_id = 'BUYER'
);

This filtering happens transparently. The user never knows they are seeing a restricted dataset — they simply don't see data outside their assigned scope.

SECURITY TABLES

Key Security Tables

Core RMS Security Tables
ColumnTypeDescription
SEC_USERPK
User Master

Master user table. Contains user_id, user_name, password hash (for non-LDAP), status (Active/Inactive), default language, and last login timestamp.

SEC_ROLEPK
Role Definitions

Defines roles in the system. Contains role_id, role_name, and description. Examples: BUYER, ALLOCATOR, INVENTORY_ANALYST, ADMIN.

SEC_USER_ROLE
User-Role Assignment

Maps users to roles. A user can have multiple roles. Contains user_id, role_id, and effective date range.

SEC_PRIVPK
Privilege Definitions

Defines individual privileges. Contains priv_id, priv_name, priv_type (MENU, FUNCTION, REPORT), and the associated screen/action.

SEC_ROLE_PRIV
Role-Privilege Assignment

Maps privileges to roles. Contains role_id and priv_id. This is where you control what each role can do.

SEC_USER_LOC
Location Security

Assigns users to specific locations or location hierarchies. Contains user_id, loc (store/warehouse number), and loc_type.

SEC_USER_DEPT
Department Security

Assigns users to specific departments. Contains user_id and dept. A buyer assigned to dept 1000 can only manage items in that department.

SETUP PROCESS

User & Role Setup Process

Creating a New User

Setting Up a New Buyer User
SQL
-- 1. Create the user
INSERT INTO sec_user (
    user_id, user_name, lang, status,
    create_datetime, last_update_id
) VALUES (
    'JDOE', 'John Doe', 'EN', 'A',
    SYSDATE, 'ADMIN'
);

-- 2. Assign the BUYER role
INSERT INTO sec_user_role (
    user_id, role_id, 
    start_date, end_date,
    create_datetime, last_update_id
) VALUES (
    'JDOE', 'BUYER',
    TRUNC(SYSDATE), NULL,
    SYSDATE, 'ADMIN'
);

-- 3. Assign department-level data security
INSERT INTO sec_user_dept (
    user_id, dept,
    create_datetime, last_update_id
) VALUES (
    'JDOE', 1000,   -- Menswear department
    SYSDATE, 'ADMIN'
);

-- 4. Assign location-level data security
INSERT INTO sec_user_loc (
    user_id, loc, loc_type,
    create_datetime, last_update_id
) VALUES (
    'JDOE', 'NE',   -- Northeast region
    'R',             -- Region type
    SYSDATE, 'ADMIN'
);

COMMIT;

Role Template Examples

RoleMenu AccessData Scope
BUYERItems, POs, Suppliers, CostAssigned departments only
ALLOCATORAllocation, Transfers, InventoryAssigned departments + warehouses
INVENTORY_ANALYSTInventory, Stock Counts, AdjustmentsAssigned locations only
PRICE_ANALYSTPricing, Promotions, ClearanceAssigned departments only
STORE_MANAGERTransfers, Receiving, Stock CountsAssigned store only
ADMINAll screensAll data
VPD

VPD (Virtual Private Database) Policies

In more advanced RMS deployments, data-level security is enforced using Oracle Virtual Private Database (VPD) — a database-level security feature that automatically appends WHERE clauses to every query.

How VPD Works

  1. A VPD policy function is attached to a table (e.g., ITEM_MASTER)
  2. Every time ANY query runs against that table, Oracle automatically calls the policy function
  3. The policy function returns a WHERE clause predicate based on the current user's security profile
  4. Oracle appends this predicate to the query before execution
-- VPD Policy Function Example
CREATE OR REPLACE FUNCTION fn_item_security (
    p_schema  IN VARCHAR2,
    p_object  IN VARCHAR2
) RETURN VARCHAR2 IS
    l_predicate VARCHAR2(4000);
BEGIN
    -- Get the current user's department assignments
    l_predicate := 'dept IN (SELECT dept FROM sec_user_dept ' ||
                   'WHERE user_id = SYS_CONTEXT(''USERENV'', ''CLIENT_IDENTIFIER''))';
    RETURN l_predicate;
END;
/

-- Attach the policy to ITEM_MASTER
BEGIN
    DBMS_RLS.ADD_POLICY(
        object_schema   => 'RMS13',
        object_name     => 'ITEM_MASTER',
        policy_name     => 'ITEM_DEPT_SECURITY',
        function_schema => 'RMS13',
        policy_function => 'FN_ITEM_SECURITY',
        statement_types => 'SELECT,UPDATE,DELETE'
    );
END;
/
ℹ️

VPD is Invisible

The beauty of VPD is that it is completely transparent to the application. Developers write normal SQL without any security filters. The database silently restricts the rows returned based on the user's profile. This prevents developers from accidentally bypassing security by forgetting to add WHERE clause filters.

LDAP

LDAP / Active Directory Integration

Enterprise RMS deployments integrate with corporate LDAP or Active Directory for authentication:

  1. User logs into RMS with their corporate credentials
  2. RMS authenticates against the LDAP server (via the WebLogic LDAP authenticator)
  3. RMS maps the LDAP user to the SEC_USER table (user_id must match LDAP uid)
  4. RMS loads the user's roles from SEC_USER_ROLE
  5. RMS applies data security based on SEC_USER_DEPT and SEC_USER_LOC

This eliminates the need for RMS-specific passwords and enables Single Sign-On (SSO) across the enterprise application suite.

CLOUD SECURITY

Security in the Cloud (v19+)

In the cloud (MFCS), the security model adds additional layers:

  • Oracle Identity Cloud Service (IDCS): Replaces LDAP as the identity provider. All user authentication goes through IDCS with support for SSO, MFA (Multi-Factor Authentication), and social login.
  • Application Roles: Managed through IDCS role assignments rather than direct SEC_USER_ROLE inserts
  • Network Security: All communication is encrypted (TLS 1.2+). VPN or FastConnect required for integration with on-premise systems.
  • API Authentication: REST API access requires OAuth2 tokens with scoped permissions
BEST PRACTICES

Security Best Practices

Important Gotchas

  • !
    Never grant a user the ADMIN role in production unless absolutely necessary. Admin users bypass data-level security and can see/modify all data across all departments and locations.
  • !
    Review SEC_USER_ROLE assignments quarterly. Employees who change departments or roles often retain their old security assignments, violating the principle of least privilege.
  • !
    VPD policies have performance implications. The policy function is called for every query against the protected table. Ensure the function is optimized (indexed lookups, no expensive joins) and the result is cached in the session context.
  • !
    When testing security, always test with a non-admin account. Admin users bypass all security filters, so bugs in security configuration are invisible when testing as admin.
  • !
    LDAP integration failures are common during initial setup. The most frequent issue is a mismatch between the LDAP uid and the SEC_USER.user_id. Ensure they match exactly (case-sensitive).

Key Takeaways

  • RMS security operates at two levels: Functional Security (what you can DO) and Data-Level Security (what you can SEE).
  • The SEC_USER → SEC_USER_ROLE → SEC_ROLE_PRIV chain controls which screens and actions each user can access.
  • SEC_USER_DEPT and SEC_USER_LOC tables restrict data visibility by department and location hierarchy.
  • VPD (Virtual Private Database) policies enforce row-level security transparently at the database level — developers don't need to add security filters to queries.
  • Enterprise deployments integrate with LDAP/Active Directory for authentication; cloud deployments use Oracle Identity Cloud Service (IDCS).
  • Always follow the principle of least privilege — grant users the minimum roles and data access required for their job function.
RetailCoder
All systems operational
v1.0 Live

RC:OMS

Multi-channel order management with double-entry inventory ledger. Amazon, Flipkart, Shopify, WooCommerce — one source of truth.

Launch demo →
v1.0 Live

RC:Storefront

Self-hosted headless e-commerce. Your server, your data, zero transaction fees. Native RC:OMS inventory sync.

Visit Storefront →
Pipeline

RC:Pulse

AI-powered retail analytics and demand forecasting — built natively on top of your RC:OMS and Storefront data.

Request early access →
Built in India 🇮🇳  ·  Architected by Priyanshu PandeyTalk to an engineer →