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

feat: allow wildcard for doctype in permission hooks (backport #25729) #25891

Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 10, 2024

Please provide enough information so that others can review your pull request:

Feature for permission_query_conditions and has_permission hooks to accept "*" wildcard along with specific doctypes.

Explain the details for making this change. What existing problem does the pull request solve?

permission_query_conditions = {
	"*": "app.permissions.get_permission_query_conditions",
}

has_permission = {
	"*": "app.permissions.has_permission",
}

Combining the list with += operator. so we get the doctype hook as well as wildcard hooks combined.

Screenshots/GIFs

docs: https://frappeframework.com/app/wiki-page-patch/f9a1b577f3


This is an automatic backport of pull request #25729 done by [Mergify](https://mergify.com).

* feat: allow wildcard for doctype in permission hooks

* fix: pass doctype to permission query

* fix: combine methods instead of alternate

* test: wildcard has_permssion hook

* test: wildcard has_permssion make note public

* fix: fetch list of hooks once

(cherry picked from commit 7e16e90)
@mergify mergify bot requested a review from a team as a code owner April 10, 2024 06:15
@mergify mergify bot requested review from ankush and removed request for a team April 10, 2024 06:15
@mergify mergify bot assigned revant Apr 10, 2024
@akhilnarang akhilnarang enabled auto-merge (squash) April 10, 2024 06:20
@akhilnarang akhilnarang merged commit af33091 into version-14-hotfix Apr 10, 2024
10 checks passed
@akhilnarang akhilnarang deleted the mergify/bp/version-14-hotfix/pr-25729 branch April 10, 2024 06:31
frappe-pr-bot pushed a commit that referenced this pull request Apr 16, 2024
# [14.72.0](v14.71.0...v14.72.0) (2024-04-16)

### Bug Fixes

* handle empty style tag ([#25910](#25910)) ([#25915](#25915)) ([771fa80](771fa80))
* handle interface error during report timeout ([#25893](#25893)) ([#25894](#25894)) ([5d4e106](5d4e106))
* make letterhead attachments public by default (backport [#25925](#25925)) ([#25926](#25926)) ([6ea38b6](6ea38b6))
* make_error_msg for imap ([b2cfa49](b2cfa49))

### Features

* add option to set default email recipients ([#25555](#25555)) ([dc070a4](dc070a4))
* allow wildcard for doctype in permission hooks ([#25729](#25729)) ([#25891](#25891)) ([af33091](af33091))
* **Customize Form:** add "Trim Table" action (backport [#25923](#25923)) ([#25934](#25934)) ([ad34d52](ad34d52))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.72.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
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.

None yet

3 participants