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

buddypress-trac noreply at wordpress.org
Thu Jan 24 17:13:11 UTC 2013


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

Comment (by smninja):

 There is confusion with the definition of "private" in the scope of Group
 vs. a Tab within the group. Yes, I am suggesting an enhancement to link or
 extend the Group's definition of private / access with that of a tab
 within the group.

 The initial idea would be to allow extensions to set an "access" variable
 that correlates with Group status (private, public, hidden). Perhaps you
 have a better solution.

 That said, I've included a test case below to further illustrate my
 request.


 '''Description of Issue'''

 Tab with $visibility variable marked as "public" fires
 'bp_core_no_access()' if group is private.

 '''Expected Behavior'''

 If Tab is marked as "public", I would expect it to be publicly visible,
 even if group is marked "private".

 '''Actual Behavior'''

 User is shown an error message. Guest is redirected.

 '''Test case:'''

 1. Activate the test plugin below
 2. Mark a group as "private"
 3. Navigate to the slug of the tab, i.e.
 http://mywebsite.com/groups/mygroup/test

 {{{
 <?php
 /**
 Plugin Name: BuddyPress Groups Test Tab
 Description: Test case for demonstrating inaccessibility to a tab marked
 public when group is private.
 Version: 0.6
 Author: Tyler Mulligan
 **/

 function bptt_init() {

     class Groups_Test_Tab extends BP_Group_Extension {

         var $visibility = 'public'; // 'public' will show your extension
 to non-group members, 'private' means you have to be a member of the group
 to view your extension.

         var $enable_create_step = false; // If your extension does not
 need a creation step, set this to false
         var $enable_nav_item = true; // If your extension does not need a
 navigation item, set this to false
         var $enable_edit_item = true; // If your extension does not need
 an edit screen, set this to false

         function Groups_Test_Tab() {
             $this->name = "Test";
             $this->slug = "test";
             $this->create_step_position = 21;
             $this->nav_item_position = 31;
         }

         function display() {
             echo "test";
         }

         function edit_screen() {
             echo "test";
         }
     }

     bp_register_group_extension( 'Groups_Test_Tab' );

 }

 add_action( 'bp_include', 'bptt_init' );

 ?>
 }}}

 Thank you for taking the time to look into this.

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


More information about the buddypress-trac mailing list