Share via


WMS Publishing Points ACL Authorization Plug-in Properties

You can use the WMS Publishing Points ACL Authorization plug-in to allow or deny read, write, or create access to specific users, servers, or groups. Read access permits a user to open, play, fast forward, or rewind content. Write access permits a user to use a currently existing push publishing point to do live distribution. Create access permits a user to create publishing points on the server for live distribution. This plug-in is useful when you want to set a global restriction on all content on a specific publishing point or server, or when the content for a publishing point is a live stream. For administration information about this plug-in, see Windows Media Services Help.

There are three interfaces that you can use to configure the WMS Publishing Points ACL Authorization plug-in programmatically. The IWMSAccessControlEntry interface exposes the following properties.

Property

Description

AccessMask

Specifies and retrieves an enumeration value indicating the access rights to a publishing point or file system. The access rights enable you to allow or deny read, write, and create access.

Trustee

Retrieves the name of the account or logon session to which the access control entry applies.

The IWMSAccessControlList interface contains a collection of IWMSAccessControlEntry objects and exposes the following methods.

Method

Description

Add

Adds a new IWMSAccessControlEntry object to the IWMSAccessControlList collection.

Remove

Removes an IWMSAccessControlEntry object from the IWMSAccessControlList collection.

You can use the IWMSACLCheckAdmin interface to retrieve an IWMSAccessControlList object from which you can retrieve specific IWMSAccessControlEntry objects and specify access rights. This is illustrated by the following examples.

Visual Basic .NET Example

Imports Microsoft.WindowsMediaServices.Interop 
Imports System.Runtime.InteropServices

Private Sub SetPPACLPluginProps

' Declare variables.
Dim Server As WMSServer
Dim Plugin As IWMSPlugin
Dim ACLCheckAdmin As IWMSACLCheckAdmin
Dim AccessCtrlList As IWMSAccessControlList

Try
    ' Create a new WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlugin object for the
    ' WMS Publishing Points ACL Authorization plug-in.
    Plugin = Server.EventHandlers("WMS Publishing Points ACL Authorization")

    ' Retrieve the administrative interface for the
    ' WMS Publishing Points ACL Authorization plug-in.
    ACLCheckAdmin = Plugin.CustomInterface()

    ' Retrieve the list of access control entries.
    AccessCtrlList = ACLCheckAdmin.AccessControlList

    ' TODO: Use the IWMSAccessControlList collection to retrieve
    ' a specific IWMSAccessControlEntry object and specify access
    ' rights.
Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle exceptions here.
Finally
    ' TODO: Perform clean-up here.
End Try

End Sub  

C# Example

using Microsoft.WindowsMediaServices.Interop; 
using System.Runtime.InteropServices;

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSACLCheckAdmin ACLCheckAdmin;
IWMSAccessControlList AccessCtrlList;

try
{
    // Create a new WMSServer object.
    Server = new WMSServerClass();
    
    // Retrieve the IWMSPlugin object for the
    // WMS Publishing Points ACL Authorization plug-in.
    Plugin = Server.EventHandlers["WMS Publishing Points ACL     Authorization"];
    
    // Retrieve the administrative interface for the
    // WMS Publishing Points ACL Authorization plug-in.
    ACLCheckAdmin = (IWMSACLCheckAdmin)Plugin.CustomInterface;
    
    // Retrieve the list of access control entries.
    AccessCtrlList = ACLCheckAdmin.AccessControlList;
    
    // TODO: Use the IWMSAccessControlList collection to retrieve a
    // specific IWMSAccessControlEntry object and specify access rights.
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception exc)
{
    // TODO: Handle exceptions here.
}
finally
{
    // TODO: Perform clean-up here.
}

C++

#include <windows.h>
#include <atlbase.h>

// To access system plug-in interfaces, the
// type library must be imported as shown.
#import "WMSServerTypeLib.dll" no_namespace named_guids \
                               raw_interfaces_only

// Declare variables and interface pointers.
IWMSServer*             pServer = NULL;
IWMSPlugins*            pPlugins = NULL;
IWMSPlugin*             pPlugin = NULL;
IDispatch*              pDispatch = NULL;
IWMSACLCheckAdmin*      pACLCheckAdmin = NULL;
IWMSAccessControlList*  pAccessCtrlList = NULL;
CComVariant             varIndex;
HRESULT                 hr = S_OK;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to an IWMSPlugins interface
// containing the collection of authorization plug-ins.
hr = pServer->get_EventHandlers(&pPlugins);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPlugin interface for the
// WMS Publishing Points ACL Authorization plug-in.
varIndex = "WMS Publishing Points ACL Authorization";
hr = pPlugins->get_Item(varIndex, &pPlugin);
if (FAILED(hr)) goto EXIT;

// Retrieve an IDispatch pointer to the administration
// interface for the plug-in.
hr = pPlugin->get_CustomInterface(&pDispatch);
if (FAILED(hr)) goto EXIT;

// Call QueryInterface() to retrieve a pointer to the
// IWMSACLCheckAdmin interface.
hr = pDispatch->QueryInterface(IID_IWMSACLCheckAdmin, (void**)&pACLCheckAdmin);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the list of access control entries.
hr = pACLCheckAdmin->get_AccessControlList(&pAccessCtrlList);
if (FAILED(hr)) goto EXIT;

// TODO: Use the IWMSAccessControlList collection to retrieve a
// specific IWMSAccessControlEntry object and specify access rights.

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

See Also

Reference

IWMSAccessControlEntry Interface

IWMSAccessControlEntry Object (C#)

IWMSAccessControlEntry Object (Visual Basic .NET)

IWMSAccessControlList Interface

IWMSAccessControlList Object (C#)

IWMSAccessControlList Object (Visual Basic .NET)

IWMSACLCheckAdmin Interface

IWMSACLCheckAdmin Object (C#)

IWMSACLCheckAdmin Object (Visual Basic .NET)

Concepts

Programming System Plug-in Properties