@ -34,7 +34,6 @@ define('ISLANDORA_INGEST', 'ingest fedora objects');
define('ISLANDORA_PURGE', 'delete fedora objects and datastreams');
define('ISLANDORA_PURGE', 'delete fedora objects and datastreams');
define('ISLANDORA_MANAGE_PROPERTIES', 'manage object properties');
define('ISLANDORA_MANAGE_PROPERTIES', 'manage object properties');
define('ISLANDORA_VIEW_DATASTREAM_HISTORY', 'view old datastream versions');
define('ISLANDORA_VIEW_DATASTREAM_HISTORY', 'view old datastream versions');
define('ISLANDORA_ACCESS_INACTIVE_AND_DELETED_OBJECTS', 'access inactive and deleted objects');
define('ISLANDORA_MANAGE_DELETED_OBJECTS', 'manage deleted objects');
define('ISLANDORA_MANAGE_DELETED_OBJECTS', 'manage deleted objects');
define('ISLANDORA_REVERT_DATASTREAM', 'revert to old datastream');
define('ISLANDORA_REVERT_DATASTREAM', 'revert to old datastream');
define('ISLANDORA_REGENERATE_DERIVATIVES', 'regenerate derivatives for an object');
define('ISLANDORA_REGENERATE_DERIVATIVES', 'regenerate derivatives for an object');
@ -579,7 +578,7 @@ function islandora_theme() {
* Implements hook_permission().
* Implements hook_permission().
*/
*/
function islandora_permission() {
function islandora_permission() {
$permissions = array(
return array(
ISLANDORA_VIEW_OBJECTS => array(
ISLANDORA_VIEW_OBJECTS => array(
'title' => t('View repository objects'),
'title' => t('View repository objects'),
'description' => t('View objects in the repository. Note: Fedora XACML security policies may override this permission.'),
'description' => t('View objects in the repository. Note: Fedora XACML security policies may override this permission.'),
@ -625,13 +624,6 @@ function islandora_permission() {
'description' => t('Add new datastream content as latest version.'),
'description' => t('Add new datastream content as latest version.'),
),
),
);
);
if (variable_get('islandora_deny_inactive_and_deleted', FALSE)) {
$permissions[ISLANDORA_ACCESS_INACTIVE_AND_DELETED_OBJECTS] = array(
'title' => t('Access inactive and deleted objects'),
'description' => t('Access objects with a Fedora state of Inactive or Deleted.'),
);
}
return $permissions;
}
}
/**
/**
@ -1698,11 +1690,8 @@ function islandora_object_access($op, $object, $user = NULL) {
*/
*/
function islandora_islandora_object_access($op, $object, $user) {
function islandora_islandora_object_access($op, $object, $user) {
module_load_include('inc', 'islandora', 'includes/utilities');
module_load_include('inc', 'islandora', 'includes/utilities');
$access = (islandora_namespace_accessible($object->id) && user_access($op, $user));
if (($object->state != 'A') && variable_get('islandora_deny_inactive_and_deleted', FALSE)) {
return islandora_namespace_accessible($object->id) && user_access($op, $user);
$access = ($access && user_access(ISLANDORA_ACCESS_INACTIVE_AND_DELETED_OBJECTS, $user));
}
return $access;
}
}
/**
/**