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

Fix saving error with custom permissions in O2M fields #13998

Conversation

younky-yang
Copy link

@younky-yang younky-yang commented Jun 20, 2022

Description

This is a simple bug fix for #13765 and #13997. When editing an item with relation fields and also have RBAC controls, users may get "You don't have permission to access this" error. The reason is when user click the relation items in the main item view, the list-o2m.editItem() will set the editsAtStart to the displayItem which contains the related fields. In fact, we just need to pass the key value of this item as the editsAtStart as when the drawer pops up, the value will be fetched from backend. So the fix is also simple, just remove all unrelated fields from the displayItem except the key field.

Fixes #13765

Type of Change

  • Bugfix
  • New Feature
  • Refactor / codestyle updates
  • Other, please describe:

Requirements Checklist

  • New / updated tests are included
  • All tests are passing locally
  • Performed a self-review of the submitted code

If adding a new feature:

  • Documentation was added/updated

@benhaynes
Copy link
Sponsor Member

Thank you for your contribution, @younky-yang!! We really appreciate the help! ❤️

@azrikahar azrikahar changed the title fix 13765/13997: saving error with rbac role on relation collections Fix saving error with custom permissions in O2M fields Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App relational interface sending data that not allowed to change
4 participants