Extend Buddypress Group Forums Capabilities
|Reported by:||aaclayton||Owned by:|
|Cc:||mercijavier@…, jmdodd@…, 3ruce|
Buddypress group members are temporarily granted the capability to read and publish in their own hidden group forums using the function map_topic_meta_caps() in /includes/extend/buddypress/group.php line 179.
This function only runs if the following conditions hold:
if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'forum' ) || ! bp_is_action_variable( 0, 'topic' ) )
This results in some circumstances in which a group member doesn't have adequate capability to participate in group forums whenever the action variable is not 'topic'. For example, when using a group forums template with a new topic form below the topics-loop, regular group members will lack the capabilities to create a topic.
Is it necessary to require that the action_variable be 'topic' in order to grant permissions? I think switching group member capabilities would be useful everywhere within the bp_is_current_action( 'forum' ) sub-component.
Unless I'm missing a key reason not to do this, I would recommend conditioning the capability switch only on:
if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'forum' ) )
Change History (14)
- Resolution fixed deleted
- Status changed from closed to reopened