DBA Data[Home] [Help]

PACKAGE: APPS.MO_GLOBAL

Source


1 PACKAGE mo_global AS
2 /* $Header: AFMOGBLS.pls 120.10 2006/10/04 21:46:14 sryu noship $ */
3 
4 --
5 -- Name
6 --   Init
7 -- Purpose
8 --   Initialization code for Organization security Policy
9 --
10 
11 PROCEDURE init(p_appl_short_name  VARCHAR2);
12 PROCEDURE init(p_appl_short_name  VARCHAR2, p_sync VARCHAR2);
13 --
14 -- Name
15 --   jtt_init
16 -- Purpose
17 --   Initialization code for Organization Security Policy.  This is
18 --   mainly called from JTT java API's.
19 --   This will call the init API and will also initialize ICX sesion attribute
20 --   JTTCURRENTORG when temp table has only one record
21 --
22 PROCEDURE jtt_init(p_appl_short_name  IN VARCHAR2,
23                    p_icx_session_id   IN NUMBER);
24 
25 --
26 -- Name
27 --   clear_current_org_context
28 -- Purpose
29 --   This procedure clears the current org context in database session as
30 --   well as reset the ICX session attribute JTTCURRENTORG
31 --
32 PROCEDURE clear_current_org_context(p_icx_session_id   IN NUMBER);
33 
34 
35 --
36 -- Name
37 --   set_org_access
38 -- Purpose
39 --   Sets up the organization access list from MO: Operating Unit and
40 --   MO: Security Profile
41 --
42 -- Arguments
43 --   p_org_id_char     - the Operating Unit identifier
44 --
45 --   p_sp_id_char      - the security profile identifier
46 --
47 --   p_appl_short_name - the application owner
48 --
49 PROCEDURE set_org_access(p_org_id_char     VARCHAR2,
50                          p_sp_id_char      VARCHAR2,
51                          p_appl_short_name VARCHAR2);
52 
53 --
54 -- Name
55 --   org_security
56 -- Purpose
57 --   Called by oracle server during parsing sql statment
58 --
59 -- Arguments
60 --   obj_schema   - schema of the object
61 --   obj_name     - name of the object
62 --
63 
64 FUNCTION org_security(
65   obj_schema          VARCHAR2
66 , obj_name            VARCHAR2
67 )
68 RETURN VARCHAR2;
69 
70 --
71 -- Name
72 --   set_org_context
73 -- Purpose
74 --   Wrapper procedure for setting up the Operating Unit context in the client
75 --   info area and organization access list for Multi-Org Access Control
76 --
77 -- Arguments
78 --   p_org_id_char     - org_id for the operating unit;
79 --
80 --   p_sp_id_char      - MO: Security profile id
81 --
82 --   p_appl_short_name - the application owner
83 --
84 PROCEDURE set_org_context(p_org_id_char     VARCHAR2,
85                           p_sp_id_char      VARCHAR2,
86                           p_appl_short_name VARCHAR2);
87 
88 --
89 -- Name
90 --   check_access
91 -- Purpose
92 --   Checks if an operating unit exists in the PL/SQL array.
93 --   The PL/SQL array is populated by Multi-Org API set_org_access.
94 --
95 -- Arguments
96 --   p_org_id          - org_id for the operating unit;
97 --
98 FUNCTION check_access(p_org_id    NUMBER)
99 RETURN VARCHAR2;
100 
101 --
102 -- Name
103 --   get_ou_name
104 -- Purpose
105 --   This function returns the operating unit name for the org_id parameter
106 --   passed, if it exists in the PL/SQL array, populated by
107 --   set_org_access Multi-Org API.
108 --
109 -- Arguments
110 --   p_org_id          - org_id for the Operating Unit;
111 --
112 --
113 FUNCTION get_ou_name(p_org_id    NUMBER)
114 RETURN VARCHAR2;
115 
116 --
117 -- Name
118 --   check_valid_org
119 -- Purpose
120 --   Checks if the specified operating unit exists in the session's
121 --   access control list. This function is equivalent to the
122 --   check_access function but also posts an error message if the
123 --   specified operating unit is null or not in the access list.
124 --   The calling application can check the returned value of the
125 --   function and raise an error if it is 'N'.
126 --
127 -- Arguments
128 --   p_org_id         - org_id for the Operating Unit;
129 --
130 --
131 FUNCTION check_valid_org(p_org_id NUMBER) RETURN VARCHAR2;
132 
133 --
134 -- Name
135 --   set_policy_context
136 -- Purpose
137 --   Sets the application context for the current org and access mode to
138 --   be used in server side code for validations as well as in Multi-Org
139 --   security policy function.
140 --
141 -- Arguments
142 --   p_access_mode     - specifies the operating unit access. 'S' for
143 --                       Single, 'M' for Multiple, 'A' for All. If null,
144 --                       the context will be unset.
145 --   p_org_id          - org_id of the operating unit.
146 --
147 PROCEDURE set_policy_context(p_access_mode VARCHAR2,
148                              p_org_id      NUMBER);
149 
150 --
151 -- Name
152 --   get_current_org_id
153 -- Purpose
154 --   This function returns the current_org_id stored in the application
155 --   context.
156 --
157 FUNCTION get_current_org_id RETURN NUMBER;
158 
159 --
160 -- Name
161 --   get_access_mode
162 -- Purpose
163 --   This function returns the access mode stored in the application
164 --   context.
165 --
166 FUNCTION get_access_mode RETURN VARCHAR2;
167 
168 --
169 -- Name
170 --   is_multi_org_enabled
171 -- Purpose
172 --   This function determines whether this is a Multi-Org
173 --   instance or not. Returns 'Y' or 'N'.
174 --
175 FUNCTION is_multi_org_enabled RETURN VARCHAR2;
176 
177 --
178 -- Name
179 --   get_ou_count
180 -- Purpose
181 --   This function returns the count of the records stored in the Multi-Org
182 --   temporary table.
183 --
184 FUNCTION get_ou_count RETURN NUMBER;
185 
186 --
187 -- Index-by tables for storing the identifiers and names of Operating
188 -- Units.
189 --
190 TYPE OrgIdTab  IS TABLE OF hr_operating_units.organization_id%TYPE
191   INDEX BY BINARY_INTEGER;
192 TYPE OuNameTab IS TABLE OF hr_operating_units.name%TYPE
193   INDEX BY BINARY_INTEGER;
194 
195 --
196 -- A record type that contains information pertinent to an Operating
197 -- Unit.
198 --
199 TYPE OrgInfoRec IS RECORD (
200   organization_name hr_operating_units.name%TYPE);
201 
202 --
203 -- Name
204 --   get_valid_org
205 -- Purpose
206 --   This function determines and returns the valid ORG_ID.
207 --
208 -- If the org_id cannot be passed in, use FND_API.G_MISS_NUM
209 FUNCTION get_valid_org(p_org_id      NUMBER) RETURN NUMBER;
210 
211 -- function for public API
212 PROCEDURE validate_orgid_pub_api(ORG_ID IN OUT NOCOPY NUMBER,
213 				ERROR_MESG_SUPPR    IN VARCHAR2  DEFAULT 'N',
214 				STATUS     OUT NOCOPY VARCHAR2);
215 
216 -- NAME
217 --   is_mo_init_done
218 -- Purpose
219 --   This function checks whether MO init is done or not.
220 --   Returns 'Y' if initialization is done. Otherwise returns 'N'
221 --
222 FUNCTION is_mo_init_done RETURN VARCHAR2;
223 
224 
225 -- NAME
226 --    org_security_global
227 -- Purpose
228 --    This is a restricted security policy function used to support
229 --    ORG_ID secured data as well as global data having org_id=-3116.
230 --    Usage of this policy must be reviewed and approved by MO team.
231 FUNCTION org_security_global(
232   obj_schema          VARCHAR2
233 , obj_name            VARCHAR2
234 )
235 RETURN VARCHAR2;
236 
237 -- NAME
238 --  get_ou_tab
239 -- PURPOSE
240 --  returns a table of Org Ids that are accessible to the user.
241 --
242 FUNCTION get_ou_tab RETURN OrgIdTab;
243 
244 -- NAME
245 --   set_policy_context_server
246 -- PURPOSE
247 --   Server-side wrapper for set_policy_context API called from Client library
248 --
249 PROCEDURE set_policy_context_server(p_access_mode VARCHAR2,
250                                     p_org_id      NUMBER);
251 
252 end mo_global;