So here is my current code:
List<string> rowGroups = GetFileGroups((int)row.Cells["document_security_type"].Value);
bool found = false;
System.Security.Principal.WindowsPrincipal p = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent());
foreach (string group in rowGroups)
{
if (p.IsInRole(group))
{
found = true;
break;
}
}
This was done a couple of months ago by someone, and it’s hard for me to understand why it doesn’t work. Recently, the company has moved from one domain name to another. So I was curious which domain controller the p.IsInRole ("String") function would use. I assume that it will use DC by default regardless of the computer used.
It is odd that the computers in the office where it works can be on two separate domains. In the object List<string>, I have both domains. therefore, it may contain elements such as "domainA \ groupA", "domainA \ userB", domainB \ groupC "and / or" domainB \ userD ".
, , IsInRole true. , , domainA\Domain .
? , . 100%, ...