fix: Return empty result if no perm level access (#24591)
This commit is contained in:
parent
1cce6588ee
commit
3bea50d519
2 changed files with 7 additions and 0 deletions
|
|
@ -217,6 +217,10 @@ class DatabaseQuery:
|
|||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -1255,6 +1255,9 @@ class TestReportView(FrappeTestCase):
|
|||
response = execute_cmd("frappe.desk.reportview.get")
|
||||
self.assertNotIn("published", response["keys"])
|
||||
|
||||
# If none of the fields are accessible then result should be empty
|
||||
self.assertEqual(frappe.get_list("Blog Post", "published"), [])
|
||||
|
||||
def test_reportview_get_admin(self):
|
||||
# Admin should be able to see access all fields
|
||||
with setup_patched_blog_post():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue