ContentUser ContentUser ContentUser ContentUser Class

Definition

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

public ref class ContentUser
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class ContentUser
type ContentUser = class
Public Class ContentUser
Inheritance
ContentUserContentUserContentUserContentUser
Attributes

Examples

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

WriteStatus("   Reading '" + xrmlFilename + "' permissions.");
try
{
    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;
WriteStatus("   Reading '" & xrmlFilename & "' permissions.")
Try
	Dim sr As StreamReader = File.OpenText(xrmlFile)
	xrmlString = sr.ReadToEnd()
Catch ex As Exception
	MessageBox.Show("ERROR: '" & xrmlFilename &"' open failed." & vbLf & "Exception: " & ex.Message, "XrML File Error", MessageBoxButton.OK, MessageBoxImage.Error)
	Return False
End Try

WriteStatus("   Building UnsignedPublishLicense")
WriteStatus("       from '" & xrmlFilename & "'.")
Dim unsignedLicense As New UnsignedPublishLicense(xrmlString)
Dim author As ContentUser = unsignedLicense.Owner

Remarks

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

Constructors

ContentUser(String, AuthenticationType) ContentUser(String, AuthenticationType) ContentUser(String, AuthenticationType) ContentUser(String, AuthenticationType)

Initializes a new instance of the ContentUser class.

Properties

AnyoneUser AnyoneUser AnyoneUser AnyoneUser

Gets an instance of the "Anyone" ContentUser persona.

AuthenticationType AuthenticationType AuthenticationType AuthenticationType

Gets the AuthenticationType specified to the ContentUser(String, AuthenticationType) constructor.

Name Name Name Name

Gets the user or group name specified to the ContentUser(String, AuthenticationType) constructor.

OwnerUser OwnerUser OwnerUser OwnerUser

Gets an instance of the "Owner" ContentUser persona.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Returns a value that indicates whether this ContentUser is equivalent to another given instance.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Returns a computed hash code based on the user Name and AuthenticationType.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsAuthenticated() IsAuthenticated() IsAuthenticated() IsAuthenticated()

Returns a value that indicates whether the user is currently authenticated.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to