7 Replies Latest reply on Sep 27, 2016 12:45 PM by rahul.r.singh

    Authorization Issue in APEX 5

    rahul.r.singh

      Hi All,

       

      I have created three group 'OWG-TEAM-Level1' , 'OWG-TEAM-Level2' and 'OWG-TEAM-Level3' and assigned to some user. now I have created Authorization Schema of PL/SQL Function Returning Boolean and it is based on the page id to see the user. so suppose USER A assigned to  'OWG-TEAM-Level1' and USER B assigned to  'OWG-TEAM-Level2' then in that case USER A can see only page_id in (30,7,5,9,20,26,11) and USER B can see page_id in (30,5,11) but this is not working. let me know how to achieve this.

       

       

      DECLARE
          v_group_name VARCHAR2(50);
          v_page_id        number;
         
          CURSOR cur_group_page_id
          IS   select a.group_name ,b.page_id
        from  APEX_050000.APEX_WORKSPACE_GROUP_USERS a
        ,APEX_050000.APEX_APPLICATION_PAGES b
        where a.workspace_display_name=b.workspace_display_name
        and a.user_name=v('APP_USER')
        and b.application_id=112;

       

      BEGIN  
          
          FOR rec_cur_group_page_id in cur_group_page_id loop

          IF rec_cur_group_page_id.group_name='OWG-TEAM-Level1' and rec_cur_group_page_id.page_id in (30,7,5,9,20,26,11) then
            RETURN TRUE;  
          ELSIF rec_cur_group_page_id.group_name='OWG-TEAM-Level2' and rec_cur_group_page_id.page_id in (30,5,11) then
              RETURN TRUE;
      ELSIF rec_cur_group_page_id.group_name='OWG-TEAM-Level3' and rec_cur_group_page_id.page_id in (11) then
              RETURN TRUE;
      ELSE
           RETURN FALSE; 
          END IF;   
         END LOOP;
        END;

       

      Thanks,

      SK