Re: How Can I Create A "Reader" Role?
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 19 Sep 2009 09:24:32 +0000 (UTC)
Doug (nospam@xxxxxxxxxxx) writes:
Giving data reader on SS 2005 also appears to give the privilege of "view
definition" - something I try to stay away from.
If you have SELECT permisson on an object implicitly also gives you
VIEW DEFINITION. You need to explicitly DENY this permission to avoid
this.
Much prefer creating a db role, then generating appropriate grant
statements through a select statement joining sys.objects and
sys.schemas (if I remember correctly) and adding the db user to the new
role.
No need for joining. If you want a role that has SELECT permission on
all objects, but VIEW DEFINITION on none, you can do:
GRANT SELECT TO yourrole
DENY VIEW DEFINITION TO yourrole
However, beware that DENY takes precedence of GRANT, so if you want users
to be able to see the definition of some tables, the above will not be good.
Also beware that several client APIs has methods which reads metadata
under the cover, these methods will stop working if you deny VIEW
DEFINITION.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- How Can I Create A "Reader" Role?
- From: J. Love
- Re: How Can I Create A "Reader" Role?
- From: Erland Sommarskog
- Re: How Can I Create A "Reader" Role?
- From: Doug
- How Can I Create A "Reader" Role?
- Prev by Date: Re: How Can I Create A "Reader" Role?
- Next by Date: SQL Server 2000 service account & SSL?
- Previous by thread: Re: How Can I Create A "Reader" Role?
- Next by thread: Encryption/Decyription Re-Create Master Key,Symetric Key and Cer
- Index(es):
Relevant Pages
|
Loading