Skip to content

feat: new permissions to view gmail-threads based on linked doc - #90

Open
trufurs wants to merge 2 commits into
version-16-hotfixfrom
feat-new-permissions
Open

feat: new permissions to view gmail-threads based on linked doc#90
trufurs wants to merge 2 commits into
version-16-hotfixfrom
feat-new-permissions

Conversation

@trufurs

@trufurs trufurs commented Aug 12, 2026

Copy link
Copy Markdown
Member

Description

Relevant Technical Choices

Testing Instructions

Additional Information:

Screenshot/Screencast

Checklist

  • I have carefully reviewed the code before submitting it for review.
  • This code is adequately covered by unit tests to validate its functionality.
  • I have conducted thorough testing to ensure it functions as intended.
  • A member of the QA team has reviewed and tested this PR (To be checked by QA or code reviewer)

Fixes #

Copilot AI balanced review requested due to automatic review settings August 12, 2026 20:54
@trufurs trufurs changed the title Feat new permissions feat: new permissions to view gmail-threads based on linked doc Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_name match conditions.
  • Updated has_permission to 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()
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

Successfully merging this pull request may close these issues.

2 participants