Редагувати

Поділитися через


MessageQueueAccessControlEntry Class

Definition

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

public ref class MessageQueueAccessControlEntry : System::Messaging::AccessControlEntry
public class MessageQueueAccessControlEntry : System.Messaging.AccessControlEntry
type MessageQueueAccessControlEntry = class
    inherit AccessControlEntry
Public Class MessageQueueAccessControlEntry
Inherits AccessControlEntry
Inheritance
MessageQueueAccessControlEntry

Remarks

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 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.

Constructors

MessageQueueAccessControlEntry(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.

MessageQueueAccessControlEntry(Trustee, MessageQueueAccessRights)

Initializes a new instance of the MessageQueueAccessControlEntry class, granting the specified Message Queuing access rights to the specified trustee.

Properties

CustomAccessRights

Gets or sets custom access rights.

(Inherited from AccessControlEntry)
EntryType

Gets or sets a value that indicates how the access rights apply to the trustee.

(Inherited from AccessControlEntry)
GenericAccessRights

Gets 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)
MessageQueueAccessRights

Gets or sets the set of Message Queuing-specific rights to apply to the trustee.

StandardAccessRights

Gets or sets a set of standard access rights that correspond to operations common to most types of securable objects.

(Inherited from AccessControlEntry)
Trustee

Gets or sets the user, group, domain, or alias to which you are assigning access rights.

(Inherited from AccessControlEntry)

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
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

See also