Download & Extend

working with access callbacks in hook_menu

Project:OG User Roles
Version:6.x-4.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I have some custom tabs in my group pages that are built with hook_menu. Before I started using og_user_roles, the tabs showed up just as expected. For instance, a tab to create a gallery:

<?php
  $items
['node/%node/gallery2/add'] = array(
   
'page callback' => 'node_add',
   
'page arguments' => array('gallery'),
   
'access callback' => 'node_access',
   
'access arguments' => array('create', 'gallery'),
   
'description' => 'Add Gallery',
   
'file' => 'node.pages.inc',
   
'file path' => drupal_get_path('module', 'node'),
   
'title' => 'Add Gallery',
   
'type' => MENU_LOCAL_TASK,
   
'weight' => 10,
  );
?>

Now, it does not respect the perms the user should have in the group context. How should I set up the access callback to work correctly with og_user_roles?

Comments

#1

Status:active» postponed (maintainer needs more info)

What exactly means "it does not work" ?

#2

It does not display the tab when it should. When in the context of a group that gives the user perms to add a node, the user does not see a tab letting him add the node.

I accidentally discovered that if I create a block with the following code:

<?php
global $user;
og_user_roles_grant_roles($user, node_load(arg(1)));
?>

the permissions are loaded correctly. But if I put that same code into the module it doesn't change anything.

#3

Are you using 6.x-4.1?