GSF.Security.SecurityProviderUtility.IsResourceSecurable C# (CSharp) Method

IsResourceSecurable() public static method

Determines if the specified resource is to be secured based on settings in the config file.
public static IsResourceSecurable ( string resource ) : bool
resource string Name of the resource to be checked.
return bool
        public static bool IsResourceSecurable(string resource)
        {
            // Check if resource is excluded explicitly.
            foreach (string exclusion in s_excludedResources)
            {
                if (IsRegexMatch(exclusion, resource))
                    return false;
            }

            // Check if resource is included explicitly.
            foreach (KeyValuePair<string, string> inclusion in s_includedResources)
            {
                foreach (string item in inclusion.Key.Split(','))
                {
                    if (IsRegexMatch(item.Trim(), resource))
                        return true;
                }
            }

            return false;
        }