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.


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

public class MessageQueueAccessControlEntry : AccessControlEntry

The MessageQueueAccessControlEntry type exposes the following members.

Public methodMessageQueueAccessControlEntry(Trustee, MessageQueueAccessRights)Initializes a new instance of the MessageQueueAccessControlEntry class, granting the specified Message Queuing access rights to the specified trustee.
Public methodMessageQueueAccessControlEntry(Trustee, MessageQueueAccessRights, AccessControlEntryType)Initializes a new instance of the MessageQueueAccessControlEntry class, with the specified trustee and Message Queuing access rights. The type of access (such as Allow or Deny) is defined by the entry type you pass in.

Protected propertyCustomAccessRightsGets or sets custom access rights. (Inherited from AccessControlEntry.)
Public propertyEntryTypeGets or sets a value that indicates how the access rights apply to the trustee. (Inherited from AccessControlEntry.)
Public propertyGenericAccessRightsGets or sets a set of common access rights that map to both standard and object-specific access rights for reading, writing, and executing. (Inherited from AccessControlEntry.)
Public propertyMessageQueueAccessRightsGets or sets the set of Message Queuing-specific rights to apply to the trustee.
Public propertyStandardAccessRightsGets or sets a set of standard access rights that correspond to operations common to most types of securable objects. (Inherited from AccessControlEntry.)
Public propertyTrusteeGets or sets the user, group, domain, or alias to which you are assigning access rights. (Inherited from AccessControlEntry.)

Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

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 [<topic://cpconcodeaccesssecurity>] 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.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

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