3

All volunteer organization running new install of Civi 5.10.4. under Wordpress 5.1.1 multisite network. Under civi, the events rss, page, or specific events page can only be viewed when a user is logged in. For example the following links:

https://data.chihuahuan.org/?page=CiviCRM&q=civicrm%2Fevent%2Fical&reset=1&list=1&html=1 https://data.chihuahuan.org/?page=CiviCRM&q=civicrm%2Fevent%2Fical&reset=1&list=1&rss=1 https://data.chihuahuan.org/?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&id=5

I believe there are similar issues with other public pages and suspect that access control is the root issue at play. Anonymous users get the error "You do not have permission to view the page." Logged in users can view these pages fine. Reading documentation and asking questions, I was instructed to go to CiviCRM » Administer CiviCRM » Access Control WordPress Access Control and enable settings for anonymous users.

Looking in the Permissions and Access Control WordPress section of the manual, I think I should be seeing something like this Wordpress Access Control Interface

In our instance of CiviCRM, the WP Access Control page does not have an anonymous user role column shown above. **I don't know how to enable one or how to make public pages accessible without enabling anonymous access control.

Reading about a WordPress Access Control post at the CiviCRM blog, I see that it says

One other drawback in Wordpress is that Wordpress does not deal with Anonymous users, which makes it hard for administrators to manage access to public event/contribution pages in Wordpress/CiviCRM installation. To overcome this, CiviCRM injects a new role (Anonymous User) in the wordpress instance, so that this role can be used to assign capabilities for anonymous users accessing public event/contribution pages.

From something else I read, it seems that a lack of anonymous user role in this case may be related to the fact that the site is part of a WP multisite network--that the new CiviCRM Anonymous User role was not properly injected on install because the site is part of a WP Multisite Network I'm afraid much of this is beyond by understanding, but I'm trying to follow along. Is anyone familiar with this issue and does anyone have suggestions for how I might enable anonymous access to various public pages produced by Civi?

I see a workaround below for a multi-site civi installation. I'd eventually like to work towards multi site functionality, but being new to the software I'm trying to address one thing at a time.

That linked fix doesn't quite seem to pertain directly to a single site install of civi within a multisite network. I'm also reticent to paste in code that I don't understand.

Thanks in advance for any help or guidance someone might have.

  • Looks to me like the fifth column in your screenshot is headed "Anonymous User". – Christian Wach Mar 15 at 19:26
  • You are quite correct. However, the graphic to which you refer is linked from the manual. In the question, when referring to the graphic from the manual, I wrote "I think I should be seeing something like this." The text goes on to state that I am not seeing this column. That to my inexperienced eyes seems to be the crux of the problem. The question for me is how to create an anonymous user role such that Civi will recognize it. I am tinkering with WP plugins to create user roles to see if that resolves the issue. – N.Craig Mar 16 at 2:08
  • I used Ultimate Member to create an Anonymous user with WP capabilities to read and upload files. The Anonymous column shows up in Civi's Wordpress Access control, but when I try to check an option it does not remain checked after save. If I check other user types and save it sticks, but with the Anonymous role I created the selection does not stick...starting to feel bummed. – N.Craig Mar 16 at 3:00
2

It seems that there were two moving parts here. The first was properly setting up the base page the second, and more complex part, was properly creating and naming the Anonymous User role. With the former properly in place, the latter seems to be the fix.

From what I can gather, it seems that on install Civi 5.10.4 did not create an anonymous user role. It was not listed in the Wordpress Access Control. The role needed to be created manually and it needed to be properly named. I used the User Role Editor plugin which gave good control. I now realize that I was not properly naming the new at first, calling it simply "anonymous" which did not work as hoped. Looking at the civi code provided clues to correctly naming "Anonymous User" as "anonymous_user". Creating that role and assigning the permissions seems to have resolved the issue.

See here https://lab.civicrm.org/dev/wordpress/blob/master/includes/civicrm.users.php#L253

The correct permissions are here: https://lab.civicrm.org/dev/wordpress/blob/master/includes/civicrm.users.php#L272

Thanks to the two people who provided clues. Sorry if I didn't properly follow custom here, I'm very new and getting the hang of things. I'll try to watch and learn.

  • 1
    That link suggest that you don't have a "basepage". Try creating a Page with the slug 'civicrm' and then copying that to the setting in "CMS Database integration". – Christian Wach Mar 17 at 18:19
  • Also, FWIW, I don't think this is specific to WordPress multisite -- I run a number of CiviCRM installs under multisite and have not seen this. One more thing -- since you're setting up CiviCRM from scratch, why not try the latest release? There could be something peculiar about 5.10.4. – Christian Wach Mar 17 at 18:22
  • Lastly, look in the code if you're going to create custom roles: the default ones granted to anonymous_user are listed here: github.com/civicrm/civicrm-wordpress/blob/master/includes/… – Christian Wach Mar 17 at 18:25
  • Thanks these are very helpful hints. Defining the base page allows individual events to be displayed both as pages and using the Events Widget. I'm still not seeing the rss feed or the main html list when not logged in. While not totally resolved, this seems to be some progress. I will ensure I've looked at anonymous_user permissions. – N.Craig Mar 17 at 21:36
  • 1
    Try the "base page" suggestion I made first perhaps. If you're on a sub-site, then it's possible that CiviCRM didn't auto-create it for you. One way or another, WordPress homepages are rarely the best way to display native CiviCRM content. – Christian Wach Mar 18 at 11:52
0

On my install, I have four sections under users/permissions/acl's; wordpress ACL, then manage roles, manage users to roles, manage ACLs.

my wordpress acl does have an anonymous user. it is a single install. I believe one can then elect multi-site config.

under manage acl's you can set Role =Everyone, operation=edit, type of data=event, whichdata=all events, description=eventpromotiontoall, enabled=yes

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.