[buddypress-trac] [BuddyPress] #4785: Decouple "visibility" and "access" properties

buddypress-trac noreply at wordpress.org
Mon Jan 6 18:20:22 UTC 2014


#4785: Decouple "visibility" and "access" properties
-------------------------+-----------------------------
 Reporter:  smninja      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Groups       |     Version:  1.7
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+-----------------------------

Comment (by dcavins):

 I ran into this problem and would like to propose a stopgap so that plugin
 authors can create publicly visible tabs in a private group. (In my case,
 I'm adding a publicly visible blog to a private workgroup so they can
 share some of their work.) I'll attach a patch that adds a filter in the
 group access control logic of `bp-groups-loader`. The plugin author can
 then filter the visibility:

 {{{
 add_filter( 'bp_groups_access_exemption',
 'filter_group_plugin_pane_access', 20 );
 function filter_group_plugin_pane_access( $setting ) {
         if ( bp_is_current_action('my-plugin-slug') ) {
                 return true;
         } else {
                 return $setting;
         }
 }
 }}}

 The danger is that if the plugin author messes up the filter, all private
 items will be visible. There's probably a better way to do this in the
 long run, but this works on my test setup. I'm also attaching a second
 patch that I think is easier to read and uses the same filter for `home`
 and `request-membership`.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4785#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list