Skip to content

Allow updating the setup configuration objects - #103

Open
ramonski wants to merge 1 commit into
feature/dx-duration-fieldmanagerfrom
feature/allow-setup-config-update
Open

Allow updating the setup configuration objects#103
ramonski wants to merge 1 commit into
feature/dx-duration-fieldmanagerfrom
feature/allow-setup-config-update

Conversation

@ramonski

Copy link
Copy Markdown
Contributor

Description

is_update_allowed() refuses any object whose parent is the portal root. That denylist also catches the setup configuration singletons — the AT bika_setup and the DX senaite_setup — which sit directly under the portal. As a result, site-wide settings stored on those objects (for example SelfVerificationEnabled) cannot be changed through the JSON API at all, even by a user who holds the required permission.

This PR adds an is_setup() helper and treats the two setup singletons as an explicit exception: the objects themselves become updatable, while their children stay read-only (the existing parent-based checks still apply to everything else). Authorization is unchanged — the ModifyPortalContent permission check in the data manager still gates every write — so only privileged users can update the setup config.

Stacked on #102.

Current behavior before PR

Updating the setup config object returns Update of /<site>/bika_setup is not allowed (likewise for the DX senaite_setup), so settings such as self-verification cannot be toggled via the API.

Desired behavior after PR is merged

The setup configuration singletons can be updated through the API (subject to the usual permission check), while objects contained in the setup folders remain read-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Security 🔒 Security concern

Development

Successfully merging this pull request may close these issues.

1 participant