Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the view context to let regular users join a public group #209

Merged
merged 1 commit into from Aug 8, 2019

Conversation

@imath
Copy link
Contributor

commented Aug 7, 2019

  1. Use groups_join_group() into the view context of BP_REST_Group_Membership_Endpoint->create_item(). The existing code to add a user to a group has been restricted to site administrators.
  2. Adapt unit tests and add one to test the edit context for Administrators.
  3. Make sure the user trying to join a public group is not already a member and has not been banned from the group.
  4. Improve BP_REST_Members_Endpoint->user_data() to accept a context argument so that using the edit context will retrieve caps, roles etc..
  5. Add an Info block to the documentation of the route to inform how to make a logged in user join a public group.

NB: this PR is applying the decision we took during the August 7th dev chat.

Use the view context to let regular users join a public group
1. Use `groups_join_group()` into the `view` context of `BP_REST_Group_Membership_Endpoint->create_item()`. The existing code to add a user to a group has been restricted to site administrators.
2. Adapt unit tests and add one to test the `edit` context for Administrators.
3. Make sure the user trying to join a public group is not already a member and has not been banned from the group.
4. Improve `BP_REST_Members_Endpoint->user_data()` to accept a context argument so that using the edit context will retrieve caps, roles etc..
5. Add an [Info block to the documentation](https://imath-buddydocs.pf1.wpserveur.net/bp-rest-api/reference/user-groups/group-membership/#add-a-specific-member-into-a-group) of the route to inform how to make a logged in user join a public group.

NB: this PR is applying the decision we took during the August 7th dev chat.

@imath imath added this to the before-bp-merge milestone Aug 7, 2019

@imath imath requested a review from renatonascalves Aug 7, 2019

@renatonascalves
Copy link
Member

left a comment

Looking good!

@renatonascalves renatonascalves merged commit e8da8b2 into buddypress:master Aug 8, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@imath imath deleted the imath:add/groups-join-group branch Aug 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.