Skip to main content

Change APEX app availability

O

One day you will need to restrict access only for developers or some priviledged users. This is a followup for previous article Prepare users for APEX maintenance.

You can manually change application availability:


Interesting part is the programatic approach via APEX_UTIL.SET_APPLICATION_STATUS procedure:

BEGIN
    -- restrict access to APEX developers
    APEX_UTIL.SET_APPLICATION_STATUS (
        p_application_id        => 700,
        p_application_status    => 'DEVELOPERS_ONLY'
    );
    COMMIT;
END;
/
BEGIN
    -- restrict access to priviledged users
    APEX_UTIL.SET_APPLICATION_STATUS (
        p_application_id        => 700,
        p_application_status    => 'RESTRICTED_ACCESS',
        p_restricted_user_list  => 'USER_LOGIN,USER_LOGIN2'  -- change this
    );
    COMMIT;
END;
/


You should explore all options and examples in documenation.

  • AVAILABLE - Application is available with no restrictions.
  • AVAILABLE_W_EDIT_LINK - Application is available with no restrictions. Developer Toolbar shown to developers
  • DEVELOPERS_ONLY - Application only available to developers.
  • RESTRICTED_ACCESS - Application only available to users in p_restricted_user_list.
  • UNAVAILABLE - Application unavailable. Message shown in p_unavailable_value.
  • UNAVAILABLE_PLSQL - Application unavailable. Message shown from PL/SQL block in p_unavailable_value.
  • UNAVAILABLE_URL - Application unavailable. Redirected to URL provided in p_unavailable_value.


And if you want to prevent developers from changing the application, you can run this. Don't try it at work. Do you know why?

BEGIN
    APEX_UTIL.SET_APP_BUILD_STATUS (
        p_application_id    => 700,
        p_build_status      => 'RUN_ONLY'
    );
    COMMIT;
END;
/


Comments