namespace System.Security.Permissions {
-#if NET_2_0
[ComVisible (true)]
-#endif
[Serializable]
public sealed class ReflectionPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
public ReflectionPermissionFlag Flags {
get { return flags; }
set {
- if ((value & ReflectionPermissionFlag.AllFlags) != value) {
+ const ReflectionPermissionFlag all_flags = ReflectionPermissionFlag.AllFlags | ReflectionPermissionFlag.RestrictedMemberAccess;
+
+ if ((value & all_flags) != value) {
string msg = String.Format (Locale.GetText ("Invalid flags {0}"), value);
throw new ArgumentException (msg, "ReflectionPermissionFlag");
}