![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello. I need to grant permissions to specific scalar function in specific database. How Can I deny execution from everyone except 3 specific users / logins? Thanks. |
#3
| |||
| |||
|
|
Hi GRANT SELECT ON some_udf TO username -- Grant permission on a single udf Hello. [quoted text clipped - 3 lines] Thanks. |
#4
| |||
| |||
|
|
1. Is this means that the rest of the users, by default, are denied? |
|
2. Should I grand "Select" or "Execute" permissions? |
|
1. Is this means that the rest of the users, by default, are denied? 2. Should I grand "Select" or "Execute" permissions? Thanks. Uri Dimant wrote: Hi GRANT SELECT ON some_udf TO username -- Grant permission on a single udf Hello. [quoted text clipped - 3 lines] Thanks. |
#5
| |||
| |||
|
|
1. Is this means that the rest of the users, by default, are denied? |
|
2. Should I grand "Select" or "Execute" permissions? |
#6
| |||
| |||
|
|
ampo (u53310@uwe) writes: 1. Is this means that the rest of the users, by default, are denied? Unless they have permission by some other mean, for instance permission on the schema. Also, keep in mind that if the function is called from within a stored procedure with the same owner, it does not matter who is the caller. 2. Should I grand "Select" or "Execute" permissions? Let's see: CREATE FUNCTION testis () RETURNS int AS BEGIN RETURN 2 END go GRANT SELECT ON testis TO public GRANT EXECUTE ON testis TO public go DROP FUNCTION testis Gives: Msg 4606, Level 16, State 1, Line 1 Granted or revoked privilege SELECT is not compatible with object. Looks like you should grant EXECUTE. -- Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se 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/prodinf...ons/books.mspx |
![]() |
| Thread Tools | |
| Display Modes | |
| |