2
0

DbDataPermissionAttribute.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method)]
  15. [Serializable]
  16. public abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute
  17. {
  18. #region Fields
  19. SecurityAction securityAction;
  20. bool allowBlankPassword;
  21. #if NET_1_1
  22. KeyRestrictionBehavior keyRestrictionBehavior;
  23. String connectionString;
  24. #endif
  25. #endregion // Fields
  26. #region Constructors
  27. protected DBDataPermissionAttribute (SecurityAction action)
  28. : base (action)
  29. {
  30. securityAction = action;
  31. allowBlankPassword = false;
  32. }
  33. #endregion // Constructors
  34. #region Properties
  35. public bool AllowBlankPassword {
  36. get { return allowBlankPassword; }
  37. set { allowBlankPassword = value; }
  38. }
  39. [MonoTODO]
  40. public string KeyRestrictions {
  41. get {
  42. throw new NotImplementedException ();
  43. }
  44. set {
  45. throw new NotImplementedException ();
  46. }
  47. }
  48. #if NET_1_1
  49. public String ConnectionString {
  50. get { return connectionString; }
  51. set { connectionString = value; }
  52. }
  53. public KeyRestrictionBehavior KeyRestrictionBehavior {
  54. get { return keyRestrictionBehavior; }
  55. set { keyRestrictionBehavior = value; }
  56. }
  57. #endif
  58. #endregion // Properties
  59. #region // Methods
  60. #if NET_2_0
  61. [MonoTODO]
  62. public bool ShouldSerializeConnectionString ()
  63. {
  64. throw new NotImplementedException ();
  65. }
  66. [MonoTODO]
  67. public bool ShouldSerializeKeyRestrictions ()
  68. {
  69. throw new NotImplementedException ();
  70. }
  71. #endif
  72. #endregion // Methods
  73. }
  74. }