function node_service_get_access in Services 6
Same name and namespace in other branches
- 6.2 services/node_service/node_service.inc \node_service_get_access()
- 7 services/node_service/node_service.inc \node_service_get_access()
Check if the user has the permission to get the node's data thru services.
Parameters
$nid: Number. The node ID.
Return value
Boolean. TRUE if the user has the permission to get the node's data thru services.
1 string reference to 'node_service_get_access'
- node_service_service in services/
node_service/ node_service.module - Implementation of hook_service().
File
- services/
node_service/ node_service.inc, line 37 - @author Services Dev Team
Code
function node_service_get_access($nid) {
global $user;
$node = node_load($nid);
return $node->uid == $user->uid and user_access('load own node data') or $node->uid != $user->uid and user_access('load any node data');
}