DbDataPermissionAttribute.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // System.Data.Common.DbDataPermissionAttribute.cs
  3. //
  4. // Authors:
  5. // Rodrigo Moya ([email protected])
  6. // Tim Coleman ([email protected])
  7. //
  8. // (C) Ximian, Inc
  9. // Copyright (C) Tim Coleman, 2002
  10. //
  11. using System;
  12. using System.Security.Permissions;
  13. namespace System.Data.Common {
  14. [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
  15. AttributeTargets.Struct | AttributeTargets.Constructor |
  16. AttributeTargets.Method, AllowMultiple=true,
  17. Inherited=false)]
  18. [Serializable]
  19. public abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute
  20. {
  21. #region Fields
  22. SecurityAction securityAction;
  23. bool allowBlankPassword;
  24. #if NET_1_1
  25. KeyRestrictionBehavior keyRestrictionBehavior;
  26. String connectionString;
  27. #endif
  28. #endregion // Fields
  29. #region Constructors
  30. protected DBDataPermissionAttribute (SecurityAction action)
  31. : base (action)
  32. {
  33. securityAction = action;
  34. allowBlankPassword = false;
  35. }
  36. #endregion // Constructors
  37. #region Properties
  38. public bool AllowBlankPassword {
  39. get { return allowBlankPassword; }
  40. set { allowBlankPassword = value; }
  41. }
  42. [MonoTODO]
  43. public string KeyRestrictions {
  44. get {
  45. throw new NotImplementedException ();
  46. }
  47. set {
  48. throw new NotImplementedException ();
  49. }
  50. }
  51. #if NET_1_1
  52. public String ConnectionString {
  53. get { return connectionString; }
  54. set { connectionString = value; }
  55. }
  56. public KeyRestrictionBehavior KeyRestrictionBehavior {
  57. get { return keyRestrictionBehavior; }
  58. set { keyRestrictionBehavior = value; }
  59. }
  60. #endif
  61. #endregion // Properties
  62. #region // Methods
  63. #if NET_2_0
  64. [MonoTODO]
  65. public bool ShouldSerializeConnectionString ()
  66. {
  67. throw new NotImplementedException ();
  68. }
  69. [MonoTODO]
  70. public bool ShouldSerializeKeyRestrictions ()
  71. {
  72. throw new NotImplementedException ();
  73. }
  74. #endif
  75. #endregion // Methods
  76. }
  77. }