25: -- Context m_fs_context, variable pc_ind with value 'Yes'
26: -- allows Planning and Costing enginees to have access to all formulas.
27: --
28: IF SYS_CONTEXT('m_fs_context','pc_ind') = 'Yes' or
29: v_resp_id = fnd_global.resp_id
30: THEN
31: f_predicate := '1=1';
32:
33: ELSE
36: ' EXISTS ( SELECT 1 '||
37: ' FROM gmd_security_profiles sp '||
38: ' WHERE sp.assign_method_ind IN ( ''A'') '|| --,''M'') '|| /* Bug No.9077438 */
39: ' AND ( ( sp.user_id = fnd_profile.value(''GMD_DEFAULT_USER'') '||
40: ' OR sp.user_id = fnd_global.user_id '||
41: ' ) '||
42: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
43: ' FROM FND_USER_RESP_GROUPS rg '||
44: ' WHERE rg.user_id = fnd_global.user_id '||
40: ' OR sp.user_id = fnd_global.user_id '||
41: ' ) '||
42: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
43: ' FROM FND_USER_RESP_GROUPS rg '||
44: ' WHERE rg.user_id = fnd_global.user_id '||
45: ' AND sp.responsibility_id = rg.responsibility_id '||
46: ' AND SYSDATE BETWEEN rg.start_date AND NVL(rg.end_date, SYSDATE) '||
47: ' ) '||
48: ' ) '||
46: ' AND SYSDATE BETWEEN rg.start_date AND NVL(rg.end_date, SYSDATE) '||
47: ' ) '||
48: ' ) '||
49: ' ) '||
50: ' AND NVL(responsibility_id,fnd_global.resp_id) = fnd_global.resp_id '|| /* Bug No.9077438 */
51: ' AND ( EXISTS ( SELECT NULL '||
52: ' FROM org_access a1 '||
53: ' WHERE ( ( sp.organization_id = a1.organization_id '||
54: ' AND sp.other_organization_id IS NULL '||
55: ' ) '||
56: ' OR sp.other_organization_id = a1.organization_id '||
57: ' ) '||
58: ' AND NVL(a1.disable_date, SYSDATE+1) >= SYSDATE '||
59: ' AND a1.resp_application_id = fnd_global.resp_appl_id '||
60: ' AND a1.responsibility_id = fnd_global.resp_id '||
61: ' ) '||
62: ' OR '||
63: ' NOT EXISTS ( SELECT NULL '||
56: ' OR sp.other_organization_id = a1.organization_id '||
57: ' ) '||
58: ' AND NVL(a1.disable_date, SYSDATE+1) >= SYSDATE '||
59: ' AND a1.resp_application_id = fnd_global.resp_appl_id '||
60: ' AND a1.responsibility_id = fnd_global.resp_id '||
61: ' ) '||
62: ' OR '||
63: ' NOT EXISTS ( SELECT NULL '||
64: ' FROM org_access a2 '||
74: ' ) '||
75: ' OR EXISTS ( SELECT 1 '||
76: ' FROM gmd_formula_security fs '||
77: ' WHERE ( ( fs.user_id = fnd_profile.value(''GMD_DEFAULT_USER'') '||
78: ' OR fs.user_id = fnd_global.user_id '||
79: ' ) '||
80: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
81: ' FROM FND_USER_RESP_GROUPS rg '||
82: ' WHERE rg.user_id = fnd_global.user_id '||
78: ' OR fs.user_id = fnd_global.user_id '||
79: ' ) '||
80: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
81: ' FROM FND_USER_RESP_GROUPS rg '||
82: ' WHERE rg.user_id = fnd_global.user_id '||
83: ' AND fs.responsibility_id = rg.responsibility_id '||
84: ' AND SYSDATE BETWEEN rg.start_date '||
85: ' AND NVL(rg.end_date, SYSDATE) '||
86: ' ) '||
85: ' AND NVL(rg.end_date, SYSDATE) '||
86: ' ) '||
87: ' ) '||
88: ' ) '||
89: ' AND NVL(responsibility_id,fnd_global.resp_id) = fnd_global.resp_id '|| /* Bug No.9077438 */
90: ' AND (EXISTS ( SELECT NULL '||
91: ' FROM org_access ou '||
92: ' WHERE ( ( fs.organization_id = ou.organization_id '||
93: ' AND fs.other_organization_id IS NULL '||
94: ' ) '||
95: ' OR fs.other_organization_id = ou.organization_id '||
96: ' ) '||
97: ' AND NVL(ou.disable_date, SYSDATE+1) >= SYSDATE '||
98: ' AND ou.resp_application_id = fnd_global.resp_appl_id '||
99: ' AND ou.responsibility_id = fnd_global.resp_id '||
100: ' ) '||
101: ' OR '||
102: ' NOT EXISTS ( SELECT NULL '||
95: ' OR fs.other_organization_id = ou.organization_id '||
96: ' ) '||
97: ' AND NVL(ou.disable_date, SYSDATE+1) >= SYSDATE '||
98: ' AND ou.resp_application_id = fnd_global.resp_appl_id '||
99: ' AND ou.responsibility_id = fnd_global.resp_id '||
100: ' ) '||
101: ' OR '||
102: ' NOT EXISTS ( SELECT NULL '||
103: ' FROM org_access ou1 '||
135: ' FROM gmd_security_profiles sp '||
136: ' WHERE sp.access_type_ind = ''U'' '||
137: ' AND ( responsibility_id IN ( SELECT rg.responsibility_id '||
138: ' FROM FND_USER_RESP_GROUPS rg '||
139: ' WHERE rg.user_id = fnd_global.user_id '||
140: ' AND SYSDATE BETWEEN rg.start_date '||
141: ' AND NVL(rg.end_date, SYSDATE) '||
142: ' ) '||
143: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
140: ' AND SYSDATE BETWEEN rg.start_date '||
141: ' AND NVL(rg.end_date, SYSDATE) '||
142: ' ) '||
143: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
144: ' OR sp.user_id = fnd_global.user_id '||
145: ' ) '||
146: ' ) '||
147: ' AND organization_id = '||obj_name||'.owner_organization_id '||
148: ' AND (other_organization_id IS NULL '||
149: ' OR EXISTS ( SELECT NULL '||
150: ' FROM org_access a3 '||
151: ' WHERE a3.organization_id = sp.other_organization_id '||
152: ' AND NVL(a3.disable_date, SYSDATE+1) >= SYSDATE '||
153: ' AND a3.resp_application_id = fnd_global.resp_appl_id '||
154: ' AND a3.responsibility_id = fnd_global.resp_id '||
155: ' ) '||
156: ' OR NOT EXISTS ( SELECT NULL '||
157: ' FROM org_access a4 '||
150: ' FROM org_access a3 '||
151: ' WHERE a3.organization_id = sp.other_organization_id '||
152: ' AND NVL(a3.disable_date, SYSDATE+1) >= SYSDATE '||
153: ' AND a3.resp_application_id = fnd_global.resp_appl_id '||
154: ' AND a3.responsibility_id = fnd_global.resp_id '||
155: ' ) '||
156: ' OR NOT EXISTS ( SELECT NULL '||
157: ' FROM org_access a4 '||
158: ' WHERE a4.organization_id = sp.other_organization_id '||
179: ' FROM gmd_security_profiles sp '||
180: ' WHERE sp.access_type_ind = ''U'' '||
181: ' AND ( responsibility_id IN ( SELECT rg.responsibility_id '||
182: ' FROM FND_USER_RESP_GROUPS rg '||
183: ' WHERE rg.user_id = fnd_global.user_id '||
184: ' AND SYSDATE BETWEEN rg.start_date '||
185: ' AND NVL(rg.end_date, SYSDATE) '||
186: ' ) '||
187: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
184: ' AND SYSDATE BETWEEN rg.start_date '||
185: ' AND NVL(rg.end_date, SYSDATE) '||
186: ' ) '||
187: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
188: ' OR sp.user_id = fnd_global.user_id '||
189: ' ) '||
190: ' ) '||
191: ' AND organization_id = '||obj_name||'.organization_id '||
192: ' AND (other_organization_id IS NULL '||
193: ' OR EXISTS ( SELECT NULL '||
194: ' FROM org_access a3 '||
195: ' WHERE a3.organization_id = sp.other_organization_id '||
196: ' AND NVL(a3.disable_date, SYSDATE+1) >= SYSDATE '||
197: ' AND a3.resp_application_id = fnd_global.resp_appl_id '||
198: ' AND a3.responsibility_id = fnd_global.resp_id '||
199: ' ) '||
200: ' OR NOT EXISTS ( SELECT NULL '||
201: ' FROM org_access a4 '||
194: ' FROM org_access a3 '||
195: ' WHERE a3.organization_id = sp.other_organization_id '||
196: ' AND NVL(a3.disable_date, SYSDATE+1) >= SYSDATE '||
197: ' AND a3.resp_application_id = fnd_global.resp_appl_id '||
198: ' AND a3.responsibility_id = fnd_global.resp_id '||
199: ' ) '||
200: ' OR NOT EXISTS ( SELECT NULL '||
201: ' FROM org_access a4 '||
202: ' WHERE a4.organization_id = sp.other_organization_id '||
229:
230: -- Context m_fs_context, variable pc_ind with value 'Yes'
231: -- allows Planning and Costing enginees to have access to all formulas.
232: --
233: IF SYS_CONTEXT('m_fs_context','pc_ind') = 'Yes' or v_resp_id = fnd_global.resp_id
234: THEN
235: f_predicate := '1=1';
236: /* Bug No.8355449 - End */
237: ELSE
241: ' WHERE sp.assign_method_ind IN ( ''A'') '|| --,''M'') '|| /* Bug No.9077438 */
242: ' AND sp.access_type_ind = ''U'' '||
243: ' AND (responsibility_id IN ( SELECT rg.responsibility_id '||
244: ' FROM FND_USER_RESP_GROUPS rg '||
245: ' WHERE rg.user_id = fnd_global.user_id '||
246: ' AND SYSDATE BETWEEN rg.start_date AND NVL(rg.end_date, SYSDATE) '||
247: ' ) '||
248: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
249: ' OR sp.user_id = fnd_global.user_id '||
245: ' WHERE rg.user_id = fnd_global.user_id '||
246: ' AND SYSDATE BETWEEN rg.start_date AND NVL(rg.end_date, SYSDATE) '||
247: ' ) '||
248: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
249: ' OR sp.user_id = fnd_global.user_id '||
250: ' ) '||
251: ' ) '||
252: ' AND NVL(responsibility_id,fnd_global.resp_id) = fnd_global.resp_id '|| /* Bug No.9077438 */
253: ' AND ( EXISTS ( SELECT NULL '||
248: ' OR ( sp.user_id = fnd_profile.value_specific(''GMD_DEFAULT_USER'') '||
249: ' OR sp.user_id = fnd_global.user_id '||
250: ' ) '||
251: ' ) '||
252: ' AND NVL(responsibility_id,fnd_global.resp_id) = fnd_global.resp_id '|| /* Bug No.9077438 */
253: ' AND ( EXISTS ( SELECT NULL '||
254: ' FROM org_access a1 '||
255: ' WHERE ( ( sp.organization_id = a1.organization_id '||
256: ' AND sp.other_organization_id IS NULL '||
257: ' ) '||
258: ' OR sp.other_organization_id = a1.organization_id '||
259: ' ) '||
260: ' AND NVL(a1.disable_date, SYSDATE+1) >= SYSDATE '||
261: ' AND a1.resp_application_id = fnd_global.resp_appl_id '||
262: ' AND a1.responsibility_id = fnd_global.resp_id '||
263: ' ) '||
264: ' OR '||
265: ' NOT EXISTS ( SELECT NULL '||
258: ' OR sp.other_organization_id = a1.organization_id '||
259: ' ) '||
260: ' AND NVL(a1.disable_date, SYSDATE+1) >= SYSDATE '||
261: ' AND a1.resp_application_id = fnd_global.resp_appl_id '||
262: ' AND a1.responsibility_id = fnd_global.resp_id '||
263: ' ) '||
264: ' OR '||
265: ' NOT EXISTS ( SELECT NULL '||
266: ' FROM org_access a2 '||
278: ' EXISTS '||
279: ' ( SELECT 1 '||
280: ' FROM gmd_formula_security fs '||
281: ' WHERE fs.access_type_ind = ''U'' '||
282: ' AND NVL(responsibility_id,fnd_global.resp_id) = fnd_global.resp_id '|| /* Bug No.9077438 */
283: ' AND ( ( fs.user_id = fnd_profile.value(''GMD_DEFAULT_USER'') '||
284: ' OR fs.user_id = fnd_global.user_id '||
285: ' ) '||
286: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
280: ' FROM gmd_formula_security fs '||
281: ' WHERE fs.access_type_ind = ''U'' '||
282: ' AND NVL(responsibility_id,fnd_global.resp_id) = fnd_global.resp_id '|| /* Bug No.9077438 */
283: ' AND ( ( fs.user_id = fnd_profile.value(''GMD_DEFAULT_USER'') '||
284: ' OR fs.user_id = fnd_global.user_id '||
285: ' ) '||
286: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
287: ' FROM FND_USER_RESP_GROUPS rg '||
288: ' WHERE rg.user_id = fnd_global.user_id '||
284: ' OR fs.user_id = fnd_global.user_id '||
285: ' ) '||
286: ' OR ( EXISTS ( SELECT rg.responsibility_id '||
287: ' FROM FND_USER_RESP_GROUPS rg '||
288: ' WHERE rg.user_id = fnd_global.user_id '||
289: ' AND fs.responsibility_id = rg.responsibility_id '||
290: ' AND SYSDATE BETWEEN rg.start_date AND NVL(rg.end_date, SYSDATE) '||
291: ' ) '||
292: ' ) '||
298: ' ) '||
299: ' OR fs.other_organization_id = ou.organization_id '||
300: ' ) '||
301: ' AND NVL(ou.disable_date, SYSDATE+1) >= SYSDATE '||
302: ' AND ou.resp_application_id = fnd_global.resp_appl_id '||
303: ' AND ou.responsibility_id = fnd_global.resp_id '||
304: ' ) '||
305: ' OR '||
306: ' NOT EXISTS ( SELECT NULL '||
299: ' OR fs.other_organization_id = ou.organization_id '||
300: ' ) '||
301: ' AND NVL(ou.disable_date, SYSDATE+1) >= SYSDATE '||
302: ' AND ou.resp_application_id = fnd_global.resp_appl_id '||
303: ' AND ou.responsibility_id = fnd_global.resp_id '||
304: ' ) '||
305: ' OR '||
306: ' NOT EXISTS ( SELECT NULL '||
307: ' FROM org_access ou1 '||