feat: new permissions to view gmail-threads based on linked doc - #90
Open
trufurs wants to merge 2 commits into
Open
feat: new permissions to view gmail-threads based on linked doc#90trufurs wants to merge 2 commits into
trufurs wants to merge 2 commits into
Conversation
chore: minor version update v1.0.4
… reference doctypes
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds more granular permission handling for Gmail Thread records, including permissions derived from linked/reference documents.
Changes:
- Added request-level caching for
get_permission_query_conditions. - Expanded permission query conditions to include access via
reference_doctype/reference_namematch conditions. - Updated
has_permissionto defer to reference document permissions when applicable.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+548
to
+553
| reference_doctypes = frappe.get_all( | ||
| "Gmail Thread", | ||
| filters={"reference_doctype": ("is", "set")}, | ||
| pluck="reference_doctype", | ||
| distinct=True, | ||
| ) |
| )""" | ||
| conditions.append(f"({clause})") | ||
|
|
||
| return " or ".join(conditions) |
Comment on lines
+554
to
+558
| for doctype in reference_doctypes: | ||
| try: | ||
| engine = Engine() | ||
| engine.get_query(doctype, user=user, db_query_compat=True) | ||
| match_conditions = engine.build_match_conditions() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Relevant Technical Choices
Testing Instructions
Additional Information:
Screenshot/Screencast
Checklist
Fixes #