Exemplo n.º 1
0
        private bool SourceNetworkACEExistsInOtherContainerMemberships(SourceNetwork sourceNetwork, PresenceRelationshipLevel containerIdToExcludeFromSearch)
        {
            bool aceExists = false;

            foreach (ContainerMembership container in userEndpoint.UserContainerMemberships)
            {
                if (container.ContainerId != (Int32)containerIdToExcludeFromSearch)
                {
                    if (((Int32)container.AllowedSourceNetworks & (Int32)sourceNetwork) == (Int32)sourceNetwork)
                    {
                        aceExists = true;
                        break;
                    }
                }
            }

            return(aceExists);
        }
Exemplo n.º 2
0
        private Dictionary <int, ContainerUpdateOperation> CreateDeleteSourceNetworkACEOperation(Dictionary <int, ContainerUpdateOperation> operations, SourceNetwork sourceNetwork)
        {
            foreach (ContainerMembership container in userEndpoint.UserContainerMemberships)
            {
                bool aceFound = false;

                if (((Int32)container.AllowedSourceNetworks & (Int32)sourceNetwork) == (Int32)sourceNetwork)
                {
                    aceFound = true;
                }

                if (aceFound)
                {
                    if (operations.ContainsKey(container.ContainerId))
                    {
                        operations[container.ContainerId].DeleteSourceNetwork(sourceNetwork);
                    }
                    else
                    {
                        ContainerUpdateOperation operation = new ContainerUpdateOperation(container.ContainerId);
                        operation.DeleteSourceNetwork(sourceNetwork);
                        operations.Add(container.ContainerId, operation);
                    }
                    break;
                }
            }

            return(operations);
        }
Exemplo n.º 3
0
        private Dictionary <int, ContainerUpdateOperation> CreateAddSourceNetworkACEOperation(Dictionary <int, ContainerUpdateOperation> operations, SourceNetwork sourceNetwork, ACEItem aceItem)
        {
            foreach (ContainerMembership container in userEndpoint.UserContainerMemberships)
            {
                if (container.ContainerId == (Int32)aceItem.PresenceRelationshipLevel)
                {
                    bool itemFound = false;

                    if (((Int32)container.AllowedSourceNetworks & (Int32)sourceNetwork) == (Int32)sourceNetwork)
                    {
                        itemFound = true;
                    }

                    if (!itemFound)
                    {
                        if (operations.ContainsKey(container.ContainerId))
                        {
                            operations[container.ContainerId].AddSourceNetwork(sourceNetwork);
                        }
                        else
                        {
                            ContainerUpdateOperation operation = new ContainerUpdateOperation(container.ContainerId);
                            operation.AddSourceNetwork(sourceNetwork);
                            operations.Add(container.ContainerId, operation);
                        }
                    }

                    break;
                }
            }

            return(operations);
        }