This topic has not yet been rated - Rate this topic

MessageQueueAccessControlEntry Class

Specifies access rights for a trustee (user, group, or computer) to perform Message Queuing tasks.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)
public class MessageQueueAccessControlEntry : AccessControlEntry

Use the MessageQueueAccessControlEntry class to specify rights to apply to a trustee. These rights include peeking, receiving, or sending messages; viewing or modifying queue properties or permissions; and deleting queues. The MessageQueue class's SetPermissions method provides overloads for passing an instance of this class directly into the method, or adding it to an instance of AccessControlList so that you can add rights for more than one trustee at a time. The new access right is appended to the end of the queue's discretionary access control list (DACL), which identifies the users and groups that can access the queue.

There are some exceptions to this generalization about where the new right is added and its effects. For more information, see System.Messaging.

An overload of the MessageQueueAccessControlEntry constructor allows you specify a AccessControlEntryType member to indicate whether to allow or deny rights to the trustee. The order in which rights are allowed or denied in the resource's DACL affects whether the trustee has the specified rights. For example, if rights have already been granted to the trustee and you later add an entry that denies them, the system finds the granted rights first, so the user is granted rights you might have intended they be denied. You can use two entry types to override this behavior: Set and Revoke. For more information about controlling the way in which access rights are determined, see the AccessControlEntryType enumeration topic.

The MessageQueueAccessControlEntry class is associated with security based on access control lists (ACLs), which you can use to give users access to the Message Queuing system itself. This is different from code access security, which is implemented through the MessageQueuePermission and related classes. Message Queuing code access security defines queue-specific operations or queue access that an application might require which is subject to security control; it does not represent a right for the application to perform these operations or receive access in and of itself. See the topic Code Access Security for more information about code access security.

To set message queue permissions for a trustee, create a new instance of the Trustee class and pass it into an overload of the #ctor constructor. Specify the message queue access rights either by passing an instance of MessageQueueAccessRights into the constructor or by setting the MessageQueueAccessRights property on an existing MessageQueueAccessControlEntry instance.

You can then pass the MessageQueueAccessControlEntry instance directly to the MessageQueue.SetPermissions method, or alternately add the entry to an instance of AccessControlList before calling SetPermissions.

System.Object
  System.Messaging.AccessControlEntry
    System.Messaging.MessageQueueAccessControlEntry
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.