DBA Data[Home] [Help]

PACKAGE BODY: APPS.OWA_CUSTOM

Source


1 package body OWA_CUSTOM as
2 /* $Header: AFOAUTHB.pls 115.14 2002/04/11 17:39:31 pkm ship  $ */
3 
4 
5 --
6 -- Authorize
7 --   Custom DAD Authorization callback function
8 --   It is used when DAD's authorization scheme is set to CUSTOM.
9 --
10 function authorize return boolean is
11   curproc           varchar2(100);
12   path              varchar2(2000);
13 
14 begin
15   -- Get package being executed.
16   curproc := upper(owa_util.get_procedure);
17 
18   if (curproc is null) then
19     -- Must be from a path alias.
20     -- Get the path alias instead, and check that it is in the
21     -- authorized list.
22     curproc := upper(owa_util.get_cgi_env('PATH_ALIAS'));
23   else
24     -- Check that a schema hasn't been added to the package in the path
25     -- PATH_INFO should be '/package.proc?<args>'
26     path := upper(owa_util.get_cgi_env('PATH_INFO'));
27     if (instr(path, curproc) <> 2) then
28       owa_sec.set_protection_realm('SECURITY ERROR:'||curproc||':');
29       return FALSE;
30     end if;
31   end if;
32 
33   if (fnd_web_config.check_enabled(curproc) = 'Y') then
34     owa_sec.set_protection_realm('SUCCESS');
35     return TRUE;
36   else
37     owa_sec.set_protection_realm('SECURITY ERROR:'||curproc||':');
38     return FALSE;
39   end if;
40 end authorize;
41 
42 begin -- OWA_CUSTOM package initialization
43 
44    -- Set the PL/SQL Agent's authorization scheme.
45    -- OWA_SEC.CUSTOM level authorizes on a per-schema basis.
46    -- It looks first in user's schema for the authorize function, and
47    -- if not found defaults to a global one in oas_public schema.
48    owa_sec.set_authorization(OWA_SEC.CUSTOM);
49 end OWA_CUSTOM;