1

I let my users register on my wordpress website using a contribution page on CiviCRM. It used to work fine but last time I tried to register a new user, instead of the thank you page, I get this access denied message :

Access denied picture

" Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. You do not have permission to access this page. Return to home page."

After hours of investigation, I finally found out the problem came after I changed the default role for new subscribers to a custom role I had added from my function.php called "Pending". If I turn it back to "Subcribers" then it works fine again.

Do you have any idea how I could grant access to this page to users with "Pending" role ??

Thanks a lot !

Here is the log :

Sep 22 19:33:21  [info] $Fatal Error Details = Array
(
    [message] => You do not have permission to access this page.
    [code] => 
)


    Sep 22 19:33:21  [info] $backTrace = #0 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(385): CRM_Core_Error::backtrace("backTrace", TRUE)
    #1 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php(397): CRM_Core_Error::fatal("You do not have permission to access this page.")
    #2 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(76): CRM_Utils_System_WordPress->permissionDenied()
    #3 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(231): CRM_Utils_System::__callStatic("permissionDenied", (Array:0))
    #4 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:15))
    #5 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
    #6 /home/gemmemedxe/www/wp-content/plugins/civicrm/civicrm.php(1392): CRM_Core_Invoke::invoke((Array:3))
    #7 /home/gemmemedxe/www/wp-content/plugins/civicrm/includes/civicrm.basepage.php(365): CiviCRM_For_WordPress->invoke()
    #8 /home/gemmemedxe/www/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
    #9 /home/gemmemedxe/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, (Array:1))
    #10 /home/gemmemedxe/www/wp-includes/plugin.php(531): WP_Hook->do_action((Array:1))
    #11 /home/gemmemedxe/www/wp-includes/class-wp.php(750): do_action_ref_array("wp", (Array:1))
    #12 /home/gemmemedxe/www/wp-includes/functions.php(1105): WP->main("")
    #13 /home/gemmemedxe/www/wp-blog-header.php(16): wp()
    #14 /home/gemmemedxe/www/index.php(17): require("/home/gemmemedxe/www/wp-blog-header.php")
    #15 {main}
1

Ok, thanks a lot Demerit but I could not get what I should do in there and finally found the solution.

So the trick was with the capabilities. I installed user role editor and found out that by default, a subscriber is granted way more capabilities than just "read", which are :

access_all_custom_data
access_civimail_subscribe_unsubscribe_pages
access_uploaded_files
make_online_contributions
profile_create
profile_edit
profile_listings
profile_view
read
register_for_events
sign_civicrm_petition
view_event_info
view_public_civimail_content

So basicaly if your custom roles are not granted those capabilities, users will get denied the access to some civi page at some point.

So in wordpress I just went Users > User role Editor and updated my custom roles with the right capabilities.

Hope it helps !

0

Go to https://your-site/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Faccess%2Fwp-permissions&reset=1

You can also get there from under administer - users and permissions - permissions, and then on that page there's the link to wordpress access control.

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.