1 PACKAGE CS_SR_SECURITY_UTIL AS
2 /* $Header: csusecs.pls 120.1 2005/10/04 13:53:28 spusegao noship $ */
3
4 FUNCTION SET_SR_ACCESS (
5 object_schema IN VARCHAR2,
6 object_name IN VARCHAR2 )
7 RETURN VARCHAR2;
8
9 FUNCTION SET_SR_TYPE_ACCESS (
10 object_schema IN VARCHAR2,
11 object_name IN VARCHAR2 )
12 RETURN VARCHAR2;
13
14 FUNCTION SET_SR_RESOURCE_ACCESS (
15 object_schema IN VARCHAR2,
16 object_name IN VARCHAR2 )
17 RETURN VARCHAR2;
18
19 FUNCTION SET_SR_ACCESS_RESP (
20 object_schema IN VARCHAR2,
21 object_name IN VARCHAR2 )
22 RETURN VARCHAR2;
23
24 PROCEDURE ENABLE_SR_POLICIES (
25 x_return_status OUT NOCOPY VARCHAR2 );
26
27 PROCEDURE DISABLE_SR_POLICIES (
28 x_return_status OUT NOCOPY VARCHAR2 );
29
30
31 /*************************************************************************
32
33 DESCRIPTION of function SECURE_SR_TASK_ASSIGN
34
35 The function is seeded as a subscription to the following JTF business
36 events:
37 Assigned is added - oracle.apps.jtf.cac.task.createTaskAssignment
38 Assignment is updated - oracle.apps.jtf.cac.task.updateTaskAssignment
39
40 The purpose of this subscription is that it is executed whenever a
41 resource is either assigned for the first time or is updated to/for
42 a service request associated Task.
43
44 The subscription will pass back to the JTF publisher a return status
45 indicating if the resource assignment satisfies the Service Security
46 policies or not.
47
48 This subscription is a 'synchronous' subscription to be executed
49 similar to a post insert / update internal hook.
50
51 LOGIC FLOW
52 1. The task_assignment_id is known to the subscription
53 2. Get the task_id and resource_id for the task_assignment_id
54 3. Get the source_id and source_type for the task_id
55 4. If the source_type = 'SR' then continue else stop and return success
56 5. Query the CS JTF resource secure view with the resource_id from
57 step 2. Return success if query return a record, else return failure.
58 6. The Tasks pub api will continue processing or stop depending on the
59 return status of the service subscription
60
61 *************************************************************************/
62 FUNCTION SECURE_SR_TASK_ASSIGN (
63 p_subscription_guid IN RAW,
64 p_event IN OUT NOCOPY WF_EVENT_T )
65 RETURN VARCHAR2;
66
67
68
69 /*************************************************************************
70
71 DESCRIPTION of function SECURE_SR_TASK_OWNER
72
73 The function is seeded as a subscription to the following JTF business
74 events:
75 Task is created - oracle.apps.jtf.cac.task.createTask
76 Task is updated - oracle.apps.jtf.cac.task.updateTaskHdr
77
78 The purpose of this subscription is that it is executed whenever a
79 task is create or updated and the task is associated to a service
80 request.
81
82 The subscription will pass back to the JTF publisher a return status
83 indicating if the owner assigned to the task satisfies the service
84 security policies or not.
85
86 This subscription is a 'synchronous' subscription to be executed
87 similar to a post insert / update internal hook.
88
89 LOGIC FLOW
90 1. The task_id is know to the subscription
91 2. Get the owner id and type, source id and type for the task
92 3. If the source_type = 'SR' then continue else stop and return success
93 4. Query the CS JTF resource secure view with the owner_id from
94 step 2. Return success if query return a record, else return failure.
95 5. The Tasks pub api will continue processing or stop depending on the
96 return status of the service subscription
97
98 *************************************************************************/
99 FUNCTION SECURE_SR_TASK_OWNER (
100 p_subscription_guid IN RAW,
101 p_event IN OUT NOCOPY WF_EVENT_T )
102 RETURN VARCHAR2;
103
104
105 /*************************************************************************
106 Name - Alter_SR_Policies
107
108 DESCRIPTION of Procedure Alter_SR_Policies
109 The proccedure is to alter the service owned database VPD policies.
110 Logic
111 IF p_security_setting = 'ANONE' THEN
112 Disable the existing service VPD policies
113 ELSIF p_security_setting = 'BSTANDARD' THEN
114 Drop the existing Service VPD policies
115 Create the service VPD policies as 'Static' policies
116 ELSIF p_security_setting = 'CCUSTOM' THEN
117 Drop the existing Service VPD policies
118 Create the service VPD policies as 'Dynamic' policies
119 END IF ;
120
121 *************************************************************************/
122
123 PROCEDURE Alter_SR_Policies
124 (p_security_setting IN VARCHAR2,
125 x_return_status OUT NOCOPY VARCHAR2,
126 x_msg_count OUT NOCOPY NUMBER,
127 x_msg_data OUT NOCOPY VARCHAR2);
128
129 END CS_SR_SECURITY_UTIL;