I have a unique quandary.
I'm developing a class that will test the Users Account Permission, I've covered most basis. But the one I'm mostly concerned with is testing against Null
or a SID
.
The reason I'm concerned is:
if(user != null)
{
role.IsInRole(WindowsBuiltInRole.Administrator);
}
Obviously a simple implementation to demonstrate, but will the WindowsBuiltInRole
check strictly based on the individual machine or against the Domain? If the users Domain account is indeed Administrator, will it successfully test?
Or would the better way to test against the five or six Domain SID
Tokens? Will other User Accounts such as the Network Service Account will it manipulate the same way? What would be the best way to ensure the authenticity of the token value.
Any input would be terrific.