Browse Source

ignore cache when working with dsid checks

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

12
fedora_repository.module

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

Loading…
Cancel
Save