Redigera

Dela via


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
public class ContentUser
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type ContentUser = class
type ContentUser = class
Public Class ContentUser
Inheritance
ContentUser
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)

Initializes a new instance of the ContentUser class.

Properties

AnyoneUser

Gets an instance of the "Anyone" ContentUser persona.

AuthenticationType

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

Name

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

OwnerUser

Gets an instance of the "Owner" ContentUser persona.

Methods

Equals(Object)

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

GetHashCode()

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

GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsAuthenticated()

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

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to