Hello Aron,

Thanks for this awesome module.

Using this module in one of our projects and needed permissions to restrict some user roles from accessing forms for unrequired content types. So, did some additions to the module code.

Additions define permissions for each content type and also hide restricted tabs from current user.

Please find the attached patch.

Best regards.

Comments

TajinderSingh created an issue. See original summary.

aron novak’s picture

Status: Active » Needs work

Thanks for the patch, I just reviewed it now.

if (count($unset_tabs) > 0) {
      foreach ($unset_tabs as $key) {
        unset($variables['tabs']['#primary'][$key]);
      }
    }

It seems Drupal core already does that. Let's say you're on a node view page, if you cannot edit it, edit tab is simply missing, i have the feeling that we re-do what core does (I did not actually try it out in action yet). Could you please try to achieve the goal without that multi_node_add_preprocess_page? It would make it simpler and cleaner, otherwise it looks ok.