Re: How to restrict any select to a subset?
- From: "William Vaughn" <billvaNoSPAM@xxxxxxxxx>
- Date: Sat, 29 Dec 2007 13:26:38 -0800
One approach would be to add a column to the target tables that would specify the User/Company that has access to the row. This could be a coded value that might mean that only a specific company has acess to the row or that several users could gain access. Of course, multiple users/row would be harder to manage concurrency as more than one user might "own" the row, so I would avoid this approach--one user per row would be manageable. When you executed the SELECT the User_Owns column would be specified in the WHERE clause.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"David Thielen" <thielen@xxxxxxxxxxxxx> wrote in message news:1FAAE696-F814-490C-8043-37582FCB2813@xxxxxxxxxxxxxxxx
Hi;
We are designing a web application where multiple companies can use it. We
want to give every company access to their data, and only their data. So if
both Oracle and Microsoft are using the system, only Microsoft can see the
Microsoft data and only Oracle can see the Oracle data.
But with that restriction, we want to give them access to all tables. And
for some tables determining that restriction can be indirect. For example, an
invoice record may have a FK of the company, but an invoice item record only
has a FK of the invoice.
Is there a way to restrict selects to only the rows of data a company
"owns." Or any other suggestions on how to do this? Creating a database for
each company would work - but that means creating thousands of databases on
one server and I am guessing that is inefficient???
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
.
- Prev by Date: Re: Error while connecting remote SQL server
- Next by Date: Re: Best Practices for Data Access
- Previous by thread: Re: How to restrict any select to a subset?
- Next by thread: UDF in LINQ: "Stored Procedures cannot be used inside queries"
- Index(es):
Relevant Pages
|