Skip to content

Commit

Permalink
[fc] Repository: plone.restapi
Browse files Browse the repository at this point in the history
Branch: refs/heads/main
Date: 2024-11-01T14:25:01-07:00
Author: David Glick (davisagli) <[email protected]>
Commit: plone/plone.restapi@741bd1c

Preparing release 9.8.3

Files changed:
M CHANGES.rst
M setup.py
D news/1830.bugfix
Repository: plone.restapi

Branch: refs/heads/main
Date: 2024-11-01T14:25:51-07:00
Author: David Glick (davisagli) <[email protected]>
Commit: plone/plone.restapi@e634169

Back to development: 9.8.4

Files changed:
M setup.py
  • Loading branch information
davisagli committed Nov 1, 2024
1 parent ad516fd commit 70f3dac
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions last_commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,31 @@ Repository: plone.restapi


Branch: refs/heads/main
Date: 2024-10-31T20:23:30-03:00
Author: Érico Andrei (ericof) <ericof@gmail.com>
Commit: https://github.com/plone/plone.restapi/commit/e2d4e70fa475bd9ccb994af52632c8ef45f76279
Date: 2024-11-01T14:25:01-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.restapi/commit/741bd1cdfd5b27440554979d54510eae42d3ae2c

Fixes Plone Site serialization when there is a field with read_permision set (#1831)
Preparing release 9.8.3

* Fixes Plone Site serialization when there is a field with read_permission set (Fixes #1830)

* Update news/1830.bugfix

---------

Co-authored-by: David Glick &lt;[email protected]&gt;
Files changed:
M CHANGES.rst
M setup.py
D news/1830.bugfix

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 4954960da..3e6cc99b8 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -8,6 +8,15 @@ Changelog\n \n .. towncrier release notes start\n \n+9.8.3 (2024-11-01)\n+------------------\n+\n+Bug fixes:\n+\n+\n+- Fixed Plone Site serialization when there is a field with read_permission set. @ericof (#1830)\n+\n+\n 9.8.2 (2024-10-30)\n ------------------\n \ndiff --git a/news/1830.bugfix b/news/1830.bugfix\ndeleted file mode 100644\nindex df8dfb81c..000000000\n--- a/news/1830.bugfix\n+++ /dev/null\n@@ -1 +0,0 @@\n-Fixed Plone Site serialization when there is a field with read_permission set. @ericof\n\\ No newline at end of file\ndiff --git a/setup.py b/setup.py\nindex 183ac1eed..03ea5095b 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -4,7 +4,7 @@\n import sys\n \n \n-version = "9.8.3.dev0"\n+version = "9.8.3"\n \n if sys.version_info.major == 2:\n raise ValueError(\n'

Repository: plone.restapi


Branch: refs/heads/main
Date: 2024-11-01T14:25:51-07:00
Author: David Glick (davisagli) <[email protected]>
Commit: https://github.com/plone/plone.restapi/commit/e63416968eb390f42df50c1025395d1b3baf7f60

Back to development: 9.8.4

Files changed:
A news/1830.bugfix
M src/plone/restapi/serializer/site.py
M src/plone/restapi/tests/dxtypes.py
M src/plone/restapi/tests/test_site_serializer.py
M setup.py

b'diff --git a/news/1830.bugfix b/news/1830.bugfix\nnew file mode 100644\nindex 000000000..df8dfb81c\n--- /dev/null\n+++ b/news/1830.bugfix\n@@ -0,0 +1 @@\n+Fixed Plone Site serialization when there is a field with read_permission set. @ericof\n\\ No newline at end of file\ndiff --git a/src/plone/restapi/serializer/site.py b/src/plone/restapi/serializer/site.py\nindex 11c5a0a2a..65081fd2e 100644\n--- a/src/plone/restapi/serializer/site.py\n+++ b/src/plone/restapi/serializer/site.py\n@@ -4,15 +4,17 @@\n from plone.dexterity.utils import iterSchemata\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.bbb import IPloneSiteRoot\n-from plone.restapi.blocks import visit_blocks, iter_block_transform_handlers\n+from plone.restapi.blocks import iter_block_transform_handlers\n+from plone.restapi.blocks import visit_blocks\n+from plone.restapi.interfaces import IBlockFieldSerializationTransformer\n from plone.restapi.interfaces import IFieldSerializer\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n-from plone.restapi.interfaces import IBlockFieldSerializationTransformer\n from plone.restapi.serializer.converters import json_compatible\n+from plone.restapi.serializer.dxcontent import get_allow_discussion_value\n from plone.restapi.serializer.expansion import expandable_elements\n-from plone.restapi.services.locking import lock_info\n from plone.restapi.serializer.utils import get_portal_type_title\n+from plone.restapi.services.locking import lock_info\n from plone.supermodel.utils import mergedTaggedValueDict\n from Products.CMFCore.utils import getToolByName\n from zope.component import adapter\n@@ -23,7 +25,6 @@\n from zope.interface import Interface\n from zope.schema import getFields\n from zope.security.interfaces import IPermission\n-from plone.restapi.serializer.dxcontent import get_allow_discussion_value\n \n import json\n \n@@ -39,6 +40,7 @@ class SerializeSiteRootToJson:\n def __init__(self, context, request):\n self.context = context\n self.request = request\n+ self.permission_cache = {}\n \n def _build_query(self):\n path = "/".join(self.context.getPhysicalPath())\ndiff --git a/src/plone/restapi/tests/dxtypes.py b/src/plone/restapi/tests/dxtypes.py\nindex b3632d41d..c7f8ef148 100644\n--- a/src/plone/restapi/tests/dxtypes.py\n+++ b/src/plone/restapi/tests/dxtypes.py\n@@ -312,6 +312,9 @@ class ITestBehavior(model.Schema):\n test_behavior_field = schema.TextLine(required=False)\n # Add nav_title to test if it gets substituted in Navigation service\n nav_title = schema.TextLine(required=False)\n+ # Add a field with read permission set\n+ test_secure_field = schema.TextLine(required=False)\n+ read_permission(test_secure_field="cmf.ManagePortal")\n \n \n @provider(IFormFieldProvider)\ndiff --git a/src/plone/restapi/tests/test_site_serializer.py b/src/plone/restapi/tests/test_site_serializer.py\nindex 34174a762..60de5ffff 100644\n--- a/src/plone/restapi/tests/test_site_serializer.py\n+++ b/src/plone/restapi/tests/test_site_serializer.py\n@@ -38,6 +38,7 @@ def setUp(self):\n if fti is not None:\n behavior_list = [a for a in fti.behaviors]\n behavior_list.append("volto.blocks")\n+ behavior_list.append("tests.restapi.test_behavior")\n fti.behaviors = tuple(behavior_list)\n # Invalidating the cache is required for the FTI to be applied\n # on the existing object\n'
b'diff --git a/setup.py b/setup.py\nindex 03ea5095b..dc007c4c1 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -4,7 +4,7 @@\n import sys\n \n \n-version = "9.8.3"\n+version = "9.8.4.dev0"\n \n if sys.version_info.major == 2:\n raise ValueError(\n'

0 comments on commit 70f3dac

Please sign in to comment.