Question user management in asp.net

look4guna

Member
Joined
Oct 9, 2008
Messages
18
Programming Experience
Beginner
Hi Friends!

am doing a sales tracking website for a company.The problem is user management. for example the user structure must be in the following format.

Power user
|
|
--------------------
| |
Admin 1 Admin 2
| |
----------- -----------------
| | | |
user 1 user 2 user 1 user 2
| | | |
-------- ------ ------ --------
| | | | | | | |
u1 u2 u1 u2 u1 u2 u1 u2

Each user store their sales information using their user login account. Power user has all rights to see the information stored by all users including u1,u2.
But the admin user has no rights to see power user info but he can view info stored by user1 ,user 2 ,u1 ,u2 which he created. he cannot see the users info created by admin 2.

I understood how to make its work,but the problems whether i need to create each table for each user to store and display.if i do that whether will any problems occur when more number of users accessing the server at the same time?

for example take flickr website. it has similar concepts like storing and retriving each user pics etc,

can any one give idea how to this other than creating each table for each user...

because of the alignments the structure given above may vary...

Thank you,
 
Of course you wouldn't create ONE table for each user!
Instead you save the user id and user level (for example) with each record.

The SQL command would look similar to:
Pseudo-
VB.NET:
SELECT * FROM datatable WHERE (
(userid = thisuser.id)
OR
(userlevel < thisuser.level)
)
This would give any user access to HIS/HER data plus the data of everybody "below" but not "beneath".
 
If you store the data for the users, admins, and power users hierarchically (I imagine you must), then you can use this same information to determine what a user can see.

Assuming your sales all occur at the lowest level, you can determine which users each user has access to, and then query the sales using the list of accessible user IDs. I don't know that picoflop's response is granular enough--I think you might get sales by a different user at a lower level that is not within an admin's direct hierachy.

Essentially, you can simply join all the relationship tables together, and join the results to your sales table. This will allow you to pull out only what a user can see.

If you want more detail, please let me know. I am describe this only at a very high level to see if what I am saying addresses your goal. If so, we can go into specifics.


John Tabernik
The Eclectic Techie
 

Latest posts

Back
Top