[buddypress-trac] [BuddyPress Trac] #8734: Introduce simple "Private Site" toggle

buddypress-trac noreply at wordpress.org
Mon Oct 10 14:21:46 UTC 2022


#8734: Introduce simple "Private Site" toggle
-----------------------------+-----------------------
 Reporter:  dcavins          |       Owner:  (none)
     Type:  feature request  |      Status:  assigned
 Priority:  normal           |   Milestone:  11.0.0
Component:  Core             |     Version:  10.4.0
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |
-----------------------------+-----------------------

Comment (by dcavins):

 I like the idea of the `bp_read` capability. To make it easier to tune the
 behevior of (in plugins or other code), what if we add a `context`
 parameter to it so that you know which capability is being tested. Like
 `current_user_can( 'bp_read', array( 'context' =>
 'bp_rest_members_get_items_permissions_check' ) )`
 or maybe

 {{{
 current_user_can( 'bp_read', array(
         'context' => array(
                 'primary' => 'bp_rest',
                 'secondary' => 'members_get_items_permissions_check'
         )
 )
 }}}
 so that you could easily generally allow or deny `bp_rest` for instance.
 or maybe the component is the key.
 {{{
 current_user_can( 'bp_read', array(
         'context' => array(
                 'component' => 'members',
                 'interface' => 'bp_rest',
                 'capability' => 'members_get_items_permissions_check'
         )
 )
 }}}

 I'm not sure what properties to send, but having a central, easy-to-
 control logic for this would be useful.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8734#comment:25>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list