From ac7f71d04572a31d69fb0cb0e2b0fcf283aa6b57 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 14 Feb 2011 10:47:59 -0400 Subject: [PATCH] ISLANDORA-194 Add permission check to purge object form. --- fedora_repository.module | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index 818fc4ac..623217ef 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -236,7 +236,12 @@ function fedora_repository_ingest_form(&$form_state, $collection_pid, $collectio function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { global $base_url; - // $form['#redirect'] = "fedora/repository/$collectionPid/"; + if (!user_access('purge objects and datastreams')) { + return NULL; + } + if ($pid == NULL) { + return NULL; + } $form['pid'] = array( '#type' => 'hidden', '#value' => "$pid"