Move the check for the team edit permission to the team model