I have deselected the permissions for Send Message on a private queue, yet MessageQueue.CanWrite
never returns false
. I can toggle Receive Message permissions and the CanRead
property responds as expected. Why would the CanWrite
property behave differently?
I have tested this issue with a couple of different AD users and the results are the same.
Is there a different approach to validating whether a specific user account can send a mesage 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;
}
}
}
QueueAccessMode.Send
is requested thatCanWrite
would likely betrue
. (side question: did you toggle the 'Authenticated` check box for this queue) – TinnyCanWrite
becomefalse
when you setQueueAccessMode.Receive
? Because from my review of theMessageQueue
class in ILSpy it seems that only your modes you give reflect those property values. – Tinny