Add support for sharing saved objects to all spaces#76132
Merged
jportner merged 29 commits intoelastic:masterfrom Oct 5, 2020
Merged
Add support for sharing saved objects to all spaces#76132jportner merged 29 commits intoelastic:masterfrom
jportner merged 29 commits intoelastic:masterfrom
Conversation
b4dcae9 to
f8cef00
Compare
1d44a3e to
ebaa032
Compare
fd152f9 to
e93f563
Compare
e93f563 to
8ebcb3f
Compare
This method will no longer update a multi-namespace object to remove it from its current namespace. Instead, it will always delete the object, even if that object exists in multiple namespaces. Adds a new `force` option that is required if the object does exist in multiple namespaces.
This is treated as "all namespaces".
Changed how options are passed into tests and how privilege checks are tested so that tests are easier to understand and change.
Removed "Make a copy" button, made "make a copy" inline text a clickable link instead.
No functionality changes, just some refactoring.
No functionality changes, just some refactoring.
One error message was incorrect. Converted to get rid of snapshots.
* Added new checkable card options * Added privilege checks which conditionally disable options * Added descriptive text when unknown spaces are selected
8ebcb3f to
473dc7d
Compare
This is necessary when deleting saved objects that exist in multiple namespaces.
Could not figure out why this broke, I did not change this flyout. At any rate, clicking a different part of the radio button fixed it.
473dc7d to
f855fcd
Compare
legrego
reviewed
Oct 1, 2020
Member
legrego
left a comment
There was a problem hiding this comment.
This is working beautifully! I haven't evaluated all of the functional or UI unit tests yet, but I'll leave you with what I have so far
x-pack/plugins/security/server/authorization/actions/saved_object.test.ts
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/no_spaces_available.tsx
Outdated
Show resolved
Hide resolved
.../plugins/spaces/public/share_saved_objects_to_space/components/selectable_spaces_control.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.tsx
Show resolved
Hide resolved
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.tsx
Show resolved
Hide resolved
.../plugins/spaces/public/share_saved_objects_to_space/components/selectable_spaces_control.tsx
Outdated
Show resolved
Hide resolved
jportner
commented
Oct 1, 2020
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.tsx
Show resolved
Hide resolved
legrego
reviewed
Oct 2, 2020
A holdover from the legacy test suite checked to ensure that saved objects could not be created with the `namespace` or `namespaces` fields. This isn't necessary for an API integration test -- the unit test suite covers this scenario -- and it's invalid now that `namespaces` is a valid field. So I removed these test cases.
Contributor
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
distributable file count
page load bundle size
History
To update your PR or re-run it, just comment with: |
jportner
added a commit
to jportner/kibana
that referenced
this pull request
Oct 5, 2020
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Oct 5, 2020
* master: (128 commits) add core-js production dependency (elastic#79395) Add support for sharing saved objects to all spaces (elastic#76132) [Alerting UI] Display a banner to users when some alerts have failures, added alert statuses column and filters (elastic#79038) load js-yaml lazily (elastic#79092) skip flaky suite (elastic#77278) Fix agentPolicyUpdateEventHandler() to use app context soClient for creation of actions (elastic#79341) [Security Solution] Untitled Timeline created when first action is to add note (elastic#78988) [Security Solutions][Detection Engine] Updates the edit rules page to:wq! only have what is selected for editing (elastic#79233) Cleanup yarn.lock from duplicates (elastic#66617) [kbn/optimizer] implement more efficient auto transpilation for node (elastic#79052) [Ingest Manager] Rename Fleet setup and requirement, Fleet => Central… (elastic#79291) [core/server/plugins] don't run discovery in dev server parent process (take 2) (elastic#79358) [babel/register] remove from build (take 2) (elastic#79379) [Security Solution] Changes rules table tag display (elastic#77102) define integrationTestRoot in config file and use to define screensho… (elastic#79247) Revert "[babel/register] remove from build (elastic#79176)" skip flaky suite (elastic#75241) [Uptime] Synthetics UI (elastic#77960) [Security Solution] [Detections] Only display actions options if user has "read" privileges (elastic#78812) [babel/register] remove from build (elastic#79176) ...
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Oct 5, 2020
* master: (288 commits) add core-js production dependency (elastic#79395) Add support for sharing saved objects to all spaces (elastic#76132) [Alerting UI] Display a banner to users when some alerts have failures, added alert statuses column and filters (elastic#79038) load js-yaml lazily (elastic#79092) skip flaky suite (elastic#77278) Fix agentPolicyUpdateEventHandler() to use app context soClient for creation of actions (elastic#79341) [Security Solution] Untitled Timeline created when first action is to add note (elastic#78988) [Security Solutions][Detection Engine] Updates the edit rules page to only have what is selected for editing (elastic#79233) Cleanup yarn.lock from duplicates (elastic#66617) [kbn/optimizer] implement more efficient auto transpilation for node (elastic#79052) [Ingest Manager] Rename Fleet setup and requirement, Fleet => Central… (elastic#79291) [core/server/plugins] don't run discovery in dev server parent process (take 2) (elastic#79358) [babel/register] remove from build (take 2) (elastic#79379) [Security Solution] Changes rules table tag display (elastic#77102) define integrationTestRoot in config file and use to define screensho… (elastic#79247) Revert "[babel/register] remove from build (elastic#79176)" skip flaky suite (elastic#75241) [Uptime] Synthetics UI (elastic#77960) [Security Solution] [Detections] Only display actions options if user has "read" privileges (elastic#78812) [babel/register] remove from build (elastic#79176) ...
jportner
added a commit
that referenced
this pull request
Oct 5, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Resolves #69808 and partially resolves #76992.
This PR allows saved objects to be shared to all current and future spaces. See linked issues for details. Primary changes:
Server side
Client side
Screenshots
These screenshots depict different users:
Scenario 1: sharing an object but no other spaces exist
The Global User sees additional text with a link to create a new space. The Default User does not.
Scenario 2: sharing an object after additional spaces have been created
Each user can only see spaces that they are authorized to create saved objects in.
Scenario 3: sharing an object after the object has already been shared to additional spaces
Each user can only see spaces that they are authorized to create saved objects in. The Default + Alpha User and the Default User each see an additional label with a count of hidden spaces, and they see additional text with a link explaining that they lack privileges to see those spaces.
Scenario 4: disabled options and tooltips
If a user does not have global access, they cannot A. share an object to all spaces, or B. unshare an object from all spaces. In each of these cases, UI elements are disabled, and a tooltip renders the appropriate message.
Scenario 5: "Saved Objects" management table
The table will now display an appropriate badge if an object is shared to all spaces. NOTE FOR REVIEWERS: this column is currently disabled by default, see "x-pack/plugins/spaces/public/share_saved_objects_to_space/share_saved_objects_to_space_service.ts" for details.