Subversion Repositories DevTools

Rev

Rev 5354 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5354 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'
5
'   User_Privileges.asp
6
'   Display the complete list of user privileges and the source of the permission
7
'   Tis page does not allow them to be edited - that is done on other pages
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
Response.Expires = 0
13
%>
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/config.asp"-->
16
<!--#include file="common/common_subs.asp"-->
17
<!--#include file="common/_user_common.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_general.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim rsQry
25
Dim ActiveCombo
26
Dim VisibleCombo
27
Dim currObj_id
28
Dim isNewGroup
29
Dim isVisibleComboDisabled
30
Dim isActiveComboDisabled
31
Dim ActionDescriptions
32
Dim objAppCollector
33
'------------ CONSTANTS DECLARATION -----------
34
'------------ VARIABLE INIT -------------------
35
Set objAppCollector = CreateObject("Scripting.Dictionary")
36
'------------ CONDITIONS ----------------------
37
'----------------------------------------------
38
%>
39
<%
40
'--------------------------------------------------------------------------------------------------------------------------------------------
41
Sub GetActionDescriptions
42
    Set ActionDescriptions = CreateObject("Scripting.Dictionary")
43
    If parApp_id <> "" Then
44
        Dim rsQry, query
45
        query = "Select OBJ_ID, OBJ_NAME, OBJ_DESCRIPTION from control_objects where app_id = " & parApp_id
46
 
47
        Set rsQry = OraDatabase.DbCreateDynaset( query , ORADYN_DEFAULT )
48
 
49
        While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
50
            ActionDescriptions.Add rsQry("OBJ_ID").Value , rsQry("OBJ_DESCRIPTION").Value
51
            rsQry.MoveNext
52
        Wend
53
 
54
        rsQry.Close
55
        Set rsQry = Nothing
56
 
57
    End If
58
End Sub
59
'--------------------------------------------------------------------------------------------------------------------------------------------
60
Sub SetPermissionCombos ( nObj_id, _
61
                          bNewGroup, _
62
                          cIsRoleVariation, _
63
						  ByRef isVisibleComboDisabled,_ 
64
                          ByRef isActiveComboDisabled, _
65
						  cVisible, _
66
                          cActive, _
67
						  ByRef outVisibleCombo, _
68
                          ByRef outActiveCombo )
69
	Dim i
70
    Dim visText, actText
71
 
72
 
73
	' --- Visible Combo ---
74
	For i = 0 To UBound( arrVisiblePermissions ) Step NumberofPermissionFields
75
		If arrVisiblePermissions( INXperm_val + i ) = cVisible Then
76
            visText = arrVisiblePermissions( INXperm_text + i ) 
77
		End If
78
	Next
79
 
80
	outVisibleCombo = "<span class='form_iname'>" & visText & "</span>"
81
 
82
 
83
	' --- Active Combo ---
84
	For i = 0 To UBound( arrActivePermissions ) Step NumberofPermissionFields
85
		If arrActivePermissions( INXperm_val + i ) = cActive Then
86
            actText = arrActivePermissions( INXperm_text + i ) 
87
		End If
88
	Next
89
 
90
    outActiveCombo = "<span class='form_iname'>" & actText & "</span>"
91
 
92
End Sub
93
'--------------------------------------------------------------------------------------------------------------------------------------------
94
%>
95
<%
96
'------------ RUN BEFORE PAGE RENDER ----------
97
Call GetUserDetails ( parUser_id, objUserCollector )
98
Call GetApplicationDetails ( parApp_id, objAppCollector )
99
Call GetActionDescriptions
100
'----------------------------------------------
101
%>
102
<html>
103
<head>
104
<title>Access Manager</title>
105
<link rel="shortcut icon" href="<%=FavIcon%>"/>
106
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
107
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
108
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
109
<script language="JavaScript" src="scripts/common.js"></script>
110
 
111
</head>
112
 
113
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
114
<!-- HEADER ++++++++++++++++++++++ -->
115
<!--#include file="_header.asp"-->
116
<!-- +++++++++++++++++++++++++++++ -->
117
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
118
  <tr>
119
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
120
	<!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
121
	<!--#include file="_treeNavigator.asp"-->  
122
	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
123
	</td>
124
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
125
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
126
      <tr>
127
        <td background="images/bg_drk_bage_pane.gif">
128
		  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
129
            <tr>
130
              <td nowrap class="body_txt">
131
			    <!-- BUTTONS CONTROL +++++++++++++++++++ -->
132
				<!-- +++++++++++++++++++++++++++++++++++ -->
133
			  </td>
134
              <td align="right" nowrap class="section_ttl"><%=PARENT_TITLE%></td>
135
            </tr>
136
          </table>
137
		</td>
138
      </tr>
139
	  <tr>
140
        <td class="menu_crumbttl"><%Call RenderTitle ( objUserCollector )%> Application: <%=objAppCollector.Item ("application_name")%></td>
141
      </tr>
142
      <tr>
143
        <td>
144
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
145
		 	<!-- TAB CONTROLS ++++++++++++++++++++++ -->
146
			<!--#include file="_tabs_definition.asp"-->
147
			<%
148
			Set objTabControl = New TabControl
149
			objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleMac/mac_style.html") ) ' Supply tab style definition
150
			objTabControl.TabStyle = "StyleMac"
