diff options
author | Oyvind Sean Kinsey <oyvind@kinsey.no> | 2011-09-22 19:44:48 +0200 |
---|---|---|
committer | Oyvind Sean Kinsey <oyvind@kinsey.no> | 2011-09-22 19:44:48 +0200 |
commit | 717075b74215e320be4aa2f9432eef77af31a696 (patch) | |
tree | 7e8f271d89d917b65037358ad83be83beab69344 | |
parent | f16525005555b86151b7a1c741aa29550635108a (diff) | |
download | DotNetOpenAuth-717075b74215e320be4aa2f9432eef77af31a696.zip DotNetOpenAuth-717075b74215e320be4aa2f9432eef77af31a696.tar.gz DotNetOpenAuth-717075b74215e320be4aa2f9432eef77af31a696.tar.bz2 |
Exposed the roles collection so that we can convert this to a different kind of principal if necessary.
-rw-r--r-- | src/DotNetOpenAuth/OAuth/ChannelElements/OAuthPrincipal.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthPrincipal.cs b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthPrincipal.cs index 82ecb0a..3fda483 100644 --- a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthPrincipal.cs +++ b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthPrincipal.cs @@ -2,8 +2,8 @@ // <copyright file="OAuthPrincipal.cs" company="Andrew Arnott"> // Copyright (c) Andrew Arnott. All rights reserved. // </copyright> -//----------------------------------------------------------------------- - +//-----------------------------------------------------------------------
+
namespace DotNetOpenAuth.OAuth.ChannelElements { using System; using System.Collections.Generic; @@ -11,7 +11,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { using System.Diagnostics.Contracts; using System.Linq; using System.Runtime.InteropServices; - using System.Security.Principal; + using System.Security.Principal;
+ using System.Collections.ObjectModel;
/// <summary> /// Represents an OAuth consumer that is impersonating a known user on the system. @@ -61,6 +62,14 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { /// <value>A non-empty string.</value> public string AccessToken { get; private set; } + /// <summary>
+ /// Gets the roles that this principal has as a ReadOnlyCollection.
+ /// </summary> + public ReadOnlyCollection<string> Roles
+ {
+ get { return new ReadOnlyCollection<string> (roles.ToList()); }
+ } + #region IPrincipal Members /// <summary> |