By arunms on
I am building a custom module for a client but I am not able to get anonymous users to access the custom pages. Instead it is giving the following message:
Access denied
You are not authorized to access this page.
I have the following code in my .module file:
function fixtures_perm() {
return array('access fixtures content');
}
In my menu hook I have the following code:
$items['pickyourproducts'] = array(
'title' => '',
'description' => 'Loads Pick Your Products form for the fixtures module.',
'page callback' => 'pickyourproducts_page',
'access callback' => 'user_access',
'access arguements' => array('access fixtures content'),
'type' => MENU_CALLBACK,
'file' => 'pickyourproducts.module',
'file path' => drupal_get_path('module', 'pickyourproducts'),
);
I have checked all the permissions in the permissions page for "access fixtures content".
Could anyone help me with this issue???
Comments
I had very much the same problem
I hope someone will provide a better answer, but here is what I did
1. Turn off all your caching
2. Hit the "rebuild permissions" button often (it's found in post settings)
Maybe that will fix it, maybe not. There is some sort of permissions cache that will bite ya. (I actually had to let the thing sit overnight)
If not
3. Change the access callback to 'access content'
that should surely work. If not, go to 1 and 2.
4. There "SHOULD" be an anonymous user access value built in, but I do not know what it is.
5. You can easily write an internal access function that returns TRUE all the time, or if uid==0, if that's what you want.
Good luck!
:)
cleared cache and rebuilt permissions to no avail...
Thanks for your quick response. I did clear cache and rebuild permissions several times. It din't work. How do I force access to a module, the one you have mentioned in step #5.
For # 5 look up how to create
For # 5 look up how to create an access function. I have not been successful at it myself, so....
:)
You don't need the access
You don't need the access callback (that is already the default), and your problem is that you spelled 'arguments' wrong.
Contact me to contract me for D7 -> D10/11 migrations.
That was it...
Fixing the typo solved the problem. Jay, that was brilliant. Gash, I need to get a good editor.
I doff my cap
Good work Jay!
:)
I learned that one from
I learned that one from personal experience :D
Contact me to contract me for D7 -> D10/11 migrations.