13 Replies Latest reply: Aug 28, 2014 5:57 AM by Irha10 RSS

    Authorisation Scheme does not work

    Irha10

      Hi All,

       

      Using Apex Application Express 4.2.2.00.1

       

      I have an application and a few pages along with tabs. I want to hide a Admin Tab from the users so i have written a function as follows:

       

      FUNCTION test_admin_perm(p_username VARCHAR2)

        RETURN VARCHAR2

      AS

        l_count NUMBER;

      BEGIN

        SELECT COUNT(*) INTO l_count

        FROM test_admin_tab

        WHERE upper(p_admin) = upper('Y')

        AND   upper(status)  = upper('A')

        AND upper(id)    = upper(p_username);

        IF l_count          >= 1 THEN

          RETURN 'Y';

        ELSE

          RETURN 'N';

        END IF;

      END test_admin_perm;

       

      then i created a called Test_Admin (Authorization)  and scheme type is ('Pl/sql Function Returning Boolean') using code

       

      begin

        if upper(test_admin_perm(:APP_USER)) = 'Y' then

        return true;

        else

        return false;

        end if;

      end;  then save it. I go to tab called Admin and edit it as 'Authorizarion scheme ('Test_Admin ').

       

      however, that Authorization does not work and still showing tab if return false, I have checked the function and it does work properly. Any clue please?

       

      thank you.

      RI