Hi,
When I create a message queue programmaticall y, I would like to ensure that the created queue has the permissions to allow the service account the app is running under to access the queue.
When I use SetPermissions on the created queue, how do I create an AccessControlEn try that holds the current app identity?
Regards,
Rob.
When I create a message queue programmaticall y, I would like to ensure that the created queue has the permissions to allow the service account the app is running under to access the queue.
When I use SetPermissions on the created queue, how do I create an AccessControlEn try that holds the current app identity?
Code:
if (!MessageQueue.Exists(name))
{
var queue = MessageQueue.Create(name);
var acl = new AccessControlList();
acl.Add(new AccessControlEntry()
{
EntryType = AccessControlEntryType.Allow,
GenericAccessRights = GenericAccessRights.All,
StandardAccessRights = StandardAccessRights.All,
Trustee = new Trustee("mycurrentappidentity")
});
queue.SetPermissions(acl);
}
Rob.