0

How do I show a node "only if a user is an owner of the node" with Panels/Page Manager' Variants and its Visibility Rules (right icon on each content)?

enter image description here enter image description here

  • you may check that condition in your view first. – Kojo Nov 14 '16 at 19:06
  • @Kojo ok but to be more precise... I can only guess - it is rather not Access and not Relationships, it might be Contextual Filters.. but still don't know how. – damian Nov 14 '16 at 19:56
  • 1
    @Kojo got it - accomplished with CONTEXTUAL FILTERS and Content: Author uid. thanks for directions. – damian Nov 14 '16 at 20:38
  • Glad you found it yourself. You're welcome ☺ – Kojo Nov 14 '16 at 21:59
0

If possible then create your own permission which should be visible under **Variants » Basic » Selection rules ** section. For creating panel permission, check following steps: 1. Create folder structure like module -> plugins -> access -> filename.inc 2. Add following function and hooks under that file:

/**
 * @file
 * Plugin to provide access control based upon role membership.
 */

/**
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */
$plugin = array(
  'title' => t("Community: Access"),
  'description' => t('Control access by community.'),
  'callback' => 'dc_visibility_ctools_access_check',
  'default' => array('community' => array()),
  'settings form' => 'dc_visibility_ctools_access_settings',
  'settings form submit' => 'dc_visibility_ctools_access_settings_submit',
  'summary' => 'dc_visibility_ctools_access_summary',
  'all contexts' => TRUE,
);

/**
 * Settings form for the 'by role' access plugin
 */
function dc_visibility_ctools_access_settings($form, &$form_state, $conf) {

  return $form;
}

/**
 * Compress the community allowed to the minimum.
 */
function dc_visibility_ctools_access_settings_submit($form, &$form_state) {
  $form_state['values']['settings']['community'] = array_keys(array_filter($form_state['values']['settings']['community']));
}

/**
 * Check for access.
 */
function dc_visibility_ctools_access_check($conf, $context) {

}

function dc_visibility_ctools_access_summary($conf, $context){

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.