1 PACKAGE BODY igs_ge_sec_config_pkg AS
2 /* $Header: IGSNIA3B.pls 115.5 2004/01/08 15:34:08 pkpatel noship $ */
3 FUNCTION check_form_security
4 ( p_responsibility_id IN NUMBER,
5 p_form_name IN VARCHAR2)
6 RETURN BOOLEAN
7 IS
8 /*
9 || Created By : [email protected]
10 || Created On : 07-OCT-2002
11 || Purpose : Checks the forms existance for the responsibility.
12 || Known limitations, enhancements or remarks :
13 || Change History :
14 || Who When What
15 || (reverse chronological order - newest change first)
16 */
17 lv_rowid ROWID;
18 CURSOR c_form_exists IS
19 SELECT rowid
20 FROM igs_ge_cfg_form
21 WHERE responsibility_id = p_responsibility_id
22 AND form_code = p_form_name
23 AND NVL(query_only_ind,'N') = 'Y';
24
25 BEGIN
26 OPEN c_form_exists;
27 FETCH c_form_exists INTO lv_rowid;
28 IF c_form_exists%FOUND THEN
29 RETURN TRUE;
30 ELSE
31 RETURN FALSE;
32 END IF;
33 CLOSE c_form_exists;
34 END check_form_security;
35
36
37 FUNCTION check_tab_security
38 ( p_responsibility_id IN NUMBER,
39 p_form_name IN VARCHAR2
40 )
41 RETURN tb_result_set
42 IS
43 /*
44 || Created By : [email protected]
45 || Created On : 07-OCT-2002
46 || Purpose : Checks the tab validity for the form and resp combination.
47 || Known limitations, enhancements or remarks :
48 || Change History :
49 || Who When What
50 || KUMMA 30-DEC-2002 2684922, Added Trim around tab_code
51 || (reverse chronological order - newest change first)
52 ||
53 || nsidana 9/22/2003 Modified the cursor to pick data from IGS_GE_CFG_TAB_V which
54 || holds the enabled tab pages for any form.
55 */
56 CURSOR c_tab_exists IS
57 SELECT TRIM(substr(tab_code,(instr(tab_code,'-')+1))) tab_code,config_opt
58 FROM igs_ge_cfg_tab_v
59 WHERE responsibility_id = p_responsibility_id
60 AND form_code = p_form_name;
61
62 j BINARY_INTEGER := 0;
63 lv_result_set tb_result_set;
64 BEGIN
65
66 FOR i in c_tab_exists LOOP
67 j := NVL(j,0) + 1;
68 lv_result_set(j).l_canvas:= i.tab_code;
69 lv_result_set(j).l_query_hide:= i.config_opt;
70 END LOOP;
71 RETURN lv_result_set;
72
73 END check_tab_security;
74
75 FUNCTION check_tab_exists
76 ( p_responsibility_id IN NUMBER,
77 p_form_name IN VARCHAR2,
78 p_tab_name IN VARCHAR2
79 )
80 RETURN BOOLEAN
81 IS
82 /*
83 || Created By : [email protected]
84 || Created On : 07-OCT-2002
85 || Purpose : Checks the existance of the tab.
86 || Known limitations, enhancements or remarks :
87 || Change History :
88 || Who When What
89 || KUMMA 30-DEC-2002 2684922, Added Trim around tab_code on both sides in where clause
90 || (reverse chronological order - newest change first)
91 ||
92 || nsidana 9/22/2003 Modified the cursor to pick data from IGS_GE_CFG_TAB_V which
93 || holds the enabled tab pages for any form.
94 || gmaheswa 01/07/2004 Bug : 3294107 Modified cursor c_tab_exists to select row_id instead of rowid
95 || pkpatel 01/08/2003 Bug : 3294107 Added the check config_opt = 'H'
96 */
97
98 CURSOR c_tab_exists IS
99 SELECT row_id
100 FROM igs_ge_cfg_tab_v
101 WHERE responsibility_id = p_responsibility_id
102 AND form_code = p_form_name
103 AND TRIM(substr(tab_code,(instr(tab_code,'-')+1))) = TRIM(p_tab_name)
104 AND config_opt = 'H';
105
106 lv_rowid ROWID;
107 BEGIN
108 OPEN c_tab_exists;
109 FETCH c_tab_exists INTO lv_rowid;
110 IF c_tab_exists%FOUND THEN
111 RETURN TRUE;
112 ELSE
113 RETURN FALSE;
114 END IF;
115 CLOSE c_tab_exists;
116 END check_tab_exists;
117
118 END igs_ge_sec_config_pkg;