Branch: refs/heads/2.2.0
Home:
https://github.com/Checkmk/checkmk
Commit: 3b2e1f5fbb7e128191c6e7b52d28bccadf326281
https://github.com/Checkmk/checkmk/commit/3b2e1f5fbb7e128191c6e7b52d28bccad…
Author: Leonardo Petrora <leonardo.petrora(a)checkmk.com>
Date: 2024-03-07 (Thu, 07 Mar 2024)
Changed paths:
A .werks/16210
M cmk/gui/plugins/openapi/endpoints/folder_config/__init__.py
M cmk/gui/plugins/openapi/endpoints/folder_config/request_schemas.py
M cmk/gui/watolib/hosts_and_folders.py
M cmk/gui/watolib/predefined_conditions.py
M tests/testlib/rest_api_client.py
M tests/unit/cmk/gui/plugins/openapi/test_openapi_folder_config.py
Log Message:
-----------
16210 FIX folder_config: Prevent unintentional deletion of a non-empty folder
Prior to this Werk, the REST API could delete non-empty folders without any further check.
With this Werk, the endpoint now accepts the delete_method query parameter. The possible
values are:
- recursive: Deletes the folder and all the elements it contains.
- abort_on_nonempty: Deletes the folder only if it is not empty
If no delete_method is provided, "recursive" is asumed and the behaviour is the
same as before this Werk.
The enpoint will return a 409 status code when trying to delete a folder that contains
hosts, rules, subfolders or is referenced by another object.
Use example:
`curl -X 'DELETE'
'http://example.com/my_site/check_mk/api/1.0/objects/folder_config/my_folder?delete_metod=abort_on_nonempty'
-H 'accept: */*`
SUP-16540
Change-Id: I3b94ed9eef56a94f6e4b8d1908f0bfd5527b35ac
To unsubscribe from these emails, change your notification settings at
https://github.com/Checkmk/checkmk/settings/notifications