1
votes

I have a authorization scheme applied to the properties of the application that returns

RETURN MYFUNCTION(:APP_USER, :APP_PAGE_ID);

The issue is, it does not let the user login when the home page ID doesn't return. How can I apply the scheme to the application excluding home page?

I'm using Apex 19.1

2

2 Answers

1
votes

I imagine your function would look something like this, with an added if statement for your problem at hand.

begin
  -- exclusions for this page check
  if p_page_id in (
    101 -- login page
   ,1   -- home page
  ) then
    return true;
  end if;

  -- does user have access to the page provided?
  select count(*)
  into l_exists
  from dual
  where exists
    (select null
     from sec_table
     where page_id = p_page_id
     and username = p_app_user
  );
  return l_exists = 1;
end;
0
votes

I'm not sure whether I understood you correctly, but - myfunction should be created so that it accepts exactly two parameters, and their names must be p_username and p_password. It is supposed to return Boolean:

  • true if credentials are OK and you're allowed to connect
  • false, if the opposite

It seems that your function returns home page ID; is that correct? If so, well, I just told you what to do. If not, could you, please, explain what you mean by

when the home page ID doesn't return

and

how can I apply the scheme (...) excluding home page