@ -579,7 +579,7 @@ function islandora_theme() {
* Implements hook_permission().
* Implements hook_permission().
*/
*/
function islandora_permission() {
function islandora_permission() {
return array(
$permissions = 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.'),
@ -612,10 +612,6 @@ function islandora_permission() {
'title' => t('Revert datastream history'),
'title' => t('Revert datastream history'),
'description' => t('Revert to a previous version of a datastream.'),
'description' => t('Revert to a previous version of a datastream.'),
),
),
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'),
),
ISLANDORA_MANAGE_DELETED_OBJECTS => array(
ISLANDORA_MANAGE_DELETED_OBJECTS => array(
'title' => t('Manage deleted objects'),
'title' => t('Manage deleted objects'),
'description' => t('Purge or revert deleted objects.'),
'description' => t('Purge or revert deleted objects.'),
@ -629,6 +625,13 @@ 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;
}
}
/**
/**
@ -1690,7 +1693,7 @@ 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');
if ($object->state != 'A') {
if (( $object->state != 'A') && variable_get('islandora_deny_inactive_and_deleted', FALSE) ) {
return islandora_namespace_accessible($object->id) && user_access($op, $user) && user_access(ISLANDORA_ACCESS_INACTIVE_AND_DELETED_OBJECTS, $user);
return islandora_namespace_accessible($object->id) && user_access($op, $user) && user_access(ISLANDORA_ACCESS_INACTIVE_AND_DELETED_OBJECTS, $user);
}
}
else {
else {