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

feat(teams): endpoint to update membership roles #1142

Merged
merged 12 commits into from
May 14, 2021

Conversation

christyjacob4
Copy link
Member

@christyjacob4 christyjacob4 commented May 12, 2021

What does this PR do?

Adds a new endpoint PATCH '/v1/teams/:teamId/memberships/:membershipId' to allow users to modify roles previously granted to team members.

Also created a new event to trigger in this case teams.memberships.update

Test Plan

Added new tests

Related PRs and Issues

NA

Have you read the Contributing Guidelines on issues?

Yes

@christyjacob4 christyjacob4 changed the title Feat add update membership endpoint Feat add update membership roles endpoint May 12, 2021
@christyjacob4 christyjacob4 changed the title Feat add update membership roles endpoint feat(teams): update membership roles endpoint May 12, 2021
@christyjacob4 christyjacob4 marked this pull request as ready for review May 12, 2021 17:02
@christyjacob4 christyjacob4 changed the title feat(teams): update membership roles endpoint feat(teams): endpoint to update membership roles May 12, 2021
app/controllers/api/teams.php Outdated Show resolved Hide resolved
app/controllers/api/teams.php Outdated Show resolved Hide resolved
Copy link
Contributor

@TorstenDittmann TorstenDittmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure a team doesn't become ownerless.

Meaning, it shouldn't be possible to be the last owner and remove the owner role from yourself.

@eldadfux
Copy link
Member

We should make sure a team doesn't become ownerless.

Meaning, it shouldn't be possible to be the last owner and remove the owner role from yourself.

I think I would leave this to be handled on client and not force a specific flow. Even when we create teams from the console they start without any members. Using the servers SDKs you can manipulate the team membership or even use cloud functions to delete orphaned teams.

@TorstenDittmann
Copy link
Contributor

We should make sure a team doesn't become ownerless.
Meaning, it shouldn't be possible to be the last owner and remove the owner role from yourself.

I think I would leave this to be handled on client and not force a specific flow. Even when we create teams from the console they start without any members. Using the servers SDKs you can manipulate the team membership or even use cloud functions to delete orphaned teams.

Fair point 👍🏻

Copy link
Member

@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor change.

app/controllers/api/teams.php Outdated Show resolved Hide resolved
@eldadfux eldadfux merged commit dc00346 into 0.8.x May 14, 2021
@eldadfux eldadfux deleted the feat-add-update-membership-endpoint branch May 15, 2021 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants