def update_membership(self, user, **kwargs):
from canvasapi.user import User<EOL>user_id = obj_or_id(user, "<STR_LIT:user>", (User,))<EOL>response = self._requester.request(<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(self.id, user_id),<EOL>_kwargs=combine_kwargs(**kwargs)<EOL>)<EOL>return GroupMembership(self._requester, response.json())<EOL>
Accept a membership request, or add/remove moderator rights.

:calls: `PUT /api/v1/groups/:group_id/users/:user_id \
<https://canvas.instructure.com/doc/api/groups.html#method.group_memberships.update>`_

:param user: The object or ID of the user.
:type user: :class:`canvasapi.user.User` or int

:rtype: :class:`canvasapi.group.GroupMembership`