You can copy access control roles from your current application or another application within the workspace. Additionally, when copying a role from another application, you have the option to subscribe to it.
Why Subscribe to Access Control Roles?
Subscribing to an access control role allows developers to reuse shared components across multiple applications, ensuring consistency and reducing maintenance efforts.
For more details on shared component subscriptions, refer to Using Shared Component Subscriptions in the Oracle APEX documentation.In Oracle APEX, Access Control Roles are part of the built-in access control system that allows developers to define user roles and control access to pages, features, and data. If you are developing or maintaining multiple applications, or if you are working with a team across several environments, you may want to copy or subscribe to roles from one application to another to ensure consistency and simplify security management.
Below is a detailed breakdown of how to Copy or Subscribe to Access Control Roles in Oracle APEX:
Understanding Access Control Roles in APEX
Access Control Roles in APEX are part of the Access Control feature found under Shared Components > Security > Access Control. Roles are identifiers like ADMIN
, EDITOR
, or VIEWER
that you assign to users. These roles determine what pages, buttons, or actions a user can access.
You can:
-
Copy roles: Make a static copy of roles from another application. The roles will no longer stay synchronized.
-
Subscribe to roles: Create a link to roles defined in another application so changes to roles in the source application will automatically propagate to your current application.
Copying Roles from Another Application
Step-by-Step:
-
Navigate to Shared Components
-
From your app's home page in APEX, click Shared Components.
-
-
Access Access Control
-
Under the Security section, click Access Control.
-
-
Click “Copy or Subscribe”
-
You will see the Access Control Entries and an option to Copy or Subscribe to roles from another application.
-
-
Choose the Source Application
-
Select the application that has the roles you want to copy from.
-
You must have developer access to both applications.
-
-
Select Copy Option
-
Choose Copy if you want to import the roles as a one-time copy.
-
Copied roles will appear in your application's access control list, and you can edit them independently.
-
-
Review and Confirm
-
Review the roles being copied.
-
Click Apply or Copy to finalize the process.
-
Use “Copy” when you want to base your roles on another app but still allow local modifications.
Subscribing to Roles from Another Application
Step-by-Step:
-
Open Shared Components > Access Control
-
Click Copy or Subscribe
-
Choose the source application
-
Select Subscribe
-
This creates a live subscription to the roles of the source application.
-
Any future changes to the roles in the source app will reflect in your app when you refresh the subscription.
-
-
Apply
-
Once subscribed, your roles will show with a "Subscribed" tag.
-
-
Refresh Subscription as Needed
-
To pull updates from the source app, return to Access Control and click Refresh Subscription.
-
This will update the roles in your app with any changes made in the source.
-
Use “Subscribe” when roles must stay consistent across multiple apps.
Key Differences: Copy vs. Subscribe
Feature | Copy | Subscribe |
---|---|---|
One-time import | Yes | No |
Automatically updates | No | Yes (when refreshed) |
Editable in target | Yes | No (must update in source) |
Best for | Isolated apps or custom role handling | Shared apps or centralized role control |
Use Cases
-
Copying Roles is useful when branching a project or creating a sandbox version of an app.
-
Subscribing to Roles is ideal for enterprise applications with centralized user/role governance, where multiple apps share a consistent security model.
Best Practices
-
Always use clear role names like
ADMIN
,APP_USER
, orGUEST
for consistency. -
Document the source application if you subscribe to roles, so future developers understand the dependency.
-
Use build options or authorization schemes in combination with roles for advanced control.
-
Test after copying/subscribing to ensure pages and components behave as expected.
Conclusion
Copying or subscribing to Access Control Roles in Oracle APEX gives you flexibility in managing security across applications. Whether you're aiming for independent control or synchronized governance, these features make it easier to scale role-based access across your APEX development ecosystem. Use copy when you need control and independence and subscribe when you need consistency and centralized updates.
No comments:
Post a Comment