public override void Context()
            {
                base.Context();
                RemoveLocalQueueIfExistsAndCreate(address.LocalName);

                task = new LocalMsmqGrantReadTask(address, user);
            }
Esempio n. 2
0
        public void Execute()
        {
            var t = new LocalMsmqGrantReadTask(_address, @"TEST\BrubakerM");
            var r = t.Execute();

            Assert.IsFalse(r.ContainsError(), "Errors occured during permission setting.");
        }
Esempio n. 3
0
        private static DeploymentResult GrantMsmqPermissions(string[] args)
        {
            DeploymentResult result = new DeploymentResult();

            var perm  = args[1];
            var user  = args[2];
            var queue = args[3];

            var queueAddress = new QueueAddress(queue);

            switch (perm)
            {
            case "r":
                result = new LocalMsmqGrantReadTask(queueAddress, user).Execute();
                break;

            case "w":
                result = new MsmqGrantWriteTask(queueAddress, user).Execute();
                break;

            case "rw":
                result = new LocalMsmqGrantReadWriteTask(queueAddress, user).Execute();
                break;

            case "default":
                result = new SetSensibleMsmqDefaults(queueAddress).Execute();
                break;
            }

            return(result);
        }
        public override void RegisterRealTasks(PhysicalServer site)
        {
            var ub = new UriBuilder("msmq", site.Name)
            {
                Path = _queue
            };

            if (site.IsLocal)
            {
                var task = new LocalMsmqGrantReadTask(new QueueAddress(ub.Uri), _group);
                site.AddTask(task);
            }
            else
            {
                var task = new RemoteMsmqGrantReadTask(site, new QueueAddress(ub.Uri), _group);
                site.AddTask(task);
            }
        }
Esempio n. 5
0
        private static DeploymentResult GrantMsmqPermissions(string[] args)
        {
            var result = new DeploymentResult();

            var perm  = args[1];
            var user  = args[2];
            var queue = args[3];

            var queueAddress = new QueueAddress(queue);

            int accessRights;

            if (int.TryParse(perm, out accessRights))
            {
                return(new LocalMsmqGrantAccessRightsTask(queueAddress, user, (MessageQueueAccessRights)accessRights).Execute());
            }

            switch (perm)
            {
            case "r":
                result = new LocalMsmqGrantReadTask(queueAddress, user).Execute();
                break;

            case "w":
                result = new MsmqGrantWriteTask(queueAddress, user).Execute();
                break;

            case "rw":
                result = new LocalMsmqGrantReadWriteTask(queueAddress, user).Execute();
                break;

            case "default":
                result = new SetSensibleMsmqDefaults(queueAddress).Execute();
                break;
            }

            return(result);
        }
Esempio n. 6
0
        private static DeploymentResult GrantMsmqPermissions(string[] args)
        {
            var result = new DeploymentResult();

            var perm = args[1];
            var user = args[2];
            var queue = args[3];

            var queueAddress = new QueueAddress(queue);

            int accessRights;
            if (int.TryParse(perm, out accessRights))
            {
                return new LocalMsmqGrantAccessRightsTask(queueAddress, user, (MessageQueueAccessRights)accessRights).Execute();
            }

            switch (perm)
            {
                case "r":
                    result = new LocalMsmqGrantReadTask(queueAddress, user).Execute();
                    break;
                case "w":
                    result = new MsmqGrantWriteTask(queueAddress, user).Execute();
                    break;
                case "rw":
                    result = new LocalMsmqGrantReadWriteTask(queueAddress, user).Execute();
                    break;
                case "default":
                    result = new SetSensibleMsmqDefaults(queueAddress).Execute();
                    break;
            }

            return result;
        }
Esempio n. 7
0
        private static DeploymentResult GrantMsmqPermissions(string[] args)
        {
            DeploymentResult result = new DeploymentResult();

            var perm = args[1];
            var user = args[2];
            var queue = args[3];

            var queueAddress = new QueueAddress(queue);

            switch (perm)
            {
                case "r":
                    result = new LocalMsmqGrantReadTask(queueAddress, user).Execute();
                    break;
                case "w":
                    result = new MsmqGrantWriteTask(queueAddress, user).Execute();
                    break;
                case "rw":
                    result = new LocalMsmqGrantReadWriteTask(queueAddress, user).Execute();
                    break;
                case "default":
                    result = new SetSensibleMsmqDefaults(queueAddress).Execute();
                    break;
            }

            return result;
        }