You are here

function file_service_get_node_files_access in Services 6.2

Same name and namespace in other branches
  1. 6 services/file_service/file_service.inc \file_service_get_node_files_access()
  2. 7 services/file_service/file_service.inc \file_service_get_node_files_access()

Check if the user has permission to get all files from a given node.

1 string reference to 'file_service_get_node_files_access'
file_service_service in services/file_service/file_service.module
Implementation of hook_service().

File

services/file_service/file_service.inc, line 188
Link general file functionalities to services module.

Code

function file_service_get_node_files_access($nid) {
  global $user;
  if (user_access('get any binary files')) {
    return TRUE;
  }
  elseif ($node = node_load($nid)) {
    return $node->uid == $user->uid && user_access('get own binary files');
  }
}