"You are not authorized to access this page" checklist


This is a surprisingly common error for drupal users. Drupal has very powerful access control features, this is good. But it also means it's pretty easy to configure things in such a way that you prevent your users (usually the anonymous ones) from accessing content, this is bad.

I've run across this problem on many occassions, so I've put together a checklist that may help you debug your access problems.

  1. access control - Start here, does your user actually have access granted to him to view the content in question? Browse to your admin/access_control page and confirm that read access is granted for users on modules such as 'node'. If "access content" is not checked for anonymous users in the node access row, anonymous users will not be able to view any nodes! Check all the "access content" type values for all node types. Make sure they are the way you want them.
  2. User 0 - Make sure this user exists in all the appropriate tables. This is probably the most common reason for anonymous users being denied access. See my post, All Important User Zero, for more info.
  3. Make sure the author of the node(s) you are trying to view exists in your users table. There's currently a bug in Drupal in which if the author of a node can't be found in the users table, access will be denied to all for that node. To prevent this from happening, instead of deleting authors who are no longer part of your site, disable their account instead of deleting it.
  4. Make sure you're using the appropriate mysql extension. Check your settings.php file. If you're using "mysqli://" in your $db_url value, try using "mysql://"
I'm sure there was more, but I can't recall it now.

Well, that's it for now. As always, if you have any tips or ideas, please add a comment here.

BTW, as these "howto" and troubleshooting pages become complete, I will be contributing them to the official documentation.

Thanks for the information but it does not fix the problem. I am using the category module and the error is occuring randomly without warning. Everything will be working fine, I am adding categories or containers, then all of a sudden the anonymous user is not authorized to access the page. I am using drupal 4.7 and have checked all of your list. Any help would be greatly appreciated.

I have same error. And on this page missing solution for me... ;)
When change this default "AllowOverride None" in apache config everything works fine.

I have the opposite problem. I have users who aren't given access to edit their own blogs but they still can. In addition, they can create pages and change the post settings, none of which they are authorized to do in user access.

What does it mean when I go to administer > users, and then configure (tab), and then access control and the area below the navigation tabs is blank? I assume some crucial file is missing?

After adding the `Category` module, I started getting this error. Once I deactivated it, anonymous users had access once again. What a pain in the butt.

In fact, if the Category module is the problem, you need only deactivate the 'Category access control lite' module, and anonymous access is restored for nodes.

In Drupal 6, the role based access has the same effect