question

lakmal82 avatar image
lakmal82 asked

Deny on role arnt worling

Hi I have an application which uses the windows authentication to connect to the sql server database. However now I want to restrict rights from a table. Also i'm expecting to add some more SQL users to the application such ass IIS users to Sql server with same rights there for instead of denying the rights the user i followed below I created new role and add database user to the new role Deny the rights from the newly created role and add users to that new role. However still i can connect from my windows user and access the table Below is what i tried CREATE ROLE role1 AUTHORIZATION dbo ; GO sp_addrolemember @membername = 'DEVSRV\sqladmin' ,@rolename = 'role1' GO deny select,insert,update on appconfig to role1 deny select,insert,update on appconfig to public
sql databaserolesdenied
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Kev Riley avatar image
Kev Riley answered
is your windows login also a member of sysadmin? This will 'win' over any roles you add
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lakmal82 avatar image lakmal82 commented ·
Thanks Kev that's the reason. Nice to know that .
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.