Print Page | Close Window

access levels

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6258
Printed Date: 31 March 2026 at 3:20am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: access levels
Posted By: yessir
Subject: access levels
Date Posted: 08 October 2003 at 8:46am

I am developing an ASP site which has an ACCESS backend.  I am going to have users login and based on the level of access given to them by the admin the should only be able to access certain parts of a page.

=====================
3 levels:
=====================
ADMIN :: total access
update :: enter data/edit
read :: read ONLY access

I am going to have a menu which must be accessible based on the login level, the menu entry then goes to a listing based on the menu item selected and level access.

============================
The Listing page has 4 options on it. (all are html links)
============================
Add     (by itself)
View   (in listing as a column)
Edit     (in listing as a column)
Delete (in listing as a column)


I  wish to have
admins with no restrictions
update to see add/view/edit
read view only

So the question is HOW do i restrict access/visibility of the html links to the add(on its own) and to the view/edit/delete(parts of the listing as the first 3 columns) all based on the users login and assigned accessability?

This is VERY important and I need to know SOON
Please helP

thanks in advance
~




Replies:
Posted By: fernan82
Date Posted: 08 October 2003 at 9:45am

Assuming you use a numeric value for the groups I would make:

Read = 1
Update = 2
Admin = 3

The code for the menu would look like this:

If intAccessLevel => 2 Then Response.Write("<a href=""http://add.asp"">Add</a>")

If intAccessLevel => 1 Then Response.Write("<a href=""http://view.asp"">Vuiew</a>")

If intAccessLevel => 2 Then Response.Write("<a href=""http://edit.asp"">Edit</a>")

If intAccessLevel => 2 Then Response.Write("<a heref=""http://delete.asp"">Delete</a>")

 

 



-------------
FeRnAN
http://www.danasoft.com/">


Posted By: l_baltodano
Date Posted: 08 October 2003 at 12:14pm

hi fernan82.. i got that part.. plz. excuse me if i ask about this topic too.. but i´m in the same hurry.

Well if i assign an account level in the database, then i just need to write that value in a cokkie right?.. so, when the user comeback the system will check the cache to see what´s his level and based on that it will display the appropiate value right?

Just one more question.. do i need to check the user level in all my ".asp" pages?.

Thank you very much!



Posted By: yessir
Date Posted: 08 October 2003 at 12:24pm

i wouldn;t cache anything, at the end of a session remove teh cookie/cache if you do.

 

And yes in all your pages you have to check!



Posted By: vshriniwasan
Date Posted: 10 October 2003 at 4:10pm
I did similar item few weeks ago. I simply created a small Function and passed level and module value through it. Function(level,mod). Using that I can specifically display what options I want to give to the user, and depending on the Mod, you can show the options accordingly. By doing this, I didn't have to recreate the code in everypage, looking for what module what user is accessing, and what level access he has. By using the same function over and over again, it will make it easy for you to control this process.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net