Skip to content

Commit

Permalink
Adventure Works Sample / Test Bed
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhinnen committed Jun 4, 2010
1 parent 34e7f70 commit 9c09812
Show file tree
Hide file tree
Showing 3,004 changed files with 1,349,706 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -0,0 +1,115 @@

using System;
using System.Collections.Generic;
using System.Data;
using System.Security.Principal;

namespace Nettiers.AdventureWorks.Contracts
{
/// <summary>
/// This class is used to extend the Thread.CurrentPrincipal object and add
/// our own custom properties and methods.
/// </summary>
public class ExtendedPrincipal : IPrincipal
{
#region Fields

private IIdentity _identity;
private IUser _user;
private string _userName;

#endregion Fields

#region Constructors

/// <summary>
/// Extended Principal Constructor
/// </summary>
public ExtendedPrincipal(IIdentity identity)
{
_identity = identity;
_userName = identity.Name;
}

#endregion Constructors

#region IPrincipal Members

/// <summary>
/// Identity
/// </summary>
/// <returns>IIdentity</returns>
public IIdentity Identity
{
get { return _identity; }
}

/// <summary>
/// IsInRole
/// </summary>
/// <param name="RoleGuid">Role Guid</param>
/// <returns>bool</returns>
public bool IsInRole(Guid RoleGuid)
{
return false;
}

/// <summary>
/// IsInRole
/// </summary>
/// <param name="roleGuid">role Guid</param>
/// <returns>bool</returns>
public bool IsInRole(string roleGuid)
{
return false;
}

/// <summary>
/// CanPerformCommand
/// </summary>
/// <param name="CommandGuid">Command Guid</param>
/// <returns>bool</returns>
public bool CanPerformCommand(Guid CommandGuid)
{
return CanPerformCommand(CommandGuid.ToString());
}

/// <summary>
/// CanPerformCommand
/// </summary>
/// <param name="CommandGuid">Command Guid</param>
/// <returns>bool</returns>
public bool CanPerformCommand(string CommandGuid)
{
return false;
}

#endregion IPrincipal Members

#region Public Properties

/// <summary>
/// Username
/// </summary>
public string UserName
{
get { return _userName; }
set { _userName = value; }
}

/// <summary>
/// UserDetail
/// </summary>
public IUser UserDetail
{
get { return _user; }
set { _user = value; }
}

#endregion Public Properties

#region Public Methods

#endregion Public Methods
}
}
@@ -0,0 +1,24 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nettiers.AdventureWorks.Contracts
{
/// <summary>
/// IUser interface.
/// </summary>
public interface IUser
{
/// <summary>
/// UserId
/// </summary>
int? UserID { get; set; }

/// <summary>
/// Username
/// </summary>
string UserName { get; set; }
}
}

0 comments on commit 9c09812

Please sign in to comment.