Maybe
Given
public class Permissions
{
public const string AccessHomePage = "AccessHomePage";
public const string AccessAdminPage = "AccessAdminPage";
}
Example
private static IEnumerable<string> GetConstants<T>()
=> typeof(T).GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)
.Where(x => x.FieldType == typeof(string) && x.IsLiteral && !x.IsInitOnly)
.Select(x => x.GetValue(null) as string);
Usage
foreach (var item in GetConstants<Permissions>())
Console.WriteLine(item);
Output
AccessHomePage
AccessAdminPage
Add Pepper and Salt to taste
Explanation
BindingFlags.Public
Specifies that public members are to be included in the search.
BindingFlags.Static
Specifies that static members are to be included in the search.
BindingFlags.FlattenHierarchy
Specifies that public and protected static members up the hierarchy
should be returned. Private static members in inherited classes are
not returned. Static members include fields, methods, events, and
properties. Nested types are not returned.
FieldInfo.IsInitOnly Property
Gets a value indicating whether the field can only be set in the body
of the constructor.
FieldInfo.IsLiteral Property
Gets a value indicating whether the value is written at compile time
and cannot be changed.