Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It seems to still be possible to retrieve nodes using EFQ even w/o "Node: Basic page: Read entities using JavaScript" permission when not specifying an entityCondition('bundle', 'page')
. Patch attached that alters the result after the query has been executed.
Also, not sure if I am understanding it correctly but EFQ docs says that "It is not possible to query across multiple entity types." so I guess result would always be just 1 entity type? I've removed the foreach ($results as ...
in this patch.
Comment | File | Size | Author |
---|---|---|---|
restrict-efq-bundle-level.patch | 5.64 KB | dsdeiz | |
Comments
Comment #1
saltednutPatch applies clean. I definitely overlooked the single entity type portion of the EFQ docs! This definitely makes things less complicated.
I suppose just running the EFQ and then checking access for the output is acceptable. It definitely cleans things up a lot from a code-reading perspective.
Passes tests and my manual code review. Excellent work. Committed!
http://drupalcode.org/project/entity_js.git/commit/02a6737
Comment #1.0
saltednutVeryyyy minor typo :D