protected function RestWSEntityResourceController::nodeAccess in RESTful Web Services 7.2
Helper function to respect node permissions while querying.
Parameters
EntityFieldQuery $query: The query object.
2 calls to RestWSEntityResourceController::nodeAccess()
File
- ./
restws.entity.inc, line 313 - RESTful web services module integration for entities.
Class
- RestWSEntityResourceController
- Controller for entity-bases resources.
Code
protected function nodeAccess(EntityFieldQuery $query) {
// Respect node access and filter out unpublished nodes if user lacks
// the right permission.
if ($this
->resource() == 'node') {
$query
->addTag('node_access');
if (!user_access('bypass node access')) {
$this
->propertyQueryOperation($query, 'Condition', 'status', 1);
}
}
}