From fdfc8ae0c6fb054498ecec8630e7ee1b6f35afe6 Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Fri, 8 Feb 2019 14:33:32 -0600 Subject: [PATCH] allow for AbstractObject or string --- islandora.module | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/islandora.module b/islandora.module index 5dce6c75..a72f4fb7 100644 --- a/islandora.module +++ b/islandora.module @@ -866,14 +866,14 @@ function islandora_user_access($object_or_datastream, array $permissions, array * * @param string $perm * User permission to test for. - * @param AbstractObject $object + * @param AbstractObject|string $object * The object to test, if NULL given the object doesn't exist or is * inaccessible. * * @return bool * TRUE if the user is allowed to access this object, FALSE otherwise. */ -function islandora_object_access_callback($perm, AbstractObject $object = NULL) { +function islandora_object_access_callback($perm, $object = NULL) { module_load_include('inc', 'islandora', 'includes/utilities'); if (!$object && !islandora_describe_repository()) { @@ -1331,7 +1331,7 @@ function islandora_tokened_datastream_load($datastream_id, array $map) { * @param string $datastream_id * The DSID of the datastream specified as '%islandora_datastream' to fetch * from the given object in the menu path identified by '%islandora_object'. - * @param mixed $object_id + * @param AbstractObject|string $object_id * The object to load the datastream from. This can be a Fedora PID or * an instantiated IslandoraAbstractObject as it implements __toString() * returning the PID. @@ -1666,6 +1666,14 @@ function islandora_file_mimetype_mapping_alter(&$mapping) { /** * Hookable object access callback. * + * @param string $op + * String identifying an operation to check. Should correspond to a + * permission declared via hook_permission(). + * @param AbstractObject|string $object + * An object to check for permissions. + * @param object $user + * An optional loaded user object. Defaults to the global $user. + * * @return bool * TRUE if at least one implementation of hook_islandora_object_access() * returned TRUE, and no implementation return FALSE; FALSE otherwise.