APEX Tip (the unwashed masses)

Sometimes you only want a region / item /tab /list etc to show up if your in development mode.

Sure you can add a authentication and authorization setup and take care of this but a quick and dirty way is set the condition to PL/SQL Function Body Returning a Boolean and use this code.



For a production application please take the time to set up a proper authorization rule, but for development this is simple and works.

Considering this is a quick and dirty fix/tip I guess it's the unwashed one :)

7 Comments:

  1. Patrick Wolf said...
    Or just use a PL/SQL expression with

    apex_application.g_edit_cookie_session_id is not null

    Patrick
    Carl Backstrom said...
    Ah!

    I even had that first didn't test it and then figured ah I'll be specific.

    As usual every time I'm lazy I get called on it!

    Carl
    Stew said...
    Um, isn't this exactly what the Build Options feature is for? Set up a build option once as Include, implement it, then change the setting to Exclude in production? It doesn't seem like that much more work than what you're doing.

    Your version(s) win the quick-n-dirty prize though! :-)

    Though I didn't understand this until I'd read the Linnemeyer (sp?) book.
    Carl Backstrom said...
    Hello,

    >>
    Um, isn't this exactly what the Build Options feature is for?
    >>

    Not really though that is a great feature.

    My usage is slightly different.
    Basically I want a regions to show up only if me or anyone is signed in as a developer. Where I'm using this is on my example application on apex.oracle.com to put some administration functions on every page when I finally publish the changed applications I still want people to have access to this functionality.

    It's basically a very simple substitute for an Authorization scheme.
    Stew said...
    Rats, I thought I could use this in a SQL query, but not so much! Actually, I don't see this value mentioned in the 3.0 User's guide. Is it new to 3.1?

    If you're curious about why I'd want to use such a thing in a query, I've got an authorization database table. I've created a maintenance screen for it. If they're logged in as a developer, I want it to show all rows, otherwise just show limited rows.
    pay per head call center said...
    You are a Great while writing in the blogs it is awesome I liked it too much good and informative thanks for the sharing.
    Anonymous said...
    Thanks for sharing such a great post. Nice job.
    hermes lindy bag

Post a Comment