-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add support for sharing saved objects to all spaces #76132
Add support for sharing saved objects to all spaces #76132
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.tsx
Show resolved
Hide resolved
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.
💚 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* 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) ...
* 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) ...
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.