How do I set permissions for non-register users?

Step 1: I registered Drupal 7 in my system.

Step 2: I wrote a module for user_register().

Step 3: When I call the menu callback an access denied error is shown.

How should i set permission to non-register users to register?

  • 2
    May you report the code you use to call the menu callback? Which menu callback are you calling?
    – apaderno
    Jun 7 '11 at 19:18
  • 2
    why do you need user_register() if you're dealing with unregistered users?
    – Chaulky
    Jun 8 '11 at 14:01

In your menu item definitions, you can specify TRUE as the access callback to make the item always accessible.

  function mymodule_menu() {
    $items['abc/def'] = array(
      'page callback' => 'mymodule_abc_view',
      'access callback' => TRUE,
    return $items;


See http://api.drupal.org/api/function/_menu_check_access/7

Hope this helps, Mark

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.