diff options
-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> |