Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public void Execute()
        {
            var t = new SetSensibleMsmqDefaults(_address);
            var r = t.Execute();

            Assert.IsFalse(r.ContainsError(), "Errors occured during permission setting.");
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
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;
        }