This documentation is archived and is not being maintained.

MessageQueueAccessControlEntry Class

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

For a list of all members of this type, see MessageQueueAccessControlEntry Members.


[Visual Basic]
Public Class MessageQueueAccessControlEntry
   Inherits AccessControlEntry
public class MessageQueueAccessControlEntry : AccessControlEntry
public __gc class MessageQueueAccessControlEntry : public
public class MessageQueueAccessControlEntry extends

Thread Safety

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


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.

Note   There are some exceptions to this generalization about where the new right is added and its effects. See the AccessControlList topic for more information.

An overload of the MessageQueueAccessControlEntry constructor allows you specify an 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 MessageQueueAccessControlEntry 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.


Namespace: System.Messaging

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Messaging (in System.Messaging.dll)

See Also

MessageQueueAccessControlEntry Members | System.Messaging Namespace | MessageQueue.SetPermissions | Trustee | AccessControlList | AccessControlEntryType | MessageQueuePermission