Do not expose information via relationfield serializer
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- api, authorization, backend, security
Research direction
Start by locating the relationfield serializer that produces relatedItems and trace how it applies the View permission. Reproduce the three-page scenario with one private or inaccessible page, then verify that relatedItems contains only accessible pages and exposes no metadata for inaccessible ones.
Written by the indexing model from the issue text.
Description
Description
The relationfield serializer should respect the View permission.
Problem
Some metadata like, Title and Description can be exposed thru the relationsfield serializer
Reproduce
- Create 3 pages
- Refer to page 2 and 3 from page 1 via relatedItems
- Remove View permission for page 2, or page 3 (You can simply publish page 1 and for example page 2 and keep page 3 private)
Result: bot page 2 and page 3 are serialized in relatedItems
...
"relatedItems": [
{
"@id": "http://localhost:8080/Plone/page-2",
"@type": "Document",
"UID": "4f0b980e8a144a55b9244b8b942e93d2",
"description": "",
"image_field": null,
"image_scales": null,
"review_state": "published",
"title": "Page 2"
},
{
"@id": "http://localhost:8080/Plone/page-3",
"@type": "Document",
"UID": "bec10b954049433088df076e6eb0208d",
"description": "",
"image_field": null,
"image_scales": null,
"review_state": "private",
"title": "Page 3"
}
],
...
Expected result
Only list accessible relatedItems and do not expose any metadata information
...
"relatedItems": [
{
"@id": "http://localhost:8080/Plone/page-2",
"@type": "Document",
"UID": "4f0b980e8a144a55b9244b8b942e93d2",
"description": "",
"image_field": null,
"image_scales": null,
"review_state": "published",
"title": "Page 2"
}
],
...
- Dominant language
- Python
- Stars
- 109
- Forks
- 107
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/plone.restapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
plone/plone.restapi#2031 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
plone/plone.restapi#662 · 2 comments · 4 reactions ·
-
01 type: bug
plone/plone.restapi#2023 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
plone/plone.restapi#2017 ·
-
@controlpanels/content-rules/<rule>/action/<idx> omits values for fields in non-default fieldsets Open
plone/plone.restapi#2016 · 1 assignee ·
All issues in plone/plone.restapi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100