Subversion Repositories DevTools

Rev

Rev 5296 | Rev 5512 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'
'   User_Privileges.asp
'   Display the complete list of user privileges and the source of the permission
'   Tis page does not allow them to be edited - that is done on other pages
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_user_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry
Dim ActiveCombo
Dim VisibleCombo
Dim currObj_id
Dim isNewGroup
Dim isVisibleComboDisabled
Dim isActiveComboDisabled
Dim ActionDescriptions
Dim objAppCollector
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
Set objAppCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------------------------
Sub GetActionDescriptions
    Set ActionDescriptions = CreateObject("Scripting.Dictionary")
    If parApp_id <> "" Then
        Dim rsQry, query
        query = "Select OBJ_ID, OBJ_NAME, OBJ_DESCRIPTION from control_objects where app_id = " & parApp_id
        
        Set rsQry = OraDatabase.DbCreateDynaset( query , ORADYN_DEFAULT )

        While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
            ActionDescriptions.Add rsQry("OBJ_ID").Value , rsQry("OBJ_DESCRIPTION").Value
            rsQry.MoveNext
        Wend
        
        rsQry.Close
        Set rsQry = Nothing
        
    End If
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------------
Sub SetPermissionCombos ( nObj_id, _
                          bNewGroup, _
                          cIsRoleVariation, _
                                                  ByRef isVisibleComboDisabled,_ 
                          ByRef isActiveComboDisabled, _
                                                  cVisible, _
                          cActive, _
                                                  ByRef outVisibleCombo, _
                          ByRef outActiveCombo )
        Dim i
    Dim visText, actText
        
        
        ' --- Visible Combo ---
        For i = 0 To UBound( arrVisiblePermissions ) Step NumberofPermissionFields
                If arrVisiblePermissions( INXperm_val + i ) = cVisible Then
            visText = arrVisiblePermissions( INXperm_text + i ) 
                End If
        Next
        
        outVisibleCombo = "<span class='form_iname'>" & visText & "</span>"
        
        
        ' --- Active Combo ---
        For i = 0 To UBound( arrActivePermissions ) Step NumberofPermissionFields
                If arrActivePermissions( INXperm_val + i ) = cActive Then
            actText = arrActivePermissions( INXperm_text + i ) 
                End If
        Next

    outActiveCombo = "<span class='form_iname'>" & actText & "</span>"
        
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
Call GetUserDetails ( parUser_id, objUserCollector )
Call GetApplicationDetails ( parApp_id, objAppCollector )
Call GetActionDescriptions
'----------------------------------------------
%>
<html>
<head>
<title>Access Manager</title>
<link rel="shortcut icon" href="<%=FavIcon%>"/>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="scripts/common.js"></script>

