Skip to content

Commit

Permalink
fix: Return empty result if no perm level access (backport #24591) (#…
Browse files Browse the repository at this point in the history
…24592)

* fix: Return empty result if no perm level access (#24591)

(cherry picked from commit 3bea50d)

# Conflicts:
#	frappe/tests/test_db_query.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Jan 29, 2024
1 parent 619e862 commit adcbeee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frappe/model/db_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ def build_and_run(self):
args = self.prepare_args()
args.limit = self.add_limit()

if not args.fields:
# apply_fieldlevel_read_permissions has likely removed ALL the fields that user asked for
return []

if args.conditions:
args.conditions = "where " + args.conditions

Expand Down

0 comments on commit adcbeee

Please sign in to comment.