ContentUser Class

Represents a user or user-group for granting access to rights managed content.


Namespace:  System.Security.RightsManagement
Assembly:  WindowsBase (in WindowsBase.dll)

public class ContentUser

The ContentUser type exposes the following members.

Public methodContentUserInitializes a new instance of the ContentUser class.

Public propertyStatic memberAnyoneUserGets an instance of the "Anyone" ContentUser persona.
Public propertyAuthenticationTypeGets the AuthenticationType specified to the ContentUser constructor.
Public propertyNameGets the user or group name specified to the ContentUser constructor.
Public propertyStatic memberOwnerUserGets an instance of the "Owner" ContentUser persona.

Public methodEqualsReturns a value that indicates whether this ContentUser is equivalent to another given instance. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a computed hash code based on the user Name and AuthenticationType. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsAuthenticatedReturns a value that indicates whether the user is currently authenticated.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

As with other System.Security.RightsManagement types, ContentUser is only usable in full trust applications.

The following example shows how to use Owner property to assign a variable of this type.

WriteStatus("   Reading '" + xrmlFilename + "' permissions.");
    StreamReader sr = File.OpenText(xrmlFile);
    xrmlString = sr.ReadToEnd();
catch (Exception ex)
    MessageBox.Show("ERROR: '"+xrmlFilename+"' open failed.\n"+
        "Exception: " + ex.Message, "XrML File Error",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;

WriteStatus("   Building UnsignedPublishLicense");
WriteStatus("       from '" + xrmlFilename + "'.");
UnsignedPublishLicense unsignedLicense =
    new UnsignedPublishLicense(xrmlString);
ContentUser author = unsignedLicense.Owner;

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft