Search This Blog

Showing posts with label Copy or Subscribing to Access Control Roles in Oracle APEX. Show all posts
Showing posts with label Copy or Subscribing to Access Control Roles in Oracle APEX. Show all posts

Tuesday, July 1, 2025

Copying or Subscribing to Access Control Roles in Oracle APEX

In Oracle APEX, Access Control Roles are part of a built-in access management system that lets developers define user roles (such as ADMIN, MANAGER, or USER) and use these roles to control access to application pages, buttons, or logic. When you manage multiple applications or promote apps between environments (development, test, production), Oracle APEX allows you to Copy or Subscribe to Access Control Roles from another application to maintain consistency.

What Are Access Control Roles?

Access Control Roles define what users can see or do inside an APEX application. They are used with APEX's Access Control feature to control authorization logic. Roles can be used to:

  • Show or hide pages, regions, or buttons

  • Control logic inside PL/SQL processes

  • Restrict actions to certain users or groups

For example:

  • ADMIN can access everything

  • MANAGER may access only reports and some update features

  • USER might only be allowed to view records

To reuse roles across applications or environments, you can Copy or Subscribe to roles.

Option 1: Copy Access Control Roles

Copying means importing the roles from another application as a static copy. Once copied, the roles are part of your application and can be changed independently.

Steps to Copy Roles:

  1. Go to Shared Components
    Open your APEX application and click Shared Components.

  2. Select Access Control
    Under the Security section, click Access Control.

  3. Click “Copy or Subscribe”
    At the top-right corner of the Access Control Roles screen, click Copy or Subscribe.

  4. Choose the Source Application
    You will see a list of available applications. Select the app you want to copy roles from.

  5. Select "Copy" Option
    Choose the Copy radio button. This will import the roles and store them locally in your application.

  6. Review and Confirm
    A list of roles will appear. Click Apply to complete the copy.

Use Copy when you want to base your roles on another app but allow custom changes in your own app.

Option 2: Subscribe to Access Control Roles

Subscribing links your application to the source application’s roles. If the roles change in the source app, you can refresh the subscription in your app to pull those changes.

Steps to Subscribe:

  1. Open Shared Components > Access Control

  2. Click “Copy or Subscribe”

  3. Select the Source Application
    Choose the application that contains the role definitions you want to reuse.

  4. Choose “Subscribe” Option
    Select the Subscribe radio button. This will create a live subscription.

  5. Apply the Subscription

  6. Refresh When Needed
    Later, if roles are updated in the source app, go back to Access Control and click Refresh Subscription to pull changes.

Use Subscribe when you want multiple applications to share and maintain the same set of roles, especially in enterprise environments.

Benefits and Use Cases

Feature Copy Roles Subscribe to Roles
Editable Yes (independent copy) No (managed in source app)
Auto-updated No Yes (when refreshed)
Best for Standalone or derived apps Shared apps or environments
Dependency None Depends on source app being available

Important Notes

  • You must have developer access to both the source and target applications.

  • Subscribed roles cannot be edited in the target application. Changes must be made in the source app.

  • If you later decide to unsubscribe, the current roles remain but are converted to local copies.

You can copy access control roles either within the current application or from another application in the workspace. When copying a role from another application, you also have the option to subscribe to it.

Steps to Copy or Subscribe to Access Control Roles

  1. Navigate to the Application Access Control page:

    • Go to the Workspace home page.

    • Click the App Builder icon.

    • Select the application where you want to copy or subscribe to roles.

    • On the Application home page, click Shared Components.

    • Under Security, select Application Access Control.

The Application Access Control page will display available roles along with details such as Subscribed From, Subscription Status, and Subscribers.

  1. Copy a role within the current application:

    • Locate the role you want to copy and click Copy in the Copy column.

    • The Copy Role Wizard will appear.

    • Enter a unique name for the new role.

    • Click Copy Role to complete the process.

  2. Copy a role from another application:

    • In the Tasks region, click Copy Role from another app.

    • The Copy Role Wizard will open.

    • Select the application from which you want to copy the role.

    • Choose the role you wish to copy.

    • Enable the Subscribe option if you want the copied role to stay linked to the original role.

    • Click Copy Role to finalize the process.

By using subscriptions, you can maintain consistency across multiple applications and reduce administrative overhead.

Oracle APEX gives you flexible options to manage Access Control Roles across multiple applications. Use Copy when you want a one-time import and local control over role changes. Use Subscribe when you want to centralize role management and keep multiple apps in sync. Both options help enforce security policies and simplify role-based access control in your APEX environment.