1 Reply Latest reply: Mar 9, 2011 4:11 AM by trent RSS

    Redirecting after login based on user group

    XVar
      Hi,

      I'm trying to modify my login script to send users of a particular apex group to one page after login, and everyone else to another. It looks like the function I need is APEX_UTIL.GET_GROUPS_USER_BELONGS_TO (as you can't use the current user function as there is no current user during the login process) but whenever I call this, from within APEX or directly in SQL Developer, it returns null. Any idea why it doesn't work, is it a permissions issue or something?

      Thanks
        • 1. Re: Redirecting after login based on user group
          trent
          Works fine here.

          I create a region on login page (did login page to demonstrate having most limited privs):
          begin
          
          htp.p(APEX_UTIL.GET_GROUPS_USER_BELONGS_TO(p_username => 'TEST_USER'));
          
          end;
          and the assigned group is output.

          In SQL Developer, it doesn't have the context of your application express workspace, so you need to exec the following :
          begin
            wwv_flow_api.set_security_group_id;
          end;
          Then you should be able to get the correct output from the function.

          Ta,
          Trent