MessageQueue.SetPermissions Method (String, MessageQueueAccessRights)
Gives a computer, group, or user the specified access rights.
Assembly: System.Messaging (in System.Messaging.dll)
Use this overload to grant specified rights to an individual user. The user can be any valid trustee, which includes individual users, groups of users, or a computer. If the user is an individual, use the format DOMAIN\user for the user parameter. You can specify "." for the user parameter to indicate the local computer.
The permissions you assign throughadd rights to the existing list. By default, the creator of a public or private queue has full control, and the domain group Everyone has permission to get queue properties, get permissions, and write to the queue. When you call , the user and permissions information is appended to the bottom of the existing list.
The system examines each AccessControlEntry in sequence until one of the following events occurs:
An access-denied AccessControlEntry explicitly denies any of the requested access rights to one of the trustees listed in the thread's access token.
One or more access-allowed AccessControlEntry items for trustees listed in the thread's access token explicitly grant all the requested access rights.
All AccessControlEntry items have been checked and there is still at least one requested access right that has not been explicitly allowed, in which case, access is implicitly denied.
The rights to a queue, specified in the rights parameter, can be any combination of the following:
Receive Journal Message
Get Queue Properties
Set Queue Properties
Take Queue Ownership
The MessageQueueAccessRights enumeration represents a set of bit flags that you can combine using the bitwise operator OR to build the rights parameter.
With this overload, you can only grant permissions; you cannot revoke or deny them. You must use a different overload to explicitly grant any AccessControlEntryType other than Allow.
The following table shows whether this method is available in various Workgroup modes.
Local computer and direct format name
Remote computer and direct format name
The following code example demonstrates the use of.
Available since 1.1