Просмотр исходного кода

Add a bunch of new classes to reduce warnings from Mint

svn path=/trunk/mcs/; revision=1202
Miguel de Icaza 24 лет назад
Родитель
Сommit
8edceaee21

+ 45 - 0
mcs/class/corlib/System.Security.Principal/GenericIdentity.cs

@@ -0,0 +1,45 @@
+//
+// System.Security.Principal.GenericIdentity.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	public class GenericIdentity : IIdentity {
+		string user_name;
+		string authentication_type;
+		
+		public GenericIdentity (string user_name, string authentication_type)
+		{
+			this.user_name = user_name;
+			this.authentication_type = authentication_type;
+		}
+
+		public GenericIdentity (string name)
+		{
+			this.user_name = user_name;
+		}
+
+		public string AuthenticationType {
+			get {
+				return authentication_type;
+			}
+		}
+
+		public string Name {
+			get {
+				return user_name;
+			}
+		}
+
+		public bool IsAuthenticated {
+			get {
+				return true;
+			}
+		}
+	}
+}

+ 37 - 0
mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs

@@ -0,0 +1,37 @@
+//
+// System.Security.Principal.GenericPrincipal.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	public class GenericPrincipal : IPrincipal {
+		IIdentity identity;
+		string [] roles;
+		
+		public GenericPrincipal (IIdentity identity, string [] roles)
+		{
+			this.identity = identity;
+			this.roles = roles;
+		}
+
+		public IIdentity Identity {
+			get {
+				return identity;
+			}
+		}
+
+		public bool IsInRole (string role)
+		{
+			foreach (string r in roles)
+				if (role == r)
+					return true;
+
+			return false;
+		}
+	}
+}

+ 26 - 0
mcs/class/corlib/System.Security.Principal/IIdentity.cs

@@ -0,0 +1,26 @@
+//
+// System.Security.Principal.IIdentity.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	public interface IIdentity {
+
+		string AuthenticationType {
+			get;
+		}
+
+		bool IsAuthenticated {
+			get;
+		}
+
+		string Name {
+			get;
+		}
+	}
+}

+ 20 - 0
mcs/class/corlib/System.Security.Principal/IPrincipal.cs

@@ -0,0 +1,20 @@
+//
+// System.Security.Principal.IPrincipal.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	public interface IPrincipal {
+
+		IIdentity Identity {
+			get;
+		}
+
+		bool IsInRole (string role);
+	}
+}

+ 17 - 0
mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs

@@ -0,0 +1,17 @@
+//
+// System.Security.Principal.PrincipalPolicy.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	enum PrincipalPolicy {
+		UnauthenticatedPrincipal,
+		NoPrincipal,
+		WindowsPrincipal
+	}
+}

+ 18 - 0
mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs

@@ -0,0 +1,18 @@
+//
+// System.Security.Principal.WindowsAccountType.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	enum WindowsAccountType {
+		Normal,
+		Guest,
+		System,
+		Anonymous
+	}
+}

+ 23 - 0
mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs

@@ -0,0 +1,23 @@
+//
+// System.Security.Principal.WindowsBuiltInRole.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System.Security.Principal {
+
+	enum WindowsBuiltInRole {
+		Administrator = 544,
+		User = 545,
+		Guest = 546,
+		PowerUser = 547,
+		AccountOperator = 548,
+		SystemOperator = 549,
+		PrintOperator = 550,
+		BackupOperator = 551,
+		Replicator = 552,
+	}
+}