/// <summary>
        /// When the find-user window closes, grab the rights holder that was selected and add it.
        /// </summary>
        /// <param name="sender">The find window.</param>
        /// <param name="eventArgs">The event arguments.</param>
        private void OnFindUserClose(object sender, EventArgs eventArgs)
        {
            WindowFindUser windowAddUserAccess = sender as WindowFindUser;

            if (windowAddUserAccess.SelectedUser != null)
            {
                DependencyObject container = null;

                if (!this.roles.Any(a => a.User == windowAddUserAccess.SelectedUser))
                {
                    this.roles.Add(new AccessControl(windowAddUserAccess.SelectedUser, this.Entity, AccessRight.None, this.Entity.TenantId));
                    this.CanApply = true;
                }

                container = this.RolesAndUsers.ItemContainerGenerator.ContainerFromItem(windowAddUserAccess.SelectedUser);

                if (container != null)
                {
                    container.SetValue(FrameworkElement.VisibilityProperty, Visibility.Visible);
                }
                this.RolesAndUsers.SelectedItem = this.roles.FirstOrDefault(a => a.User == windowAddUserAccess.SelectedUser);
                this.RolesAndUsers.ScrollIntoView(this.RolesAndUsers.SelectedItem);
            }

            Win32Interop.EnableWindow(this);
            this.Activate();
        }
        /// <summary>
        /// Add permission to the current entity to a new user/group.
        /// </summary>
        /// <param name="sender">The security tab's Add... button</param>
        /// <param name="eventArgs">The event arguments (unused).</param>
        private void OnAddPermissionGroup(object sender, RoutedEventArgs eventArgs)
        {
            WindowFindUser windowAddUserAccess = new WindowFindUser();

            windowAddUserAccess.Owner   = this;
            windowAddUserAccess.Closed += this.OnFindUserClose;
            windowAddUserAccess.Show();
            Win32Interop.DisableWindow(this);
        }