Solved

Simplifying security on SQL Server 2008 R2.

Posted on 2011-03-25
2
527 Views
Last Modified: 2012-05-11
Hi.

I'm using SQL Server 2008 R2 (it's the Dev Ed on my Dev Svr).

I have a DB which is under development.

I use Windows Authentication.

I want to allow all users access to the stored procedures and views for the DB.

What is the simplest way to do this please?

I have the sysadmin role (only because I am the developer on the dev svr - not really a proper admin) and I've manually allowed one other user access to the SPs (ticking the execute option for the SPs for that user). I don't have any views yet.

I know I can do this for each user, but I'm quite happy to simply allow all authenticated users access. The app is both an Excel spreadsheet and a PHP developed web app.

When I add new SPs and views, can these inherit the permissions? Or do I need to add a security setting.

TIA,

Richard.
0
Comment
Question by:RQuadling
2 Comments
 
LVL 4

Accepted Solution

by:
qasim_md earned 500 total points
Comment Utility
You have to generate a script with this SQL and execute it in the SQL window::::

select 'GRANT VIEW DEFINITION ON '+ name +  ' TO [User_Name]' from [Database_name]..sysobjects where type = 'P'
select 'GRANT VIEW DEFINITION ON '+ name +  ' TO [User_Name]' from [Database_name]..sysobjects where type = 'VW'

Example:
GRANT VIEW DEFINITION ON sp_update_LpsPrime_tbl_payments_1000000_rest TO [marketing]

Let me know if it helped ?
0
 
LVL 40

Author Comment

by:RQuadling
Comment Utility
Aha.

So, I can create a DB Role, add the appropriate Active Directories user groups to the role and then use ...


select 'GRANT EXECUTE ON [Database_name].dbo.'+ name +  ' TO [db_ExecuteView]' from [Database_name]..sysobjects where type = 'P' and name like 'RAQ_%'
select 'GRANT SELECT ON [Database_name].dbo.'+ name +  ' TO [db_ExecuteView]' from [Database_name]..sysobjects where type = 'VW' and name like 'RAQ_%'

The sql that the above script outputs runs without issue.

And seems to be OK!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now