diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 68361348..87555b8d 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -293,7 +293,7 @@ RDF; $relsext = $this->get_datastream_dissemination('RELS-EXT'); - if ($literal_value == REL_TYPE_URI && strpos($object, $f_prefix) !== 0) { + if ($literal_value == RELS_TYPE_URI && strpos($object, $f_prefix) !== 0) { $object = $f_prefix . $object; } @@ -340,7 +340,7 @@ RDF; $rels_text = $this->get_datastream_dissemination('RELS-INT'); - if ($literal_value == REL_TYPE_URI && strpos($object, $f_prefix) !== 0) { + if ($literal_value == RELS_TYPE_URI && strpos($object, $f_prefix) !== 0) { $object = $f_prefix . $object; } if (strpos($dsid, $f_prefix) !== 0) { diff --git a/fedora_repository.api.php b/fedora_repository.api.php index 19f62e05..724078b2 100644 --- a/fedora_repository.api.php +++ b/fedora_repository.api.php @@ -89,3 +89,21 @@ function hook_required_fedora_objects() { ), ); } + +/** + * Implements hook_fedora_repository_can_ingest(). + * Override ingest permissions. + * (from islandora_workflow) + * + * @param string $collection_pid + * The PID of the collection + * + * @return boolean + * TRUE if the user can ingest into the specified collection, FALSE otherwise. + */ +function hook_fedora_repository_can_ingest($collection_pid) { + + module_load_include('inc', 'islandora_workflow', 'islandora_workflow.permissions'); + return (islandora_workflow_user_collection_permission_check($collection_pid) !== FALSE); + +} diff --git a/formClass.inc b/formClass.inc index 908f3bc3..fe9df715 100644 --- a/formClass.inc +++ b/formClass.inc @@ -501,8 +501,12 @@ class formClass { */ function canShowIngestForm($collection_pid) { if (!user_access('ingest new fedora objects')) { - drupal_set_message(t('You do not have permission to ingest.'), 'error'); - return FALSE; + $ingest_override_array = module_invoke_all('fedora_repository_can_ingest', $collection_pid); + $overrides = array_filter($ingest_override_array); + if (empty($overrides)) { + drupal_set_message(t('You do not have permission to ingest.'), 'error'); + return FALSE; + } } module_load_include('inc', 'fedora_repository', 'SecurityClass'); $security_class = new SecurityClass();