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 2005 Forums
 .NET Inside SQL Server (2005)
 Deny CRUD permissions to execute stored procedure

Author  Topic 

sjvc
Starting Member

1 Post

Posted - 2009-03-04 : 04:52:55
Hello, sorry for my possible bad english (I'm from Spain)

I'm executing stored procedures with a function that does that:

SqlDatabase db = new SqlDatabase(connString);
DbCommand dbCommand = db.GetStoredProcCommand(storedProc);
db.ExecuteNonQuery(dbCommand);

It's possible to tell to DBCommand object (or another object) that I want to execute the stored procedure denying permissions to SELECT, UPDATE AND/OR INSERT ?
If not, it's any way to set permissions in a connection scope?

I know I can set permissions (update, insert, select...) for a user, but I need to do only for a connection.

Anybody can help me?

Edited:
My stored procedures do SELECT, INSERT, UPDATE AND DELETE. For example, in my app, to manage a table, I've a stored procedure that do a SELECT (to view registers in my app), another stored procedure that do INSERT (to insert registers from my app), etc...

All procedures are executed by the function I posted before. I want to add to my app user permissions. In my app will be administrators ,who can do INSERT, SELECT, DELETE AND UPDATE, but there will be guests too, that can't INSERT, SELECT OR UPDATE. And can be another user than can only SELECT AND DELETE for example.

I want to do this control at connection level without create a database user for each app user.
   

- Advertisement -