[Home] [Help]
PACKAGE BODY: APPS.FND_GENERIC_POLICY
Source
1 PACKAGE BODY FND_GENERIC_POLICY AS
2 /* $Header: AFSCGPLB.pls 120.2 2005/10/25 18:57:31 tmorrow noship $ */
3
4
5 FUNCTION GET_PREDICATE( p_schema IN VARCHAR2,
6 p_object IN VARCHAR2)
7 RETURN VARCHAR2 is
8 retval varchar2(32767);
9 l_object_name varchar2(30);
10 status_code varchar2(30);
11 begin
12 retval := NULL;
13 begin
14 select o.obj_name
15 into l_object_name
16 from fnd_objects o, fnd_form_functions f
17 where f.function_name = p_object
18 and o.object_id = f.object_id;
19
20 fnd_data_security.get_security_predicate(
21 p_api_version => 1.0,
22 p_function => p_object,
23 p_object_name => l_object_name,
24 p_statement_type => 'VPD',
25 x_predicate => retval,
26 x_return_status => status_code);
27 if (status_code <> 'T') then
28 retval := NULL;
29 if (fnd_log.LEVEL_EXCEPTION >= fnd_log.g_current_runtime_level) then
30 fnd_log.message(FND_LOG.LEVEL_EXCEPTION,
31 'fnd.plsql.FND_GENERIC_POLICY.GET_PREDICATE.gsp_fail');
32 end if;
33 end if;
34
35 exception
36 when no_data_found then
37 retval := NULL;
38 end;
39
40 /* If the user doesn't have access, then return no-access predicate*/
41 if(retval is NULL) then
42 retval := '(1=2)';
43 end if;
44
45 return retval;
46 end;
47
48 END FND_GENERIC_POLICY;