Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -30,20 +30,14 @@
using System.Runtime.InteropServices;
using System.Collections.Generic;
#if NET_4_5
using System.Security.Claims;
#endif
namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
public class GenericIdentity :
#if NET_4_5
ClaimsIdentity
#else
IIdentity
#endif
{
// field names are serialization compatible with .net
@@ -61,9 +55,7 @@ namespace System.Security.Principal {
m_name = name;
m_type = type;
#if NET_4_5
AddDefaultClaim (name);
#endif
}
public GenericIdentity (string name)
@@ -71,52 +63,36 @@ namespace System.Security.Principal {
{
}
#if NET_4_5
protected GenericIdentity (GenericIdentity identity)
: base (identity)
{
}
#endif
#if NET_4_5
override
#else
virtual
#endif
public string AuthenticationType {
get {
return m_type;
}
}
#if NET_4_5
override
#else
virtual
#endif
public string Name {
get {
return m_name;
}
}
#if NET_4_5
override
#else
virtual
#endif
public bool IsAuthenticated {
get {
return (m_name.Length > 0);
}
}
#if NET_4_5
public override IEnumerable<Claim> Claims {
get {
return base.Claims;
}
}
#endif
}
}

View File

@@ -29,20 +29,14 @@
//
using System.Runtime.InteropServices;
#if NET_4_5
using System.Security.Claims;
#endif
namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
public class GenericPrincipal :
#if NET_4_5
ClaimsPrincipal
#else
IPrincipal
#endif
{
// field names are serialization compatible with .net
@@ -67,20 +61,12 @@ namespace System.Security.Principal {
get { return m_roles; }
}
#if NET_4_5
override
#else
virtual
#endif
public IIdentity Identity {
get { return m_identity; }
}
#if NET_4_5
override
#else
virtual
#endif
public bool IsInRole (string role)
{
if (m_roles == null)

View File

@@ -39,9 +39,7 @@ namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
public class WindowsIdentity :
#if NET_4_5
System.Security.Claims.ClaimsIdentity,
#endif
IIdentity, IDeserializationCallback, ISerializable, IDisposable {
private IntPtr _token;
private string _type;
@@ -52,10 +50,8 @@ namespace System.Security.Principal {
static private IntPtr invalidWindows = IntPtr.Zero;
#if NET_4_5
[NonSerialized]
public new const string DefaultIssuer = "AD AUTHORITY";
#endif
[SecurityPermission (SecurityAction.Demand, ControlPrincipal=true)]
public WindowsIdentity (IntPtr userToken)
@@ -177,9 +173,7 @@ namespace System.Security.Principal {
}
// properties
#if NET_4_5
sealed override
#endif
public string AuthenticationType {
get { return _type; }
}
@@ -189,11 +183,7 @@ namespace System.Security.Principal {
get { return (_account == WindowsAccountType.Anonymous); }
}
#if NET_4_5
override
#else
virtual
#endif
public bool IsAuthenticated
{
get { return _authenticated; }
@@ -209,11 +199,7 @@ namespace System.Security.Principal {
get { return (_account == WindowsAccountType.System); }
}
#if NET_4_5
override
#else
virtual
#endif
public string Name
{
get {

View File

@@ -30,20 +30,14 @@
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if NET_4_5
using System.Security.Claims;
#endif
namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
public class WindowsPrincipal :
#if NET_4_5
ClaimsPrincipal
#else
IPrincipal
#endif
{
private WindowsIdentity _identity;
// http://groups.google.ca/groups?q=WindowsPrincipal+m_roles&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OghXf4OgCHA.4228%40tkmsftngp08&rnum=4
@@ -61,11 +55,7 @@ namespace System.Security.Principal {
}
// properties
#if NET_4_5
override
#else
virtual
#endif
public IIdentity Identity {
get { return _identity; }
}
@@ -114,11 +104,7 @@ namespace System.Security.Principal {
}
}
#if NET_4_5
override
#else
virtual
#endif
public bool IsInRole (string role)
{
if (role == null)