Skip to content

Instantly share code, notes, and snippets.

View nhart's full-sized avatar

Nelson Hart nhart

  • Atlantic Canada
View GitHub Profile
@nhart
nhart / gist:4540478
Created January 15, 2013 17:53
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;