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: incorrect caching of is_owner permissions #21048

Merged
merged 1 commit into from May 19, 2023

Conversation

ankush
Copy link
Member

@ankush ankush commented May 18, 2023

  • Create a doctype
  • Pick any role and only allow owner to create, read, write.
  • after_insert hook re-save the document
  • This will fail because there's a function call to frappe.only_has_select_perm which doesn't pass the is_owner, this is likely acceptable if document is not available.

Fix: cache should be separate for is_owner

Triggered from but not caused by #20810

@ankush ankush requested a review from a team as a code owner May 18, 2023 10:36
@ankush ankush requested review from shariquerik and removed request for a team May 18, 2023 10:36
- Create a doctype
- Pick any role and only allow owner to create, read, write.
- after_insert hook re-save the document
- This will fail because there's a function call to `frappe.only_has_select_perm` which doesn't pass the is_owner, this is likely acceptable if document is not available.

Fix: cache should be separate for is_owner

Triggered from but not caused by frappe#20810
@ankush ankush merged commit d0a24e6 into frappe:develop May 19, 2023
2 checks passed
@ankush ankush deleted the permission_cache branch May 19, 2023 04:04
mergify bot pushed a commit that referenced this pull request May 19, 2023
- Create a doctype
- Pick any role and only allow owner to create, read, write.
- after_insert hook re-save the document
- This will fail because there's a function call to `frappe.only_has_select_perm` which doesn't pass the is_owner, this is likely acceptable if document is not available.

Fix: cache should be separate for is_owner

Triggered from but not caused by #20810

(cherry picked from commit d0a24e6)
mergify bot pushed a commit that referenced this pull request May 19, 2023
- Create a doctype
- Pick any role and only allow owner to create, read, write.
- after_insert hook re-save the document
- This will fail because there's a function call to `frappe.only_has_select_perm` which doesn't pass the is_owner, this is likely acceptable if document is not available.

Fix: cache should be separate for is_owner

Triggered from but not caused by #20810

(cherry picked from commit d0a24e6)
ankush added a commit that referenced this pull request May 19, 2023
- Create a doctype
- Pick any role and only allow owner to create, read, write.
- after_insert hook re-save the document
- This will fail because there's a function call to `frappe.only_has_select_perm` which doesn't pass the is_owner, this is likely acceptable if document is not available.

Fix: cache should be separate for is_owner

Triggered from but not caused by #20810

(cherry picked from commit d0a24e6)

Co-authored-by: Ankush Menat <ankush@frappe.io>
ankush added a commit that referenced this pull request May 19, 2023
- Create a doctype
- Pick any role and only allow owner to create, read, write.
- after_insert hook re-save the document
- This will fail because there's a function call to `frappe.only_has_select_perm` which doesn't pass the is_owner, this is likely acceptable if document is not available.

Fix: cache should be separate for is_owner

Triggered from but not caused by #20810

(cherry picked from commit d0a24e6)

Co-authored-by: Ankush Menat <ankush@frappe.io>
frappe-pr-bot pushed a commit that referenced this pull request May 23, 2023
## [13.56.4](v13.56.3...v13.56.4) (2023-05-23)

### Bug Fixes

* frappe.get_palette when text is undefined ([#21033](#21033)) ([#21034](#21034)) ([1557d68](1557d68))
* incorrect caching of `is_owner` permissions ([#21048](#21048)) ([#21052](#21052)) ([a9acf3f](a9acf3f))
* using 'Equals' and 'Is' on multiselect throws error ([6c57a26](6c57a26))
frappe-pr-bot pushed a commit that referenced this pull request May 23, 2023
## [14.36.2](v14.36.1...v14.36.2) (2023-05-23)

### Bug Fixes

* `get_default_address` must accept `'Nonetype' name` (backport [#21022](#21022)) ([#21036](#21036)) ([b10a65d](b10a65d))
* add card shadow to onboarding widget ([#21031](#21031)) ([#21032](#21032)) ([95538a2](95538a2))
* allow custom html block based on roles applied ([ad86bb9](ad86bb9))
* backend to create workspace custom block and update workspace ([3583490](3583490))
* **build:** Propogate exit code from yarn build to bench build ([#21084](#21084)) ([#21086](#21086)) ([8a14c42](8a14c42))
* cast doc name to string while exporting child docs ([#21057](#21057)) ([e57f420](e57f420))
* created custom block widget which renders html,css,js from custom html block ([d46a7c9](d46a7c9))
* created workspace custom block doctype to store custom blocks ([d08401d](d08401d))
* custom block css for widget-head ([13b91ea](13b91ea))
* custom html block ([bbeaa9e](bbeaa9e))
* frappe.get_palette when text is undefined ([#21033](#21033)) ([#21035](#21035)) ([fdcb373](fdcb373))
* handle block width for min-width = 2 ([e467254](e467254))
* incorrect caching of `is_owner` permissions ([#21048](#21048)) ([#21053](#21053)) ([00da02b](00da02b))
* initialize custom block in editorjs ([8f91cf9](8f91cf9))
* misc onboarding fixes ([#21078](#21078)) ([#21085](#21085)) ([7a754b7](7a754b7))
* read-only form for multiple role access in the same workflow state ([#21008](#21008)) ([b4ffb62](b4ffb62))
* remove setup_complete events ([5870e54](5870e54))
* sync workspace custom block doctype while installing ([4853897](4853897))
* using 'Equals' and 'Is' on multiselect throws error ([e5bd19d](e5bd19d))
* **UX:** activate next step automatically ([da3f566](da3f566))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant