This topic is locked

Guest user group and permissions.

2/7/2008 12:31:34 PM
ASPRunnerPro General questions
G
gnabi author

I am using ASPrunner 5.1 build 300. I have a problem which sounds simple but I am having trouble fixing it.
I have a table called "cl_register".

A user come to my site and view any pages without logging in.

I have a drop down menu where I have two submenu "Login" and "My profile"
If user click on Login. I display "login.asp" so a login page is displayed. That is fine.

Now if user click on "My profile" I display "cl_register_list.asp". If user is not logged in yet then following page is displayed:
"You don't have permissions to access this table Back to login page"
I have given "List/View" permission to <Guest> group on cl_register table. Also I have selected that user can view and edit their own record on security tab.
Here is what I want.
If user click on "My profile" without logging in. I do not want to dispay message "You don't have permissions to access this table Back to login page". Instead I want to display login.asp page.
How can I accomplish this. Is my approach correct?

Please give me a little hint and I think I should be able to work this out.
I appreciate you help.

Thanks a lot!!

J
Jane 2/13/2008

Hi,
use List page: Before process event on the Events tab for this purpose.

Here is a sample:

if Session("UserID")="Guest" then

Response.Redirect "login.asp"

end if

G
gnabi author 2/13/2008

Thanks Jane!
This does not work because following code comes before events: If you are Guest then first If condition is not satisfied but second is satisfied so get "You don't have permissions to access this table" message.
I can add 'OR SESSION("UserID")="Guest" ' in the first if statement, then I have to change it everytime I generate code. I have some other similar cases too. Please see if there is any other solution to this problem. I appreciate any one's help here.
if SESSION("UserID")="" then

SESSION("MyURL")=request.ServerVariables("SCRIPT_NAME")&"?"&request.ServerVariables("QUERYSTRING")

response.Redirect "login.asp?message=expired"

response.End

end if

if not CheckSecurity(SESSION("
" & strTableName & "OwnerID"),"Search") and not CheckSecurity(SESSION("" & strTableName & "_OwnerID"),"Add") then

response.Write "<p>" & "You don't have permissions to access this table" & " <a href=""login.asp"">" & "Back to login page" & "</a></p>"

response.End

end if