Oracle by Example brandingAdding Role-based Security in Oracle Visual Builder Cloud Service

section 0Before You Begin

This 10 minute tutorial is the first in the Creating and Assigning Roles module.

Background

Oracle Visual Builder Cloud Service is a visual development tool for creating web and mobile applications by simply dragging and dropping UI components onto a page. You don't need any programming experience to develop an application.

In this tutorial,  you will enable role based security. Note that changes that you make to authentication and security are only applied after you stage the application. Any versions of your application that are currently staged or published will not be affected.

The images in this tutorial sequence show the standalone version of Oracle Visual Builder Cloud Service. If you are using the Oracle Integration Cloud version, you will see an additional menu at the top of each page that lets you switch between Visual Builder and Integration Cloud.

Top menu
Description of the illustration vbcs_oic_menu.png

What Do You Need?

  • Access to Oracle Visual Builder Cloud Service
  • A supported browser (see Known Issues for Oracle Visual Builder Cloud Service for more information)

section 1Enable Role-based Security

  1. In the web browser, log in to Oracle Visual Builder Cloud Service.
  2. On the Home page, open Charts Application 1.0.
    Open charts application
    Description of the illustration vbcs_s1_1_open_application.png
  3. Click the Main menu Main Menu icon in the top-left corner and open the Security page under Application Settings. Select Require Authentication in the Access pane, and select Allow anonymous access. Anonymous access will allow users who are not logged in to view parts of your application that you grant them access to.
    Enable authentication
    Description of the illustration vbcs_s1_2_require_auth.png
  4. Click New Role in the Roles pane.
    Add new role
    Description of the illustration vbcs_s1_3_new_role.png
  5. In the Create Role dialog box, enter or select the following values:
    • Application Role Name: Salesperson
    • Maps to: Identity Domain Administrator
    • Description: Sales associate
    New role dialog
    Description of the illustration vbcs_s1_4_new_role1.png
  6. Click Create.
  7. Create another role in the same way you did in steps 4-6, and enter or select the following values:
    • Application Role Name: Sales Manager
    • Maps to: HRManager
    • Description: Sales manager
    Add new role
    Description of the illustration vbcs_s1_5_new_role2.png

Role-based security is disabled by default. To enable role-based security you must configure the specific page, component or business object.


section 2Secure Pages

In this section, you will secure two pages, allowing access only for certain roles, while leaving another page accessible by all roles, including anonymous users.

  1. Open the Security page under Application Settings, if it is not already open.
  2. In the Pages panel, enable role-based authentication for the Sales Objectives and Sales Regions pages by selecting each page’s Authentication Required checkbox. Ensure that the Summary page's Authentication Required checkbox is not enabled, to allow anyone access to this page.
    Select pages for authentication
    Description of the illustration vbcs_s2_1_page_auth.png
  3. The Pages panel lists each page in your application and the roles that can access the page. For each page, click in the Role text area. Select user roles from the dropdown list according to the following table:
    • Sales Objectives: Sales Manager, Salesperson
    • Summary: Anonymous access (Authentication Required checkbox should not be checked)
    • Sales Regions: Authenticated User, Sales Manager, Salesperson
    Application Name page in Create Application wizard
    Description of the illustration vbcs_s2_2_page_roles.png

section 3Test the Secured Pages

  1. Now return to the Page Designer, and click Test Application Test Application button to preview the application in the Test mode.
    Preview application
    Description of the illustration vbcs_s3_1_preview1.png
  2. Use the Who am I? role selector to preview your application as an anonymous user. Select only the Anonymous User check box, then click the OK icon to preview your application.
    Who am I role selector
    Description of the illustration vbcs_preview2.png
    As the anonymous user, you can see only the Summary page.
    Preview as anonymous user
    Description of the illustration vbcs_preview3.png
  3. Now use the Who am I? role selector to also select the Authenticated User and preview the application.
    Preview as authenticated user
    Description of the illustration vbcs_preview4.png
    In addition to the Summary page, an authenticated user can view the Sales Regions page, but not the Sales Objectives page.
  4. Use the Who am I? role selector and add the Sales Manager or Salesperson role, and preview the application.
    Preview as sales manager
    Description of the illustration vbcs_preview5.png
    The Sales Manager and Salesperson roles can view all three pages of the application.