Skip to content

Instantly share code, notes, and snippets.

@nhart
Created January 15, 2013 17:53
Show Gist options
  • Save nhart/4540478 to your computer and use it in GitHub Desktop.
Save nhart/4540478 to your computer and use it in GitHub Desktop.
token access
function islandora_object_datastream_tokened_access_callback($perm, $object = NULL, $datastream = NULL) {
module_load_include('inc', 'islandora', 'includes/utilities');
$token = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_STRING);
$token_access = islandora_validate_object_token($object->id, $datastream->id, $token);
if(islandora_object_datastream_access_callback($perm, $object, $datastream) || $token_access) { //
return TRUE;
}
else {
return FALSE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment