asp权限问题,请大家帮帮手,急
本人想做一个登录后按权限浏览内容的页面,分为普通员工、经理、总监3个级别。总监能查看经理写的内容,经理能查看普通员工的内容,反之则不可以。调试了很久都不通,代码要怎么写,望高人指教。
这是部分代码,请看看哪有有问题。class为权限
<%
if Session("userlogin")="" then
Response.Redirect "login.asp"
End if
Dim show
Set show=Server.CreateObject("ADODB.RecordSet")
if Session("class") = 0 then
show.Open "Select * From Qiancheng Order by Id DESC",cn,3,1
show.PageSize=15
If Len(Request("page")) = 0 Then
iPage = 1
Else
iPage = Request("page")
End If
If Not show.Eof Then
show.AbsolutePage = iPage
End If
%>
<table width="840" border="0" style="border-collapse: collapse" cellpadding="0" cellspacing="3">
<tr>
<td width="45" height="20" align="center" background="images/dot-gray01.jpg"><b>字号</b></td>
<td width="250" height="20" align="center" background="images/dot-gray01.jpg"><b>主旨</b></td>
<td width="100" height="20" align="center" background="images/dot-gray01.jpg"><b>时间</b></td>
<td width="50" height="20" align="center" background="images/dot-gray01.jpg"><b>密级</b></td>
<td width="100" height="20" align="center" background="images/dot-gray01.jpg"><b>部门</b></td>
<td width="100" height="20" align="center" background="images/dot-gray01.jpg"><b>拟稿人</b></td>
<td width="50" height="20" align="center" background="images/dot-gray01.jpg"><b>状态</b></td>
<td width="150" height="20" align="center" background="images/dot-gray01.jpg"><b>操作</b></td>
</tr>
</table>
<table width="840" border="1" bordercolor="#FFCCFF" cellpadding="0" cellspacing="3">
<%
For i=1 to show.PageSize
if not show.Eof then
%>
<tr> <td width="45" height="20" align="center"><% if show("Num") < 10 then %>
00<%=show("Num")%>
<% Else if show("Num") < 100 then %>
0<%=show("Num")%>
<% Else if show("Num") > 99 then %>
<%=show("Num")%>
<%
End if
End if
End if
%>
</td>
<td width="250" height="20" align="left">
<% if show("class")<> 1 or 2 and show("user")<> Session("userlogin") then %>
XXXXXXX
<% Else %>
<a href="show.asp?id=<%=show("Id")%>" target="_blank" >关于<%=show("Zhuzhi")%>的请示</a>
<% End if %></td>
<td width="100" height="20" align="center"><%=show("Time")%></td>
<td width="50" height="20" align="center"><%=show("Lev")%></td>
<td width="100" height="20" align="center"><%=show("Partnum")%></td>
<td width="100" height="20" align="center"><%=show("Nigao")%></td>
<td width="50" height="20" align="center"><%=show("check")%></td>
<td width="150" height="20" align="center">
<% if show("Lev")="绝密" and show("user")<> Session("userlogin") then %>
没有此权限
<% Else if show("user")<> Session("userlogin") then %>
<% Else if show("check")="已批" then %>
<% Else if show("Lev")="绝密" and show("user")=Session("userlogin") then %>
<a href="admin_edit.asp?action=edit&id=<%=show("Id")%>">修改</a>
<% Else %>
<a href="admin_edit.asp?action=edit&id=<%=show("Id")%>">修改</a> | <a href="admin_del.asp?id=<%=show("Id")%>" onClick="{if(confirm('确认删除吗?')){return true;}return false;}">删除</a>
<% End if
End if
End if
ENd if
%></td>
</tr>
<%
show.MoveNext
End if
Next
%>