Creates a principal object for a user.

Namespace:  EPiServer.Security
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
public static IPrincipal CreatePrincipal(
	string username
)

Parameters

username
Type: System..::.String
The name of the user.

Return Value

An IPrincipal with the associated roles initialized.

Remarks

The Roles system must be enabled in order for this method to work. Note that there is no check that the passed username exists in the current Membership provider, a non-existing username will return a principal object with the given name and an empty role list.

See Also