I'm overriding user view page with panel. The panel will be used to display some user's information and User Profile pane.

What I get is the User Profile pane displayed only to users who have 'administer users' permission or if the currently viewed user had logged in before. Users who have 'view user profile' permission is not able to view the pane.

Shouldn't it use the same access as the user view page permission, using user_view_access() ?

Here are a rip from ctools/plugins/content_types/user_context/user_profile.inc :

[code]

/**
 * Render the user profile content type.
 */
function ctools_user_profile_content_type_render($subtype, $conf, $panel_args, $context) {
  $account = isset($context->data) ? clone($context->data) : NULL;
  if (!$account || ($account->access == 0 && !user_access('administer users'))) {
    return NULL;
  }

  // Retrieve all profile fields and attach to $account->content.
  if (!isset($account->content)) {
    user_build_content($account, isset($conf['view_mode']) ? $conf['view_mode'] : 'full');
  }

  $build = $account->content;
  // We don't need duplicate rendering info in account->content.
  unset($account->content);

  $build += array(
    '#theme' => 'user_profile',
    '#account' => $account,
    // @todo support view mode
    '#view_mode' => isset($conf['view_mode']) ? $conf['view_mode'] : 'full',
    // @todo do we need to support this?
    '#language' => NULL,
  );

  // Allow modules to modify the structured user.
  $type = 'user';
  drupal_alter(array('user_view', 'entity_view'), $build, $type);

  $block = new stdClass();
  $block->module = 'user-profile';
  $block->title = check_plain(format_username($account));
  $block->content = $build;

  return $block;
}

[/code]

Comments

gantenx’s picture

Category: bug » support
peter törnstrand’s picture

Having the same problem.

peter törnstrand’s picture

I solved this by using the "Rendered entity" panel instead of "User profile".

aaronschachter’s picture

Where are you setting it to "rendered entity"? I am having the same problem but am not sure where you went in order to solve.

aaronschachter’s picture

Category: support » bug

Changing to bug report. Why would you need to be able to "administer users" in order to view a user's profile?

japerry’s picture

Status: Active » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.