Browse Source

ignore cache when working with dsid checks

pull/544/head
Nelson Hart 10 years ago
parent
commit
1e2e183602
  1. 16
      fedora_repository.module

16
fedora_repository.module

@ -1719,13 +1719,19 @@ function fedora_repository_check_perm($op, $pid = NULL, $as_user = NULL, $reset_
global $user;
$as_user = $user;
}
// Populate the cache on a miss.
if (!isset($cache[$op][$pid][$as_user->uid]) || $dsid) {
if ($dsid) {
$results = module_invoke_all('fedora_repository_check_perm', $op, $pid, $as_user, $dsid);
// Nothing returned FALSE, and something returned TRUE.
$cache[$op][$pid][$as_user->uid] = (!in_array(FALSE, $results, TRUE) && in_array(TRUE, $results, TRUE));
return (!in_array(FALSE, $results, TRUE) && in_array(TRUE, $results, TRUE));
}
else {
// Populate the cache on a miss.
if (!isset($cache[$op][$pid][$as_user->uid])) {
$results = module_invoke_all('fedora_repository_check_perm', $op, $pid, $as_user);
// Nothing returned FALSE, and something returned TRUE.
$cache[$op][$pid][$as_user->uid] = (!in_array(FALSE, $results, TRUE) && in_array(TRUE, $results, TRUE));
}
}
return $cache[$op][$pid][$as_user->uid];
}

Loading…
Cancel
Save