DBA Data[Home] [Help]

PACKAGE: APPS.HR_SECURITY

Source


1 PACKAGE HR_SECURITY AUTHID CURRENT_USER AS
2 /* $Header: hrscsec.pkh 120.3.12020000.4 2013/02/21 09:07:32 karthmoh ship $ */
3    --
4    -- WARNING - ALL FUNCTIONS IN THIS PACKAGE MUST ASSERT AT LEAST WNPS
5    -- THIS IS DUE TO RDBMS LIMITATION 519783. The PRAGMA restrictions have
6    -- been removed as this is no longer required for Oracle 8i +.
7    --
8    --
9    -- Name
10    --   get_hr_security_context
11    -- Purpose
12    --   Returns the security_profile_id for the current session.
13    --   Previously this was stored in the client_info string but
14    --   is now stored as a global variable in the hr_security_package.
15    --
16    --   WARNING:  HR DEVELOPMENT INTERNAL USE ONLY
17    --
18    -- Arguments
19    --   *none*
20    --
21   /*
22    Global variable to keep track where the call is made from
23    1 - Call is made from SSHR
24    0 - Call is not made from SSHR
25   */
26   g_IS_SSHR         NUMBER := 0;
27 
28    FUNCTION get_hr_security_context RETURN NUMBER ;
29 
30    --
31    -- Name
32    --   get_security_profile
33    -- Purpose
34    --   Returns the security profile for the current user
35    --   The value is determined from the current schema as follows :
36    --
37    --   APPS schema :
38    --   An "APPS" schema is either universal,multi-currency or multi-lingual
39    --   If set, use security_profile_id set in the package global.
40    --   Otherwise use the value 0. This is the default view all security
41    --   profile
42    --
43    --   Read-only schema :
44    --   If the current schema is the reporting_oracle_username for an
45    --   existing security profile then return its id. If there is no such
46    --   profile then raise an error.
47    --
48    --   Custom schema :
49    --   A custom schema is one which not an APPS schema and not
50    --   oracle id. The function returns the seeded view all security profile
51    --   ie 0.
52    --
53    -- Arguments
54    --   *none*
55    --
56    FUNCTION get_security_profile RETURN NUMBER ;
57 
58    --
59    -- Name
60    --   globals_need_refreshing
61    -- Purpose
62    --   Returns TRUE or FALSE depending on whether the HR globals
63    --   have become out-of-sync with the FND globals.  This typically
64    --   occurs when a user changes responsibility.
65    --
66    FUNCTION globals_need_refreshing RETURN BOOLEAN;
67 
68    --
69    -- Returns 'TRUE' if the record in the given table is accessible under
70    -- the current security context.
71    --
72    -- p_val6 , p_val7 added for SSHR performance issue
73    function show_record
74       (p_table_name     in varchar2
75       ,p_unique_id      in number
76       ,p_val1           in varchar2 default null
77       ,p_val2           in varchar2 default null
78       ,p_val3           in varchar2 default null
79       ,p_val4           in varchar2 default null
80       ,p_val5           in varchar2 default null
81       ,p_val6           IN  VARCHAR2  DEFAULT NULL --top_person_id
82       ,p_val7           IN  VARCHAR2  DEFAULT NULL -- top_person's assignment_id
83       )
84    return varchar2 ;
85 
86    --
87    -- (overloaded) show_person function to support npws.
88    --
89    FUNCTION show_person
90       (p_person_id              IN NUMBER
91       ,p_current_applicant_flag IN VARCHAR2
92       ,p_current_employee_flag  IN VARCHAR2
93       ,p_current_npw_flag       IN VARCHAR2
94       ,p_employee_number        IN VARCHAR2
95       ,p_applicant_number       IN VARCHAR2
96       ,p_npw_number             IN VARCHAR2)
97     Return VARCHAR2;
98 
99    /* This function is added for SSHR Hierarchical page Performance Issue.
100    This overloaded function has additional parameter p_top_person_id which will have the value
101    for the top_person_id using which the hierarchical query will be executed.
102    */
103    FUNCTION show_person
104       (p_person_id              IN NUMBER
105       ,p_current_applicant_flag IN VARCHAR2
106       ,p_current_employee_flag  IN VARCHAR2
107       ,p_current_npw_flag       IN VARCHAR2
108       ,p_employee_number        IN VARCHAR2
109       ,p_applicant_number       IN VARCHAR2
110       ,p_npw_number             IN VARCHAR2
111       ,p_top_person_id in number)
112     Return VARCHAR2;
113 
114    --
115    -- Under review
116    --
117    function view_all return varchar2 ;
118    --
119    -- Name
120    --   Show_BIS_Record
121    -- Purpose
122    --   Returns 'TRUE' if the record in the given table is accessible
123    --   under the current security context.
124    -- Arguments
125    --   p_org_id        organization to which the record belongs
126    --
127    FUNCTION Show_BIS_Record
128       (p_org_id    IN  NUMBER
129       )
130    RETURN VARCHAR2;
131    --
132    --
133    -- Name
134    --   get_sec_profile_bg_id
135    -- Purpose
136    --   Returns the business_group_id value forthe current sessions security
137    --   profile held in g_context.
138    -- Arguments
139    --   none
140    --
141    FUNCTION get_sec_profile_bg_id RETURN NUMBER;
142    --
143    --
144    -- Name
145    --   get_person_id
146    -- Purpose
147    --   Returns the named_person_id value for the current sessions security
148    --   profile.
149    -- Arguments
150    --   none
151    --
152    FUNCTION get_person_id RETURN NUMBER;
153    --
154    PROCEDURE add_assignment(p_person_id number, p_assignment_id number);
155    --
156    PROCEDURE add_person(p_person_id number);
157    --
158    PROCEDURE remove_person(p_person_id number);
159    --
160    PROCEDURE add_organization(p_organization_id number,
161                               p_security_profile_id  number);
162    --
163    PROCEDURE add_position(p_position_id number,
164                           p_security_profile_id  number);
165    --
166    PROCEDURE add_payroll(p_payroll_id number);
167    --
168    FUNCTION restrict_on_individual_asg RETURN BOOLEAN;
169    --
170    FUNCTION restrict_by_supervisor_flag RETURN VARCHAR2;
171    --
172    PROCEDURE delete_list_for_bg(p_business_group_id NUMBER);
173    --
174    PROCEDURE delete_per_from_list(p_person_id  number);
175    --
176    PROCEDURE delete_org_from_list(p_organization_id   number);
177    --
178    PROCEDURE delete_pos_from_list(p_position_id     number);
179    --
180    PROCEDURE delete_payroll_from_list(p_payroll_id     number);
181    --
182    FUNCTION is_user_rtm return boolean;
183    --
184 END HR_SECURITY;