Skip to:
Content
Pages
Categories
Search
Top
Bottom

Participants cannot see topics in private forums

  • @mglasser

    Participant

    WP 4.1.1
    bbPress 2.5.6

    My forums are marked as Private. My members have the forum role of Participant. They can see the private forums, but are unable to see the underlying topics. The counts are there, but when the forum is opened, they receive the message “Oh bother! No topics were found here!”.

    Using the plugin “bbPress Advanced Capabilities”, I see the following.

    View private forums : Allow
    View private topics : Denied
    View private replies : Denied

    So I use the above plugin to change the Denied to Allow for a particular user. It has no effect. I have also done the repair to remap everyone to the default, which is Participant. The private topics are also not appearing in the Twenty Fourteen theme.

    Why is this happening if private forums are supposed to be available to logged in members? How can I correct this for my 3,000 members? We just migrated all the users into the database, so is there some other flag we need to set for everyone?

Viewing 25 replies - 1 through 25 (of 40 total)
  • @robin-w

    Moderator

    We just migrated all the users into the database, so is there some other flag we need to set for everyone?

    Last sentence is what we need to start with !

    Can you explain a bit more about what the current site is, and how you got here

    Have you just set up bbpress, and if so can you explain more about the migration of users? or have you migrated from another forum to bbpress? or what is happening?

    Also exactly did you do to ‘remap everyone to the default’?

    @mglasser

    Participant

    Our phpbb3 forum was migrated to a brand new WordPress installation with bbPress installed (not BuddyPress). It was done by a consultant, so I am not sure how much of the code was custom vs a phpbb3 migration tool.

    We got the private topics to show to Participants by using the plugin “Capability Manager Enhanced” and allowing the read_private_topics and read_private_replies. This now allows Participants to read the private topics, but also allows them to see Hidden forums. They cannot see the content/topics of the forums, but they can see the hidden forum titles.

    The remapping to default was done with the repair tool. It had no impact, except to require me to go back and reset the handful of users that were not set to Participants.

    The big question that seems unresolved in many threads is whether Participants are supposed to see Private topics/replies, or if that is a misprint in the documentation? Why would we have to use the Capability Manager Enhanced plugin to do what the docs say should happen by default.

    @robin-w

    Moderator

    We got the private topics to show to Participants by using the plugin “Capability Manager Enhanced”

    suggests that something is not right with the transfer.

    The documentation is right

    Public – Anyone can see these forums
    Private – Only logged in registered users with a forum role can see these forums
    Hidden: Only Moderators/keymasters can see these forums

    so

    are you still using

    bbPress Advanced Capabilities,
    Capability Manager Enhanced

    or both?

    I’d suggest they are not helping

    I’d suggest you turn both off, and the report back with what is happening, and we’ll fix it from there

    @evanevans333

    Participant

    Any progress on this? I am having this problem, and I am using the latest version of bbPress. Also at this point, bbPress Advanced Capabilities, nor Capability manager Enhanced, nor Members, nor any other Role Editor, will allow me to edit the Participant role.

    @mglasser

    Participant

    I am sorry, but I cannot recall the fix for this. Our web site security is sort of messed up and cobbled together, but it is working now. I think “bbpress Advanced Capabilities” plugin is the one that lets me alter the view_private_topics and view_private_replies for an individual use. And I do have to use this for manually created users.

    I am not sure that I did anything to edit a role, but again it has been so long I could be wrong. Part of me feels like it fixed itself with plugin and/or WP version updates.

    FYI, a few months later I had these same symptoms with version 4.4 of WP, which was solved by switching the forums from Private to Public, saving it, and then switching it back. And doing that for every forum.

    Good luck.

    @evanevans333

    Participant

    Well I appreciate the fast answer. Thanks for that. And yeah, I tried all those plugins. They no longer can reach in there and modify the Participant role. That role’s caps are apparently hard coded into the bbPress plugin itself, somewhere. I sure would like to transfer the ability that Moderator has to Participator, just on those two issues, Read_Private_Topics, Read_Private_Replies. That just makes sense, is logical, and practical. A lot of people have been posting about this, trying to make this right, for years now. We need at least a solution that works moving forward.

    The concept is, that if you set a forum to Private, it’s because you don’t want anonymous users and search engines having access to those posts. It’s not because you want to restrict registered users from seeing the content, especially if they are Participants. And if to Participate means to just POST, not reply or see topics and replies in private forums, than there needs to be a User Role with those upgraded permissions, between Moderator and Participant. Because beyond Private, there is even the Hidden permission level. And that’s good for Moderator/Admin level access, but it’s too much if you just want users to be able to see and reply (Participate) in content that is not publicly accessible by anonymous website visitors and search engines.

    Well, very well, I hope some fix comes someday. Somebody who coded bbPress needs to come up with an idea here.

    @robin-w

    Moderator

    untested, but this should in theory let you play with the capabilities of the participant role

    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_participant' )
            $caps = custom_capabilities( $role );
         return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )  {
        switch ( $role )
        { 
            /* Capabilities for 'participant' role */
            case 'bbp_participant':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => false,
                    'throttle'              => false,
                    'view_trash'            => false,
     
                    // Forum caps
                    'publish_forums'        => false,
                    'edit_forums'           => false,
                    'edit_others_forums'    => false,
                    'delete_forums'         => false,
                    'delete_others_forums'  => false,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => false,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => false,
                    'delete_topics'         => false,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => false,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => false,
                    'edit_topic_tags'       => false,
                    'delete_topic_tags'     => false,
                    'assign_topic_tags'     => true,
                );
     
               
     
                break;
     
            default :
                return $role;
        }
    }

    @robin-w

    Moderator

    ps

    I just cribbed this code from elsewhere, so the capabilities may not be the participant ones, you’ll need to check what they should be

    bbPress User Roles and Capabilities

    @evanevans333

    Participant

    Well I still appreciate you sending over the code. I will fiddle with it, and see where it gets me. Thanks so much. AND I will report back findings, in case it does solve something, so that others will see at least one solution. Thanks!

    @robin-w

    Moderator

    great – please do come back – this can be resolved one way or another !

    @evanevans333

    Participant

    Didn’t work. No change in behavior (no cache running, no plugin conflicts). Maybe it should be if $role == ‘Participant’ instead of ‘bbp_participant’? Or perhaps ‘Participate’?

    Am I supposed to put all this in the functions.php of my child theme? That’s where I put it.

    @robin-w

    Moderator

    ok – thanks for that

    Having re-read your thread then I think what you want is:

    User : Participant
    Forum : Private
    Should be able to read, publish toics and create replies

    which is what bbpress does as default.

    Can you confirm that this is what you want, and what is not happening, and if so can you let us know

    what theme you are using
    what plugins you are using

    @evanevans333

    Participant

    Also I downloaded and installed this plugin:

    https://github.com/johnjamesjacoby/bbp-capabilities

    and was able to “successfully” modify a user’s permissions to include the Read Private Topics and Replies, but even though in the user’s profile it showed up as modified, it also had no effect.

    @evanevans333

    Participant

    Oh no kidding. Well yeah that makes sense right? On my install, even with all plugins off (except bbpress), the user Participant does not get Read Private Topics and Replies perms. Yes, I can confirm that.

    I am using the Thrive Community theme by Dunkahkdis, and he said that was not happening inside his Theme and to come over to bbPress and ask in here. He’s not irresponsible either. He’s an amazing coder, and excellent with tech support. But, you never know. You never know.

    So, just for clarity. You are saying, outright, that the Participant Role by default in bbPress is supposed to HAVE the caps: Read Private Topics and Replies
    ?

    @evanevans333

    Participant

    I don’t think so. According to this, those caps are not listed for Participant:

    bbPress User Roles and Capabilities

    But it makes sense they should be part of Participant caps right? I’m not insane? 🙂

    @robin-w

    Moderator

    we’re probably both insane !

    It worked on my test site, but then I do have a lot cooking on there.

    back to my code above, can you try

    case bbp_get_participant_role() :

    in place of the line

    case 'bbp_participant':

    @robin-w

    Moderator

    I’ve just been digging further into the code

    There is a filter on topics and replies which looks at posts with a private status, but topics and replies on a private forum don’t have that status UNLESS it is manually set on the admin backend (or imported with that status). So in the normal process they are viewable unless set by a moderator/admin to private within the backend.

    So a standard participant should be able to see all topics and replies.

    For creating topics and replies the code just looks at ‘publish topics’ and ‘publish replies’ so allows registered users to do this for both public and private forums.

    This would then make great sense for then original poster who had imported the forum, so topics and replies were likely to have a post status of private so not viewable by participants.

    I don’t know if that helps you understand your circumstances, but hope it explains it better.

    @evanevans333

    Participant

    Also keep in mind there is a tool in TOOLS for FORUMS which allows you to repair “private and hidden forums”, which as I understand it, just makes sure the currently set privacy settings properly are assigned and propagated down through child topics and replies for forums. In my practice, that is what it does. So, as a triple check, I also run that when troubleshooting, as a part of the granular process of debugging this.

    That said, the above substitution you suggested, did not show anything different. That’s not to say we aren’t making progress! Any further ideas?

    @evanevans333

    Participant

    I don’t know if I gave you this link before, but it does shed some light on to the reasoning of this “issue” and maybe that will help you know better how to circumvent/modify it to the way we’re looking for:

    Roles and Capabilities in bbPress 2.2

    @evanevans333

    Participant

    I came across this in a thread.
    https://wordpress.org/support/topic/not-working-for-bbpress-rolesWould that be somehow useful? Probably not.

    /**
     * FORUM - Role map
     * bbPress has its own internal ("dynamic") Roles, so we map our real wp roles to bbPress.
     */
    add_filter('bbp_get_user_role_map','my_bbPress_role_map');
    function my_bbPress_role_map($role_map){
    	$role_map['student'] = bbp_get_participant_role();
    	return $role_map;
    }

    @robin-w

    Moderator

    so can you confirm that your topics are set to private?

    dashboard>topics>any topic>edit and see its published status

    and that you suspect (know?) that this is because of ‘repair forums’?

    @robin-w

    Moderator

    ok, I just did the following test.

    Forum private, topic public
    participant can read

    Forum private, topic private
    participant cannot read

    The following code then added :

    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )  {
        switch ( $role )
        { 
            /* Capabilities for 'participant' role */
            case bbp_get_participant_role() :
                return array(
                    // Primary caps
    				// Primary caps
    				'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => false,
                    'throttle'              => false,
                    'view_trash'            => false,
     
                    // Forum caps
                    'publish_forums'        => false,
                    'edit_forums'           => false,
                    'edit_others_forums'    => false,
                    'delete_forums'         => false,
                    'delete_others_forums'  => false,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => false,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => false,
                    'delete_topics'         => false,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => false,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => false,
                    'edit_topic_tags'       => false,
                    'delete_topic_tags'     => false,
                    'assign_topic_tags'     => true,
                );
     
               
     
                break;
     
            default :
                return $role;
        }
    }
    

    Forum private, topic private
    participant can read !

    So the code works on my test site.

    Can you duplicate this and come back with results?

    @evanevans333

    Participant

    I got the white screen of death with that code. The following error message:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘add_role_caps_filter’ not found or invalid function name in /home3/filmsco/public_html/testwebsite/wp-includes/plugin.php on line 235

    Had to add this to the top from your prior code:

    function add_role_caps_filter( $caps, $role )
    {
    /* Only filter for roles we are interested in! */
    if( $role == ‘bbp_participant’ )
    $caps = custom_capabilities( $role );
    return $caps;
    }

    P.S. Is this new code any different than the last code?

    @evanevans333

    Participant

    Okay, results are:

    A Private Forum with 4 topics and 2 replies is viewable, but those topics and their replies remain unvisible to someone with the role Participant.

    Furthermore:
    The topics in there, are actually set to “Visibility: Public”. Doing a repair: “Relationships to Repair: Recalculate the parent topic for each post, Recalculate the parent forum for each post, Recalculate private and hidden forums” now, and the results are:
    “Recalculating the topic for each post … Complete!
    Recalculating the forum for each post … Complete!
    Recalculating forum visibility … Complete!”

    And the visibility of that same post is still set to “Visibility: Public”

    And a Participant still cannot view anything inside that Private Forum.

    @robin-w

    Moderator

    sorry at this point I am backing out.

    Just spending too much time on this and sorry I’ve run out of options – clearly something is wrong.

Viewing 25 replies - 1 through 25 (of 40 total)
  • You must be logged in to reply to this topic.
Skip to toolbar