RolePrincipal.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //
  2. // System.Web.Security.RolePrincipal
  3. //
  4. // Authors:
  5. // Ben Maurer ([email protected])
  6. // Sebastien Pouliot <[email protected]>
  7. //
  8. // (C) 2003 Ben Maurer
  9. // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. #if NET_2_0
  31. using System.Security.Permissions;
  32. using System.Security.Principal;
  33. namespace System.Web.Security {
  34. [Serializable]
  35. [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
  36. public sealed class RolePrincipal : IPrincipal {
  37. private IIdentity identity;
  38. private string providerName;
  39. private bool listChanged;
  40. private bool listCached;
  41. public RolePrincipal (IIdentity identity)
  42. {
  43. if (identity == null)
  44. throw new ArgumentNullException ("identity");
  45. this.identity = identity;
  46. }
  47. [MonoTODO]
  48. public RolePrincipal (IIdentity identity, string encryptedTicket)
  49. : this (identity)
  50. {
  51. throw new NotImplementedException ();
  52. }
  53. [MonoTODO]
  54. public RolePrincipal (string providerName, IIdentity identity)
  55. : this (identity)
  56. {
  57. if (providerName == null)
  58. throw new ArgumentNullException ("providerName");
  59. throw new NotImplementedException ();
  60. }
  61. [MonoTODO]
  62. public RolePrincipal (string providerName, IIdentity identity, string encryptedTicket)
  63. : this (identity)
  64. {
  65. if (providerName == null)
  66. throw new ArgumentNullException ("providerName");
  67. throw new NotImplementedException ();
  68. }
  69. [MonoTODO]
  70. public string [] GetRoles ()
  71. {
  72. throw new NotImplementedException ();
  73. }
  74. [MonoTODO]
  75. public bool IsInRole (string role)
  76. {
  77. throw new NotImplementedException ();
  78. }
  79. [MonoTODO]
  80. public string ToEncryptedTicket ()
  81. {
  82. throw new NotImplementedException ();
  83. }
  84. public bool CachedListChanged {
  85. get { return listChanged; }
  86. }
  87. [MonoTODO]
  88. public string CookiePath {
  89. get { throw new NotImplementedException (); }
  90. }
  91. [MonoTODO]
  92. public bool Expired {
  93. get { throw new NotImplementedException (); }
  94. }
  95. [MonoTODO]
  96. public DateTime ExpireDate {
  97. get { throw new NotImplementedException (); }
  98. }
  99. public IIdentity Identity {
  100. get { return identity; }
  101. }
  102. public bool IsRoleListCached {
  103. get { return listCached; }
  104. }
  105. [MonoTODO]
  106. public DateTime IssueDate {
  107. get { throw new NotImplementedException (); }
  108. }
  109. public string ProviderName {
  110. get { return providerName; }
  111. }
  112. [MonoTODO]
  113. public int Version {
  114. get { throw new NotImplementedException (); }
  115. }
  116. public void SetDirty ()
  117. {
  118. listChanged = true;
  119. listCached = false;
  120. }
  121. }
  122. }
  123. #endif