Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type schema is available only for authenticated users #1409

Open
erral opened this issue May 6, 2022 · 3 comments
Open

Type schema is available only for authenticated users #1409

erral opened this issue May 6, 2022 · 3 comments

Comments

@erral
Copy link
Member

erral commented May 6, 2022

The Type Schema endpoint (/@types/WhateverType) is available only for authenticated users:

https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/services/types/get.py#L120
https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/services/types/get.py#L23

If we want to have a DefaultView in Volto for schema based content-types and this view should be viewed by anonymous users, we need to remove the permission check here.

Opinions?

@ionlizarazu @pbauer

@jensens
Copy link
Member

jensens commented May 6, 2022

Do we expose anything confidential if we allow the type schema for anonymous? I do not think so. But correct me if I am wrong

cc @plone/security-team

@avoinea
Copy link
Member

avoinea commented May 6, 2022

@erral I think we should remove that check and rely only on the permission defined within zcml https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/services/types/configure.zcml#L11

@mauritsvanrees
Copy link
Member

The zcml permission currently says anyone with View permission in the Plone Site (or anywhere) can access it. So that will be everyone for most sites.

This is an example of the output you get:
https://plonerestapi.readthedocs.io/en/latest/types.html#get-the-schema-with-get

I suppose it is possible that there is a Choice field where the possible options contain secrets. Not too likely, but it could happen. In that case I would expect the field to have a permission, granted to for example only Site Administrators.

So I think we should check the permission for fields, and only include those fields that the user is allowed to see. It does not look like this happens currently. If we do not check this, then the auto-generated view will contain all fields, also those that the user is not allowed to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants