Paweł Żurkiewicz
Paweł Żurkiewicz

Reputation: 257

Dynamic access to oracle apex 19.2 pages

I'm trying to find a solution to create something similar to a server-side condition for pages. I want pages to be available depending on some global variables. I have created a function that returns a logical value in the database. How to implement it? I tried to use authorization schemes, but it doesn't work with parameters.

Upvotes: 1

Views: 650

Answers (1)

Littlefoot
Littlefoot

Reputation: 143083

As far as I understood, value returned by that function decides whether someone is allowed to use certain page or not. You didn't explain what it exactly does, so I'll presume that it returns Boolean: TRUE (yes, allow page access) or FALSE (don't allow it), based on certain parameters such as :APP_USER.

If that's so, my suggestion would be to do what you already tried but failed for some reason.

  • navigate to Shared Components
  • go to Security - Authorization Schemes
  • create a new scheme, let's call it AS_ALLOW
  • set

    • scheme type = PL/SQL function returning Boolean
    • PL/SQL function body

      return your_function(:APP_USER);
      
    • message displayed when scheme violated: "You aren't authorized to visit this page"

Now, back to page. Open its Security properties and put

  • AS_ALLOW into the "Authorization scheme"

That should do it; once the user runs the application, the function will return either TRUE or FALSE which will - in turn - allow (or not) that user's access to page that has the authorization scheme set.

Upvotes: 1

Related Questions