[buddypress-trac] [BuddyPress Trac] #7608: Use BP_Groups_Group visibility and access properties.
buddypress-trac
noreply at wordpress.org
Tue Mar 6 19:12:48 UTC 2018
#7608: Use BP_Groups_Group visibility and access properties.
-------------------------+-----------------------
Reporter: dcavins | Owner: djpaul
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.0
Component: Groups | Version: 2.9.0
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+-----------------------
Comment (by dcavins):
@r-a-y
Thanks for your comments. I see what you mean-- the function
`bp_group_is_visible()` wasn't actually checking visibility, it was
checking to see if the user had access. Here's a list of places in BP
where we use `bp_group_is_visible()` to enable access to something:
• `groups_action_group_feed()`: to display the feed or not (items posted
to private groups are sensitive to the current user anyway, now)
• `bp-legacy/buddypress/groups/single/cover-image-header.php` and `bp-
legacy/buddypress/groups/single/group-header.php`: Whether to display
Admin and Moderator lists
• `bp-legacy/buddypress/groups/single/home.php`: Whether to load the
`bp_groups_front_template_part()`
• `bp-nouveau/buddypress/groups/single/parts/header-item-actions.php`:
Whether to display Admin and Moderator lists
• `bp_nouveau_group_template_part()`: Whether to display group no-access
message.
Bummer. I suppose we should revert it, but can we, instead of putting the
old logic back directly, have it wrap a call to `bp_current_user_can(
'groups_access_group' )`, and also add a comment about how the name got
out of sync with the actual property it's checking. Also, before nouveau
is released into the wild, can we just replace those checks with calls to
the `access_group` check?
I'll attach a patch that includes the above.
Thanks again for catching this misunderstanding on my part.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7608#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list