Re: How to determine if a user has a permission programmatically?
- From: Sue Hoegemeier <Sue_H@xxxxxxxxxxxxx>
- Date: Mon, 11 Dec 2006 19:09:25 -0700
In SQL Server 2005, you can use the has_perms_by_name
function to check the current users effective permissions on
securable.
http://msdn2.microsoft.com/en-us/library/ms189802.aspx
-Sue
On Mon, 11 Dec 2006 15:36:43 -0800, "Alek"
<alekDOTdavisATintelDOTcom> wrote:
Hi,
I need to determine in advance if a user logged on to SQL Server 2005 can
execute certain privileged stored procedures and statements (such as
sp_addrolemember and ALTER LOGIN). To do this, I though I would need to
determine programmatically if a user has specific permissions (ALTER ANY
LOGIN, ALTER ANY CREDENTIAL, CONTROL SERVER, ALTER ANY USER, CREATE ROLE,
ALTER ANY ROLE).
Is there a way to perform this check programmatically via T-SQL? If this can
be done programmatically, is there a way to determine if a permission is
implied implicitly if it is not set up explicitly (e.g. via a group the user
belongs to, such as BUILTIN\Administrators)? Is there a better approach to
make the check?
Thanks,
Alek
.
- Follow-Ups:
- References:
- Prev by Date: Re: How to determine if a user has a permission programmatically?
- Next by Date: Re: Deny Create Database in SQL Server 2000
- Previous by thread: Re: How to determine if a user has a permission programmatically?
- Next by thread: Re: How to determine if a user has a permission programmatically?
- Index(es):
Relevant Pages
|