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
Comment #1
gantenx commentedComment #2
peter törnstrand commentedHaving the same problem.
Comment #3
peter törnstrand commentedI solved this by using the "Rendered entity" panel instead of "User profile".
Comment #4
aaronschachter commentedWhere are you setting it to "rendered entity"? I am having the same problem but am not sure where you went in order to solve.
Comment #5
aaronschachter commentedChanging to bug report. Why would you need to be able to "administer users" in order to view a user's profile?
Comment #6
japerryDrupal 7 is no longer supported, closing.