Reputation: 13415
I want to block functionality of my client application if user is not admin. But the problem is how to check in program that login and password was admin's?
Upvotes: 0
Views: 607
Reputation: 6073
SELECT IS_SRVROLEMEMBER('sysadmin', 'YourLogin')
or Run the following stored procedure which will give you all the permissions associated with any user.
sp_helprotect @username = 'guest'
Upvotes: 0
Reputation:
In ASP.Net you will use Page.User.IsInRole("RoleName") or in Windows you can use System.Threading.Thread.CurrentPrincipal.IsInRole("RoleName")
Upvotes: 0
Reputation: 6947
I'm assuming two things:
db_owner
. (Sorry, I don't have SQL Server in front of me and don't remember all the role names off the top of my head, so I'm pulling one that is close enough out of the MSDN documentation page example.)If these assumptions hold, then it looks like IS_MEMBER
will work.
Upvotes: 1