I have an aplication with three roles reader, editor , manager.

I've created two views with block display
1) list the documents of the system.
2) list recect activity in that documents.

Both of them are accessible from reader role. i've defined it in the access property of the view

I've a homebox page with two blocks one per each of these views.
I also have two primary links that points to that views (page display)

My problem is that when a user with the role reader try to acces to the hombebox page, the primary links desappear and only one of the views is displayed as a box the othe get lost . When these user navigates in an other part of application the primary links appear again.

This situation doesn`t happen with the drupal administrator. so i think is a permission bug.

I've been trying to find the bug and i think the problem is here:

// Render block content

    $array = module_invoke($block->module, 'block', 'view', $block->delta);
    if (isset($array) && is_array($array)) {
      foreach ($array as $k => $v) {
        $block->$k = $v;
      }
    }

when is a block view call to views_block hook and for some reasons when the views module execute

$view->execute_display($display_id);

the user role is lost

Whats happening?
Any ideas or solutions?
I've no idea how to resolve this situation.

Thanks

Comments

infodrupal’s picture

Looking for a solutions i've started thinking that the problem
comes from the hook_views_pre_execute. Disabling this function the problem dissapear.

function homebox_views_pre_execute(&$view) {
  global $user;

  // Make sure $user is logged in, comes from an Ajax Request for Views
  if ($user->uid != 0 && arg(0) == 'homebox') {
    $exposed = &$_SESSION['views'];
    // We save the current user exposed parameters to the database
    user_save($user, array('homebox_views_exposed' => $exposed));
  }
brianV’s picture

Status: Active » Closed (won't fix)

Homebox earlier than 6.x-3.x is no longer supported.