2003-02-21 Tim Coleman <tim@timcoleman.com>
[mono.git] / mcs / class / System.Data.OracleClient / System.Data.OracleClient / OraclePermission.cs
1 //
2 // OraclePermission.cs 
3 //
4 // Part of the Mono class libraries at
5 // mcs/class/System.Data.OracleClient/System.Data.OracleClient
6 //
7 // Assembly: System.Data.OracleClient.dll
8 // Namespace: System.Data.OracleClient
9 //
10 // Author: Tim Coleman <tim@timcoleman.com>
11 //
12 // Copyright (C) Tim Coleman, 2003
13 //
14 // Licensed under the MIT/X11 License.
15 //
16
17 using System;
18 using System.Security;
19 using System.Security.Permissions;
20
21 namespace System.Data.OracleClient {
22         [Serializable]
23         public sealed class OraclePermission : CodeAccessPermission, IUnrestrictedPermission
24         {
25                 #region Fields
26
27                 bool allowBlankPassword;
28                 PermissionState state;
29
30                 #endregion // Fields
31
32                 #region Constructors
33
34                 public OraclePermission (PermissionState state)
35                 {
36                         this.state = state;
37                 }
38
39                 #endregion // Constructors
40
41                 #region Properties
42
43                 public bool AllowBlankPassword {
44                         get { return allowBlankPassword; }
45                         set { allowBlankPassword = value; }
46                 }
47
48                 internal PermissionState State {
49                         get { return state; }
50                         set { state = value; }
51                 }
52
53                 #endregion // Properties
54
55                 #region Methods
56
57                 public override IPermission Copy ()
58                 {
59                         OraclePermission copy = (OraclePermission) Activator.CreateInstance (this.GetType ());
60                         copy.AllowBlankPassword = allowBlankPassword;
61                         copy.State = state;
62                         return copy;
63                 }
64
65                 [MonoTODO]
66                 public override void FromXml (SecurityElement securityElement)
67                 {
68                         throw new NotImplementedException ();
69                 }
70
71                 [MonoTODO]
72                 public override IPermission Intersect (IPermission target)
73                 {
74                         if (target != null && !(target is OraclePermission))
75                                 throw new ArgumentException ();
76                         throw new NotImplementedException ();
77                 }
78
79                 [MonoTODO]
80                 public override bool IsSubsetOf (IPermission target)
81                 {
82                         throw new NotImplementedException ();
83                 }
84
85                 public bool IsUnrestricted ()
86                 {
87                         return (State == PermissionState.Unrestricted);
88                 }
89
90                 [MonoTODO]
91                 public override SecurityElement ToXml ()
92                 {
93                         throw new NotImplementedException ();
94                 }
95
96                 [MonoTODO]
97                 public override IPermission Union (IPermission target)
98                 {
99                         if (target != null && !(target is OraclePermission))
100                                 throw new ArgumentException ();
101                         throw new NotImplementedException ();
102                 }
103
104                 #endregion // Methods
105         }
106 }