Hello
I am not sure what the mean of "subcategories" but you can use following sample codes for role-based security;
code block for is in role checking;
public bool IsInRole(string role)
{
bool hasRole = System.Threading.Thread.CurrentPrincipal.IsInRole(role);
return hasRole;
}
if your application running with a windows domain account role equal to user group's name.
A sample for securing a method;
public void DoSecureMethod()
{
bool hasRole1 = IsInRole("Role1");
bool hasRole2 = IsInRole("Role2");
if (hasRole1 & hasRole2)
{
}
else
{
throw new ApplicationException("Your account has not enough right for to doing something...");
}
}
other alternate is using declerative security;
[PrincipalPermission(SecurityAction.Demand, Role = "Role1")]
public void DoAnotherSecureMethod()
{
}
Regards,
Tarik K.