コード例 #1
0
        public override void Execute(string user)
        {
            // will create the queues if they are not already there
            messageLoggingModule.Init(transport, null);
            var queuePath = MsmqUtil.GetQueuePath(new Endpoint
            {
                Uri = messageLoggingModule.LogQueue
            }).QueuePath;

            using (var queue = new MessageQueue(queuePath))
            {
                GrantPermissions(queue, user);
            }
        }
コード例 #2
0
        public void Execute(string user)
        {
            // will create the queues if they are not already there
            messageLoggingModule.Init(transport, null);
            var queuePath = MsmqUtil.GetQueuePath(new Endpoint
            {
                Uri = messageLoggingModule.LogQueue
            }).QueuePath;

            using (var queue = new MessageQueue(queuePath))
            {
                queue.SetPermissions(user,
                                     MessageQueueAccessRights.DeleteMessage |
                                     MessageQueueAccessRights.DeleteJournalMessage |
                                     MessageQueueAccessRights.GenericRead |
                                     MessageQueueAccessRights.GenericWrite |
                                     MessageQueueAccessRights.GetQueuePermissions |
                                     MessageQueueAccessRights.PeekMessage |
                                     MessageQueueAccessRights.ReceiveJournalMessage |
                                     MessageQueueAccessRights.ReceiveMessage |
                                     MessageQueueAccessRights.WriteMessage,
                                     AccessControlEntryType.Allow);
            }
        }