A GenericPrincipal= currentUser =
safe_cast(Thread::CurrentPrincipal); isAuthorized = currentUser->IsInRole("Clerk");
B WindowsIdentity= currentUser = WindowsIdentity::GetCurrent(); For each (IdentityReference= grp in currentUser->Groups) { NTAccount= grpAccount =
safe_cast(grp->Translate(NTAccount::typeid)); isAuthorized = grpAccount->Value->Equals(
Environment::MachineName + "\\Clerk");
if (isAuthorized) break
;}
C WindowsPrincipal= currentUser =
safe_cast(Thread::CurrentPrincipal);
isAuthorized = currentUser->IsInRole("Clerk");
D WindowsPrincipal= currentUser =
safe_cast(Thread::CurrentPrincipal); isAuthorized = currentUser->IsInRole(
Environment::MachineName);