</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<!-- HEADER ++++++++++++++++++++++ -->
<!--#include file="_header.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
        <!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
        <!--#include file="_treeNavigator.asp"-->  
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        </td>
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
      <tr>
        <td background="images/bg_drk_bage_pane.gif">
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td nowrap class="body_txt">
                            <!-- BUTTONS CONTROL +++++++++++++++++++ -->
                                <!-- +++++++++++++++++++++++++++++++++++ -->
                          </td>
              <td align="right" nowrap class="section_ttl"><%=PARENT_TITLE%></td>
            </tr>
          </table>
                </td>
      </tr>
          <tr>
        <td class="menu_crumbttl"><%Call RenderTitle ( objUserCollector )%> Application: <%=objAppCollector.Item ("application_name")%></td>
      </tr>
      <tr>
        <td>
                 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                        <!-- TAB CONTROLS ++++++++++++++++++++++ -->
                        <!--#include file="_tabs_definition.asp"-->
                        <%
                        Set objTabControl = New TabControl
                        objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleMac/mac_style.html") ) ' Supply tab style definition
                        objTabControl.TabStyle = "StyleMac"
                        objTabControl.AddTabDefnition ( arrUserAccount )
                        objTabControl.SelectByName ( "User Permissions" )
                        objTabControl.Render ()
                        %>
                        <!-- END OF TAB CONTROLS +++++++++++++++ -->
                 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="500"></td>
            <td width="100%" valign="top">
                          <table width="100%"  border="0" cellspacing="10" cellpadding="0">
                <tr>
                  <td>
                                  <!-- TAB DETAILS +++++++++++++++++++++++++++++ -->
                                        <table width="100%"  border="0" cellspacing="3" cellpadding="0">
                                  <tr>
                                                <td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
                                    <td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
                                      <tr>
                                        <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Role Name</td>
                                      </tr>
                                    </table></td>
                                                <td width="1%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Permissions</td>
                                                <td width="60%" align="right" background="images/bg_table_col.gif" class="body_col">Description</td>
                                  </tr>
                                          <%
                                          OraDatabase.Parameters.Add "USER_ID",  parUser_id, ORAPARM_INPUT, ORATYPE_NUMBER 
                                          OraDatabase.Parameters.Add "APP_ID",   parApp_id,      ORAPARM_INPUT, ORATYPE_NUMBER 
                                          
                                          Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("UserPermissions.sql") , ORADYN_DEFAULT )
                                          currObj_id = -1
                                          isNewGroup = FALSE
                                          isVisibleComboDisabled = ""
                                          isActiveComboDisabled = ""
                                          
                                          While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                                          %>
                                          
                                          <%If currObj_id <> CInt(rsQry("obj_id")) Then%>
                                          <%isNewGroup = TRUE%>
                                          <tr>
                                                <td nowrap colspan="2" class="body_row" bgcolor="F5F5F5">
                            <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>
                        </td>
                                                <td nowrap class="body_row" bgcolor="F5F5F5"></td>
                                                <td class="body_row" bgcolor="F5F5F5"><%=ActionDescriptions.Item(rsQry("obj_id").Value)%></td>
                                  </tr>
                                          <%currObj_id = CInt(rsQry("obj_id"))%>
                                          <%End If%>
                                          
                                          <%Call SetPermissionCombos ( rsQry("role_id") &"_"& rsQry("obj_id"), _
                                                                                                   isNewGroup, rsQry("is_role_variation"), _
                                                                                                   isVisibleComboDisabled, isActiveComboDisabled, _
                                                                                                   rsQry("visible_value"), rsQry("active_value"), _
                                                                                                   VisibleCombo, ActiveCombo )%>
                                  <tr>
                                                <td align="center"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
                                                <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>
                                                <td class="body_txt" nowrap background='images/bg_bage_pane.gif'>&nbsp;&nbsp;<%=VisibleCombo%>&nbsp;&nbsp;<%=ActiveCombo%>&nbsp;&nbsp;</td>
                                                <td class="body_rowg"></td>
                                  </tr>
                                          <%
                                          isNewGroup = FALSE
                                          rsQry.MoveNext
                                          %>
                                          
                                  <tr>
                                    <td colspan="5" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                                  </tr>
                                          <%
                                          WEnd
                                          
                                          OraDatabase.Parameters.Remove "USER_ID"
                                          OraDatabase.Parameters.Remove "APP_ID"
                                          %>
                                  <tr>
                                    <td colspan="5" background="images/bg_table_border.gif">
                                                 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
                                      <tr>
                                        <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                                      </tr>
                                     </table>
                                                </td>
                                  </tr>
                                 </table>
                                         <SPAN class="body_txtg"><b>NOTE:</b> "User Specific" Role (<%=LIMG_SPEC_ROLE%>), will overwrite the permissions given by other roles.</SPAN>
                                  <!-- +++++++++++++++++++++++++++++++++++++++++ -->
                                  </td>
                </tr>
              </table>
                        </td>
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
         </table>
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
           <tr>
             <td background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
           </tr>
         </table>
                 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <br></td>
      </tr>
    </table></td>
  </tr>
</table>
<!-- FOOTER ++++++++++++++++++++++ -->
<!--#include file="_footer.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
'----------------------------------------------
%>
<!--#include file="common/globals_destructor.asp"-->