151
			objTabControl.AddTabDefnition ( arrUserAccount )
152
			objTabControl.SelectByName ( "User Permissions" )
153
			objTabControl.Render ()
154
			%>
155
			<!-- END OF TAB CONTROLS +++++++++++++++ -->
156
		 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
157
          <tr>
158
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="500"></td>
159
            <td width="100%" valign="top">
160
			  <table width="100%"  border="0" cellspacing="10" cellpadding="0">
161
                <tr>
162
                  <td>
163
				  <!-- TAB DETAILS +++++++++++++++++++++++++++++ -->
164
					<table width="100%"  border="0" cellspacing="3" cellpadding="0">
165
			          <tr>
166
					  	<td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
167
			            <td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
168
			              <tr>
169
			                <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Role Name</td>
170
			              </tr>
171
			            </table></td>
172
						<td width="1%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Permissions</td>
173
						<td width="60%" align="right" background="images/bg_table_col.gif" class="body_col">Description</td>
174
			          </tr>
175
					  <%
176
					  OraDatabase.Parameters.Add "USER_ID",  parUser_id, ORAPARM_INPUT, ORATYPE_NUMBER 
177
					  OraDatabase.Parameters.Add "APP_ID",   parApp_id,	 ORAPARM_INPUT, ORATYPE_NUMBER 
178
 
179
					  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("UserPermissions.sql") , ORADYN_DEFAULT )
180
					  currObj_id = -1
181
					  isNewGroup = FALSE
182
					  isVisibleComboDisabled = ""
183
					  isActiveComboDisabled = ""
184
 
185
					  While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
186
					  %>
187
 
188
					  <%If currObj_id <> CInt(rsQry("obj_id")) Then%>
189
					  <%isNewGroup = TRUE%>
190
					  <tr>
191
						<td nowrap colspan="2" class="body_row" bgcolor="F5F5F5">
192
                            <a href="Control_Privileges.asp?obj_id=<%=rsQry("obj_id")%><%=objPMod.ComposeURLWithout("obj_id")%>" title="See this Control Permissions" class="body_link"><%=LIMG_CONTROL & rsQry("obj_name")%></a>
193
                        </td>
194
						<td nowrap class="body_row" bgcolor="F5F5F5"></td>
195
						<td class="body_row" bgcolor="F5F5F5"><%=ActionDescriptions.Item(rsQry("obj_id").Value)%></td>
196
			          </tr>
197
					  <%currObj_id = CInt(rsQry("obj_id"))%>
198
					  <%End If%>
199
 
200
					  <%Call SetPermissionCombos ( rsQry("role_id") &"_"& rsQry("obj_id"), _
201
					  							   isNewGroup, rsQry("is_role_variation"), _
202
												   isVisibleComboDisabled, isActiveComboDisabled, _
203
					  							   rsQry("visible_value"), rsQry("active_value"), _
204
												   VisibleCombo, ActiveCombo )%>
205
			          <tr>
206
					  	<td align="center"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
207
						<td nowrap class="body_row"><a href="Role_Privileges.asp?role_id=<%=rsQry("role_id")%><%=objPMod.ComposeURLWithout("role_id")%>" title="See this Role Permissions" class="body_link"><%If IsNull( rsQry("is_role_variation") ) Then%><%=LIMG_ROLE%><%Else%><%=LIMG_SPEC_ROLE%><%End If%><%=rsQry("role_name")%></a></td>
208
						<td class="body_txt" nowrap background='images/bg_bage_pane.gif'>&nbsp;&nbsp;<%=VisibleCombo%>&nbsp;&nbsp;<%=ActiveCombo%>&nbsp;&nbsp;</td>
209
						<td class="body_rowg"></td>
210
			          </tr>
211
					  <%
212
					  isNewGroup = FALSE
213
					  rsQry.MoveNext
214
					  %>
215
 
216
			          <tr>
217
			            <td colspan="5" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
218
			          </tr>
219
					  <%
220
					  WEnd
221
 
222
					  OraDatabase.Parameters.Remove "USER_ID"
223
					  OraDatabase.Parameters.Remove "APP_ID"
224
					  %>
225
			          <tr>
226
			            <td colspan="5" background="images/bg_table_border.gif">
227
						 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
228
			              <tr>
229
			                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
230
			              </tr>
231
			             </table>
232
						</td>
233
			          </tr>
234
			         </table>
235
					 <SPAN class="body_txtg"><b>NOTE:</b> "User Specific" Role (<%=LIMG_SPEC_ROLE%>), will overwrite the permissions given by other roles.</SPAN>
236
				  <!-- +++++++++++++++++++++++++++++++++++++++++ -->
237
				  </td>
238
                </tr>
239
              </table>
240
			</td>
241
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
242
          </tr>
243
         </table>
244
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
245
           <tr>
246
             <td background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
247
           </tr>
248
         </table>
249
		 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
250
         <br></td>
251
      </tr>
252
    </table></td>
253
  </tr>
254
</table>
255
<!-- FOOTER ++++++++++++++++++++++ -->
256
<!--#include file="_footer.asp"-->
257
<!-- +++++++++++++++++++++++++++++ -->
258
</body>
259
</html>
260
<%
261
'------------ RUN AFTER PAGE RENDER -----------
262
'----------------------------------------------
263
%>
2 rsolanki 264
<!--#include file="common/globals_destructor.asp"-->