function file_service_get_access in Services 7
Same name and namespace in other branches
- 6 services/file_service/file_service.inc \file_service_get_access()
- 6.2 services/file_service/file_service.inc \file_service_get_access()
Check if the user has permission to get a given file
1 string reference to 'file_service_get_access'
- file_service_service in services/
file_service/ file_service.module - Implementation of hook_service().
File
- services/
file_service/ file_service.inc, line 128 - @author Services Dev Team
Code
function file_service_get_access($fid) {
global $user;
if (user_access('get any binary files')) {
return TRUE;
}
elseif ($file = db_fetch_array(db_query('SELECT * FROM {files} WHERE fid = %d', $fid))) {
return $file['uid'] == $user->uid && user_access('get own binary files');
}
}