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:

  $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

sun’s picture

Status: Active » Postponed (maintainer needs more info)

What exactly means "it does not work" ?

dafeder’s picture

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:

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.

sun’s picture

Are you using 6.x-4.1?

fuzzy76’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (duplicate)