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

@@getSource raises Vocabulary lookup not allowed on add form if user cannot modify the container #221

Closed
ale-rt opened this issue Mar 19, 2021 · 1 comment · Fixed by #223
Assignees

Comments

@ale-rt
Copy link
Member

ale-rt commented Mar 19, 2021

I have this use case:

  • in the container the user has the "Add portal content" permission
  • in the container the user has not the "Modify portal content" permission
  • the user wants to add a dexterity content type with a field that uses a plone.app.vocabularies.catalog.CatalogSource
  • when in the add form the widget fails to fetch the from the URL .../++add++.../++widget++form.widgets.field_name/@@getSource and returns Vocabulary lookup not allowed.
@ale-rt ale-rt self-assigned this Mar 19, 2021
@ale-rt
Copy link
Member Author

ale-rt commented Mar 19, 2021

The problem, IMO, is related to this code:

info = mergedTaggedValueDict(field.interface, WRITE_PERMISSIONS_KEY)
permission_name = info.get(field.__name__, 'cmf.ModifyPortalContent')
permission = queryUtility(IPermission, name=permission_name)
if permission is None:
permission = getUtility(
IPermission,
name='cmf.ModifyPortalContent'
)

which assumes that to fill that widget with data we need to have the "Modify portal content" permission

ale-rt added a commit that referenced this issue Mar 19, 2021
Allow to use the @@getsource view when we are in an add form and we do
not have the "Modify portal content" permission

Fixes #221
ale-rt added a commit that referenced this issue Mar 19, 2021
Allow to use the @@getsource view when we are in an add form and we do
not have the "Modify portal content" permission

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

Successfully merging a pull request may close this issue.

1 participant