The Labs \ Source Viewer \ SSCLI \ System.Security.Permissions \ BuiltInPermissionIndex

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. // IBuiltInPermission.cs
  16. //
  17. namespace System.Security.Permissions
  18. {
  19.     internal interface IBuiltInPermission
  20.     {
  21.         int GetTokenIndex();
  22.     }
  23.    
  24.     static internal class BuiltInPermissionIndex
  25.     {
  26.         internal const int NUM_BUILTIN_UNRESTRICTED = 10;
  27.         internal const int NUM_BUILTIN_NORMAL = 7;
  28.        
  29.         // Unrestricted permissions
  30.        
  31.         internal const int EnvironmentPermissionIndex = 0;
  32.         internal const int FileDialogPermissionIndex = 1;
  33.         internal const int FileIOPermissionIndex = 2;
  34.         internal const int IsolatedStorageFilePermissionIndex = 3;
  35.         internal const int ReflectionPermissionIndex = 4;
  36.         internal const int SecurityPermissionIndex = 6;
  37.         internal const int UIPermissionIndex = 7;
  38.         internal const int PrincipalPermissionIndex = 8;
  39.         internal const int HostProtectionPermissionIndex = 9;
  40.        
  41.         // Normal permissions
  42.         internal const int SiteIdentityPermissionIndex = 1 + NUM_BUILTIN_UNRESTRICTED;
  43.         internal const int StrongNameIdentityPermissionIndex = 2 + NUM_BUILTIN_UNRESTRICTED;
  44.         internal const int UrlIdentityPermissionIndex = 3 + NUM_BUILTIN_UNRESTRICTED;
  45.         internal const int ZoneIdentityPermissionIndex = 4 + NUM_BUILTIN_UNRESTRICTED;
  46.         internal const int GacIdentityPermissionIndex = 5 + NUM_BUILTIN_UNRESTRICTED;
  47.     }
  48.    
  49.     [Serializable()]
  50.     internal enum BuiltInPermissionFlag
  51.     {
  52.         // Unrestricted permissions
  53.        
  54.         EnvironmentPermission = 1,
  55.         FileDialogPermission = 2,
  56.         FileIOPermission = 4,
  57.         IsolatedStorageFilePermission = 8,
  58.         ReflectionPermission = 16,
  59.         SecurityPermission = 64,
  60.         UIPermission = 128,
  61.         PrincipalPermission = 256,
  62.        
  63.         // Normal permissions
  64.         SiteIdentityPermission = 1024,
  65.         StrongNameIdentityPermission = 2048,
  66.         UrlIdentityPermission = 4096,
  67.         ZoneIdentityPermission = 8192
  68.     }
  69. }

Developer Fusion