Board index » delphi » MS SQL server: access restriction?

MS SQL server: access restriction?

Quote
> But is it possible to deny access on a record level?

Database designers use an approach of defining a "View" such as:

SELECT * FROM accounts
WHERE AccountCode = 'PUBLIC'

They then grant user rights to the View. Assuming your records can be
defined by a View and Sql Server supports granting rights to Views then you
may be able to achieve your goals....Otherwise I don't know of a record
level rights command.

--
Mike Collier
ADO Tool, Support & Development
Free Trial http://www.adoanywhere.com/download/aaBrowser.zip

 

Re:MS SQL server: access restriction?


Quote
> On a system containing a few hundred oil wells, this would
> imply writing a terrible lot of views - much too unpractical.

Yep,..but you did ask for a permission based answer...

Quote
> I'll see if I can solve it with a stored proc instead.

Yep, if you had a relation between users and wells:

Proc (userid)
begin
 SELECT * FROM oilwells
 WHERE
    oilwell_user.oilid = oilWells.oilid
   AND
    oilWell_user.userid = :userid
end

--
Mike Collier
ADO Tool, Support & Development
Free Trial http://www.adoanywhere.com/download/aaBrowser.zip

Quote
"Arthur Hoornweg" <arthur.hoorn...@wanadoo.nl.net> wrote in message

news:3dd38689@newsgroups.borland.com...
Quote
> > Database designers use an approach of defining a "View" such as:

> > SELECT * FROM accounts
> > WHERE AccountCode = 'PUBLIC'

> > They then grant user rights to the View.

> On a system containing a few hundred oil wells, this would
> imply writing a terrible lot of views - much too unpractical.
> I'll see if I can solve it with a stored proc instead.

> --
> Arthur Hoornweg
> (Please remove the ".net" from my e-mail address if you wish to reply by
> e-mail. I had to take this unpleasant measure to fend off unsollicited
> mail.)

> ---
> My outgoing mail is checked for viruses.

> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.417 / Virus Database: 233 - Release Date: 08.11.2002

Other Threads