I have a WCF service binding with netTcp with over 100 methods, I would like to secure all the methods based on a Windows User Group.
I know you can put the attribute [PrincipalPermission(SecurityAction.Demand, Role = "MyWindowsUserGroup")] before each method.
Do I need to do this individually for every single method or is there a way to have every method in the service secured with this same user group by default?
You can add
PrincipalPermissionat class level as well as method.You can also define multiple instances of it, if you wish to have multiple types of permissions.