1 PACKAGE BOM_SECURITY_PUB AS
2 /* $Header: BOMSECPS.pls 120.2 2005/07/27 08:59:10 earumuga noship $ */
3 /*#
4 * This API contains methods to ensure BOM security
5 * @rep:scope public
6 * @rep:product BOM
7 * @rep:displayname BOM Security Policy Package
8 * @rep:lifecycle active
9 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
10 */
11
12 --This is for temporary testing in systemtest has to remove this
13 --Prior to releasing as all the internal users have EGO_VIEW_ITEM Privelege
14 FUNCTION_NAME_TO_CHECK VARCHAR2(30) := 'EGO_VIEW_ITEM';
15 EDIT_ITEM_PREVILEGE VARCHAR2(30) := 'EGO_EDIT_ITEM';
16
17 -- Start OF comments
18 -- API name : CHECK_USER_PRIVILEGE
19 -- TYPE : Public
20 -- Pre-reqs : None
21 -- FUNCTION : Determines whether user is granted a particular
22 -- function for a particular object instance.
23 --
24 -- Parameters:
25 -- IN : p_api_version IN NUMBER (required)
26 -- API Version of this procedure (currently 1.0)
27 --
28 -- p_function IN VARCHAR2 (required)
29 -- name of the function
30 --
31 -- p_object_name IN VARCHAR2 (required)
32 -- object on which the grant should be checked
33 -- from fnd_objects table.
34 --
35 -- p_instance_pk[1..5]_value IN NUMBER (required)
36 -- Primary key values for the object instance, with order
37 -- corresponding to the order of the PKs in the
38 -- FND_OBJECTS table. Most objects will only have a
39 -- few primary key columns so just let the higher,
40 -- unused column values default to NULL.
41 --
42 -- p_user_name IN VARCHAR2 (optional)
43 -- User to check grant for, from FND_USER or another
44 -- table (like HZ_PARTIES) that the view column
45 -- WF_ROLES.NAME is based on. Pass the same value stored
46 -- in the GRANTEE_KEY column in FND_GRANTS.
47 -- Examples of values that might be passed: 'SYSADMIN',
48 -- 'HZ_PARTIES:1234'
49 -- Defaults to current FND user if null.
50 --
51 -- OUT :
52 -- RETURNs 1 byte result code:
53 -- 'T' function is granted.
54 -- 'F' not granted.
55 -- 'E' Error
56 -- 'U' Unexpected Error
57 --
58 -- If 'E' or 'U' is returned, there will be an error
59 -- message on the FND_MESSAGE stack which
60 -- can be retrieved with FND_MESSAGE.GET_ENCODED()
61 -- If that message is not used, it must be cleared.
62 --
63
64 -- Version: Current Version 1.0
65 -- Previous Version : None
66 -- Notes :
67 --
68 -- END OF comments
69 ----------------------------------------------------------------
70
71 /*#
72 * Determines whether user is granted a particular function for a particular object instance
73 * @param p_api_version API Version of this procedure (currently 1.0)
74 * @param p_function name of the function
75 * @param p_object_name object on which the grant should be checked from fnd_objects table.
76 * @param p_instance_pk1_value [1...5] Primary key values for the object instance, with order
77 * corresponding to the order of the PKs in the FND_OBJECTS table. Most objects will only have
78 * a few primary key columns so just let the higher,unused column values default to NULL
79 * @param p_user_name User to check grant for, from FND_USER or another table (like HZ_PARTIES)
80 * that the view column WF_ROLES.NAME is based on.Pass the same value stored in the GRANTEE_KEY
81 * column in FND_GRANTS.Examples of values that might be passed: 'SYSADMIN','HZ_PARTIES:1234'
82 * Defaults to current FND user if null.
83 * @return 1 byte result code: 'T' function is granted, 'F' not granted , 'E' Error,
84 * 'U' Unexpected Error . If 'E' or 'U' is returned, there will be an error message on the
85 * FND_MESSAGE stack which can be retrieved with FND_MESSAGE.GET_ENCODED() If that message is not used,
86 * it must be cleared.
87 * @rep:scope public
88 * @rep:lifecycle active
89 * @rep:displayname Check User Privilege
90 */
91 FUNCTION CHECK_USER_PRIVILEGE
92 (
93 p_api_version IN NUMBER,
94 p_function IN VARCHAR2,
95 p_object_name IN VARCHAR2,
96 p_instance_pk1_value IN VARCHAR2,
97 p_instance_pk2_value IN VARCHAR2 DEFAULT NULL,
98 p_instance_pk3_value IN VARCHAR2 DEFAULT NULL,
99 p_instance_pk4_value IN VARCHAR2 DEFAULT NULL,
100 p_instance_pk5_value IN VARCHAR2 DEFAULT NULL,
101 p_user_name in varchar2 default null
102 )
103 RETURN VARCHAR2;
104
105 -- Start OF comments
106 -- API name : CHECK_ITEM_PRIVILEGE
107 -- TYPE : Public
108 -- Pre-reqs : None
109 -- FUNCTION : Determines whether user is granted a particular
110 -- function for a particular object instance.
111 --
112 -- Parameters:
113 -- IN : p_function IN VARCHAR2 (required)
114 -- name of the function
115 -- p_inventory_item_id IN VARCHAR2
116 -- item id of the inventory item
117 -- p_organization_id IN VARCHAR2
118 -- organization in which the inventory item
119 -- is defined.
120 -- p_user_name IN VARCHAR2
121 --
122 -- OUT :
123 -- RETURNs 1 byte result code:
124 -- 'T' function is granted.
125 -- 'F' not granted.
126 -- 'E' Error
127 -- 'U' Unexpected Error
128 --
129 -- If 'E' or 'U' is returned, there will be an error
130 -- message on the FND_MESSAGE stack which
131 -- can be retrieved with FND_MESSAGE.GET_ENCODED()
132 -- If that message is not used, it must be cleared.
133 --
134
135 -- Version: Current Version 1.0
136 -- Previous Version : None
137 -- Notes :
138 --
139 -- END OF comments
140 ----------------------------------------------------------------
141
142 /*#
143 * Determines whether user is granted a particular function for a particular object instance
144 * @param p_function name of the function
145 * @param p_inventory_item_id item id of the inventory item
146 * @param p_organization_id organization in which the inventory item is defined
147 * @param p_user_name user name
148 * @return 1 byte result code: 'T' function is granted, 'F' not granted , 'E' Error,
149 * 'U' Unexpected Error . If 'E' or 'U' is returned, there will be an error message on the
150 * FND_MESSAGE stack which can be retrieved with FND_MESSAGE.GET_ENCODED() If that message is not used,
151 * it must be cleared
152 * @rep:scope public
153 * @rep:lifecycle active
154 * @rep:displayname Check Item Privilege
155 */
156
157 FUNCTION CHECK_ITEM_PRIVILEGE
158 (
159 p_function IN VARCHAR2,
160 p_inventory_item_id IN VARCHAR2,
161 p_organization_id IN VARCHAR2,
162 p_user_name in varchar2 default null
163 )
164 RETURN VARCHAR2;
165
166
167 /* Function that return the Logged in EGO USER */
168
169 /*#
170 * Method that return the Logged in EGO USER
171 * @return the user name of the logged in EGO user
172 * @rep:scope private
173 * @rep:lifecycle active
174 * @rep:displayname Get EGO User
175 */
176 FUNCTION GET_EGO_USER
177 RETURN VARCHAR2;
178
179 FUNCTION GET_FUNCTION_NAME_TO_CHECK RETURN VARCHAR2;
180
181 END BOM_SECURITY_PUB; -- Package spec