Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			   _SetRoleVariationPermissions	 	 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_code_behind_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
'------------ CONSTANTS DECLARATION -----------
24
'------------ VARIABLE INIT -------------------
25
'------------ CONDITIONS ----------------------
26
'----------------------------------------------
27
%>
28
<%
29
'--------------------------------------------------------------------------------------------------------------------------
30
Sub SetRoleVariationPermissions ()
31
	Dim rsQry, aRoleAndObjects, i, LastRow, ObjId, RoleId, OraParameter
32
 
33
	On Error Resume Next
34
 
35
	OraDatabase.Parameters.Add "APP_ID", 	Request("app_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER 
36
	OraDatabase.Parameters.Add "USER_ID", 	Request("user_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER 
37
	OraDatabase.Parameters.Add "ROLE_ID", 	NULL, 					ORAPARM_INPUT, ORATYPE_NUMBER 
38
	OraDatabase.Parameters.Add "OBJ_ID", 	NULL, 					ORAPARM_INPUT, ORATYPE_NUMBER 
39
	OraDatabase.Parameters.Add "IS_VISIBLE",NULL, 					ORAPARM_INPUT, ORATYPE_VARCHAR2
40
	OraDatabase.Parameters.Add "IS_ACTIVE", NULL, 					ORAPARM_INPUT, ORATYPE_VARCHAR2
41
 
42
 
43
	'--- Get All Role Controls Pairs for this Application and User ---
44
	Set OraParameter = OraDatabase.Parameters
45
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("RoleObjectPairsForUserPermissionUpdate.sql") , ORADYN_DEFAULT )
46
	aRoleAndObjects = rsQry.GetRows()
47
	LastRow = UBound( aRoleAndObjects, 2 )
48
	rsQry.Close
49
	Set rsQry = Nothing
50
 
51
 
52
	'--- Set Role Permissions ---
53
	objEH.TryORA ( OraSession )
54
 
55
		For i = 0 To LastRow
56
 
57
			RoleId = aRoleAndObjects( 0, i )
58
			ObjId = aRoleAndObjects( 1, i )
59
 
60
			OraParameter("ROLE_ID").Value = RoleId
61
			OraParameter("OBJ_ID").Value = ObjId
62
			OraParameter("IS_VISIBLE").Value = Request( "VIS_"& RoleId &"_"& ObjId )
63
			OraParameter("IS_ACTIVE").Value =  Request( "ACT_"& RoleId &"_"& ObjId )
64
 
65
			'Response.write OraParameter("ROLE_ID") &"-"& OraParameter("OBJ_ID") &"-"& OraParameter("IS_VISIBLE") &"-"& OraParameter("IS_ACTIVE") &"<br>"
66
			OraDatabase.ExecuteSQL _
67
			"BEGIN   pk_Role.Set_Role_Variation_Permissions ( :USER_ID, :APP_ID, :ROLE_ID, :OBJ_ID, :IS_VISIBLE, :IS_ACTIVE );   END;"
68
 
69
		Next
70
 
71
 
72
		'--- Log Action ---
73
		'objEH.LogAction  _
74
		'objAccessControl.UserId, _
75
		'enumAT_EVENT_COMMENT, _
76
		'"Sub RemoveProductFromOs PROD_ID_LIST="& Request("prod_id_list") &", OS_ID="& Request("os_id") , _
77
		'SCRIPT_NAME, _
78
		'"Removed Products from OS.", _
79
		'OraDatabase 
80
 
81
	objEH.CatchORA ( OraSession )
82
 
83
 
84
	OraDatabase.Parameters.Remove "APP_ID"
85
	OraDatabase.Parameters.Remove "USER_ID"
86
	OraDatabase.Parameters.Remove "ROLE_ID"
87
	OraDatabase.Parameters.Remove "OBJ_ID"
88
	OraDatabase.Parameters.Remove "IS_VISIBLE"
89
	OraDatabase.Parameters.Remove "IS_ACTIVE"
90
 
91
End Sub
92
'--------------------------------------------------------------------------------------------------------------------------
93
%>
94
<%
95
'**************************** M  A  I  N ******************************
96
' --- Form is Valid ---
97
Call SetRoleVariationPermissions()
98
 
99
If objEH.Finally Then
100
	Call OpenInWindow ( Request("rfile") &"?"& objPMod.ComposeURL() )
101
End If
102
'**********************************************************************
103
%>
104
<%
105
'------------ RUN AFTER CODE RUN --------------
106
'----------------------------------------------
107
%><!--#include file="common/globals_destructor.asp"-->