2003-12-25 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / mcs / class / corlib / System.Security.Principal / WindowsPrincipal.cs
1 //
2 // WindowsPrincipal.cs: Windows IPrincipal implementation
3 //
4 // Author:
5 //      Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
8 //
9
10 using System;
11
12 namespace System.Security.Principal {
13
14         [Serializable]
15         public class WindowsPrincipal : IPrincipal {
16
17                 private WindowsIdentity _identity;
18
19                 public WindowsPrincipal (WindowsIdentity ntIdentity)
20                 {
21                         if (ntIdentity == null)
22                                 throw new ArgumentNullException ("ntIdentity");
23
24                         _identity = ntIdentity;
25                 }
26
27                 // properties
28
29                 public virtual IIdentity Identity {
30                         get { return _identity; }
31                 }
32
33                 // methods
34
35                 [MonoTODO]
36                 public virtual bool IsInRole (int rid) 
37                 {
38                         throw new NotImplementedException ();
39                 }
40
41                 [MonoTODO]
42                 public virtual bool IsInRole (string role)
43                 {
44 #if NET_1_0
45                         // case sensitive (for 1.0)
46 #else
47                         // case insensitive (for 1.1 and later)
48 #endif
49                         throw new NotImplementedException ();
50                 }
51
52                 public virtual bool IsInRole (WindowsBuiltInRole role)
53                 {
54                         return IsInRole ((int)role);
55                 }
56         }
57 }