Allow updating the setup configuration objects - #103
Open
ramonski wants to merge 1 commit into
Open
Conversation
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.
Description
is_update_allowed()refuses any object whose parent is the portal root. That denylist also catches the setup configuration singletons — the ATbika_setupand the DXsenaite_setup— which sit directly under the portal. As a result, site-wide settings stored on those objects (for exampleSelfVerificationEnabled) 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 — theModifyPortalContentpermission 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 DXsenaite_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.