Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating a security model in SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-16 : 09:30:23
Doug writes "SQLTeam,

First off, I haven't been here for a while because I haven't been involved with a SQL project lately. But, I am starting one this week that should last until the end of the year. I have always regarding SQLTeam.com as the best SQL knowledge base. Thanks!

I need to create an intranet application that displays a list of options in a <SELECT> element based upon the visitors group membership.

Each USER has a USERID, USERNAME and PASSWORD.
Each GROUP has a GROUPID and a DESC.
Each USER must belong to one, but can belong to many GROUPS.

I have a USERS table, a GROUPS table and a table to link the two together named USERS_GROUPS. When a user logs in to the application I store the USERID and each GROUPID in separate session variables. The session("groupid") variable contains an array of GROUPID's that the user belongs to, for example "2,32,152,500".

The application provides the visitor with a list links to online surveys that they are permitted to submit. I don't want visitors to be able to see links to all of the surveys available, only the surveys that pertain to the groups to which they belong. Following the example above, survey "C" may be available to members of GROUPID 2 and survey "M" may be available to members of group 32. When a user belonging to group 2 and 32 logs in I want to query the database and retrieve survey "C" and "M" but not survey "A,B,D,E,..."

Best Regards,

Doug"
   

- Advertisement -