Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy saved object flyout should not allow copying into the active space #116650

Closed
jportner opened this issue Oct 28, 2021 · 1 comment · Fixed by #116657
Closed

Copy saved object flyout should not allow copying into the active space #116650

jportner opened this issue Oct 28, 2021 · 1 comment · Fixed by #116657
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@jportner
Copy link
Contributor

jportner commented Oct 28, 2021

Kibana version: 7.16 (unreleased)

Describe the bug:

Steps to reproduce:

  1. Start a fresh ES cluster and fresh Kibana instance
  2. Navigate to Stack Management > Saved objects
  3. Find the config object and click the "Copy to space" action

Expected behavior:

The flyout should exclude the active space from the list of target spaces. If there are no target spaces, the flyout should inform you that there are no other spaces to copy this object to.

Screenshots (if relevant):

This is currently what it looks like:

image

This is what it should look like:

image

Any additional context:

This was introduced during #109258 but we did not catch it because the unit test was unstable (failed under heavy CPU load) and it had been skipped 🤦

Need to make this change to fix it:

diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx
index 7697780c352..3ff72e131aa 100644
--- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx
+++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx
@@ -75,7 +75,7 @@ export const CopyToSpaceFlyoutInternal = (props: CopyToSpaceFlyoutProps) => {
           isLoading: false,
           spaces: [...spacesMap.values()].filter(
             ({ isActiveSpace, isAuthorizedForPurpose }) =>
-              isActiveSpace || isAuthorizedForPurpose('copySavedObjectsIntoSpace')
+              !isActiveSpace && isAuthorizedForPurpose('copySavedObjectsIntoSpace')
           ),
         });
       })

Thanks @XavierM for fixing the tests and discovering this!

@jportner jportner added bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Oct 28, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants