5 Replies Latest reply: Nov 12, 2009 9:48 AM by garyNboston RSS

    Authorization Scheme using #REGION_STATIC_ID#

    garyNboston
      I'm trying to create a new Authorization Scheme that takes advantage of the "STATIC ID" attribute of a region.

      I know I'm not using the substitution string correctly. Can someone please help me?
      Here's what I've done:

      1. On the Region Edit page, I've entered a unique numeric id in the "STATIC ID" field.

      2. On the "Authorization Scheme" pages: I've select "Exists SQL Query"

      3. and entered this query:


      select 1 from auth_user_region
      where upper(oax_login) = :APP_USER
      and AUE_ID = #REGION_STATIC_ID# and authorization = 'Y'

      4. I get an "Invalid character error" when I generate the page.

      * If I need to use the PL/SQL Returning Boolean option, then can you help me with that, because I dont know what it would look like.

      Thank- Gary
        • 1. Re: Authorization Scheme using #REGION_STATIC_ID#
          TexasApexDeveloper
          try taking the # off the region_static_id identifier and see if that helps..

          Thank you,

          Tony Miller
          Webster, TX
          • 2. Re: Authorization Scheme using #REGION_STATIC_ID#
            garyNboston
            Thanks for the suggestion Tony, but that didn't work either.

            These are the thing I've tried Without any success:

            1. #REGION_STATIC_ID#
            2. REGION_STATIC_ID
            3. :REGION_STATIC_ID
            4. :P701_REGION_STATIC_ID
            5. &REGION_STATIC_ID.
            6. v('REGION_STATIC_ID')

            Any other suggestions are still welcome.

            -Gary

            Edited by: garyNboston on Nov 10, 2009 1:29 PM
            • 3. Re: Authorization Scheme using #REGION_STATIC_ID#
              jariola
              Hi,

              I think you can use it only in region.
              If you have pl/sql region, you can set some item according it.
              DECLARE
              l_val VARCHAR2(32000);
              BEGIN
              SELECT '#REGION_STATIC_ID#'
              INTO l_val
              FROM dual;
              
              Px_YOUR_ITEM := l_val;
              
              /* Rest of your region content here */
              
              END;
              Or use javascript if region is HTML.

              Br, Jari
              • 4. Re: Authorization Scheme using #REGION_STATIC_ID#
                fac586
                I'm trying to create a new Authorization Scheme that takes advantage of the "STATIC ID" attribute of a region.
                Not sure what you're trying to do...? A generic region authorization scheme? Might help to give the bigger picture.
                1. On the Region Edit page, I've entered a unique numeric id in the "STATIC ID" field.
                These IDs are mainly intended for use as CSS selectors and in Javascript. They are rendered in the page as [HTML ID attributes|http://www.w3.org/TR/html401/struct/global.html#id-and-class] and should comply with the [naming rules for these|http://www.w3.org/TR/html401/types.html#type-name].
                select 1 from auth_user_region
                where upper(oax_login) = :APP_USER
                and AUE_ID = #REGION_STATIC_ID# and authorization = 'Y'
                {quote}
                
                #REGION_STATIC_ID# will only be substituted in region templates and some places in the region definition. 
                
                The APEX_APPLICATION_PAGE_REGIONS view contains page references and the static ID, so the region IDs for the current page can be identified using :APP_PAGE_ID, but there doesn't appear to be any built-in substitution string for the currently rendering region to provide the final link.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                • 5. Re: Authorization Scheme using #REGION_STATIC_ID#
                  garyNboston
                  I've designed a schema for the purpose of controlling Authorization to a Region.
                  ----

                  When doing this for Pages, I'm able to reference the :APP_PAGE_ID in an Authorization Scheme of type, "Exists SQL Query".
                  That Expression looks like this:

                  select 1 from auth_user_page
                  where upper(oax_login) = :APP_USER
                  and page_no = :APP_PAGE_ID and authorization = 'Y'

                  ----

                  My problem is that I cannot seem to find a way to identy my "Region". If this simply cannot be done using an 'Authorization Scheme', that's fine.
                  I would be happy if I could accomplish my end even with a 'Condition' for displaying the Region.

                  I thought that maybe I could specify a #REGION_STATIC_ID# for the region, but I'm not able to determine how that is going to help me in either an 'Authorization Scheme' or a 'Conditional' statement for the Region.

                  I will be trying to control Authorization to different Region types, But the one I'm focusing on right now is an HTML Region.

                  If was able to identify the Region using a Static ID, then the authorization Scheme would look something like this:

                  select 1 from auth_user_region
                  where upper(oax_login) = :APP_USER
                  and AUE_ID = '#REGION_STATIC_ID#' and authorization = 'Y'



                  Does anyone have any creative ideas of how I might accompliish controlling Authorization to access a 'Region' using similar logic as that I've shown in the above (albeit non-functioning) Authorization Schem?

                  Thanks- Gary

                  Edited by: garyNboston on Nov 12, 2009 7:46 AM