<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put(self, user_name: str) -> User: """ Updates the User Resource with the name. """

        current = current_user()
        if current.name == user_name or current.is_admin:
            user = self._get_or_abort(user_name)
            self.update(user)
            session.commit()
            session.add(user)
            return user
        else:
            abort(403)