I have disabled permissions to send messages in the private queue, but MessageQueue.CanWrite never returns false . I can switch the permissions to receive messages, and the CanRead property responds as expected. Why CanWrite property CanWrite differently?
I tested this problem with several different AD users and the results were the same.
Is there a different approach to checking if a particular user account can send a message to a specific remote private queue?
public class SendBehavior : IMsmqRuleBehavior { public bool Validate(string queuePath) { using (var queue = new MessageQueue(queuePath, QueueAccessMode.Send)) { return queue.CanWrite; } } } public class ReceiveBehavior : IMsmqRuleBehavior { public bool Validate(string queuePath) { using (var queue = new MessageQueue(queuePath, QueueAccessMode.Receive)) { return queue.CanRead; } } }
source share