public override bool IsDefinitionAllowed(string configPath, ConfigurationAllowDefinition allowDefinition,
ConfigurationAllowExeDefinition allowExeDefinition)
{
string allowedConfigPath;
switch (allowExeDefinition)
{
case ConfigurationAllowExeDefinition.MachineOnly:
allowedConfigPath = MachineConfigPath;
break;
case ConfigurationAllowExeDefinition.MachineToApplication:
allowedConfigPath = ExeConfigPath;
break;
case ConfigurationAllowExeDefinition.MachineToRoamingUser:
allowedConfigPath = RoamingUserConfigPath;
break;
// MachineToLocalUser does not current have any definition restrictions
case ConfigurationAllowExeDefinition.MachineToLocalUser:
return(true);
default:
// If we have extended ConfigurationAllowExeDefinition
// make sure to update this switch accordingly
throw ExceptionUtil.UnexpectedError("ClientConfigurationHost::IsDefinitionAllowed");
}
return(configPath.Length <= allowedConfigPath.Length);
}