From nobody Sat Apr 20 11:04:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15222018198251013.9931640943518; Tue, 27 Mar 2018 18:50:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE540C0587C9; Wed, 28 Mar 2018 01:50:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1D616B8E6; Wed, 28 Mar 2018 01:50:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C3718181BA06; Wed, 28 Mar 2018 01:50:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2S1oIYE020785 for ; Tue, 27 Mar 2018 21:50:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 26BAD10AF9CB; Wed, 28 Mar 2018 01:50:18 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-34.pek2.redhat.com [10.72.12.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35FA510AF9D0 for ; Wed, 28 Mar 2018 01:50:16 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Mar 2018 09:50:07 +0800 Message-Id: <20180328015008.8991-2-famz@redhat.com> In-Reply-To: <20180328015008.8991-1-famz@redhat.com> References: <20180328015008.8991-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH v2 1/2] Revert "unify permissions for project properties" X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 28 Mar 2018 01:50:18 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This reverts commit d023d5e60a0a15f6f81835f85c9233a96a87ef00. The commit made project properties invisible to non-priviledged users including importers, who need the information for doing project updates. Signed-off-by: Fam Zheng --- api/views.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/api/views.py b/api/views.py index 2d84be8..c27cd5a 100644 --- a/api/views.py +++ b/api/views.py @@ -73,22 +73,21 @@ class VersionView(APIView): def handle(self, request): return settings.VERSION =20 +def prepare_project(p): + ret =3D { + "name": p.name, + "mailing_list": p.mailing_list, + "url": p.url, + "git": p.git, + "description": p.description, + "properties": p.get_properties(), + } + return ret + class ListProjectView(APIView): name =3D "get-projects" =20 def handle(self, request, name=3DNone): - def prepare_project(p): - ret =3D { - "name": p.name, - "mailing_list": p.mailing_list, - "url": p.url, - "git": p.git, - "description": p.description, - } - if p.maintained_by(request.user): - ret["properties"] =3D p.get_properties() - return ret - r =3D [prepare_project(x) for x in Project.objects.all() \ if name =3D=3D None or name =3D=3D x.name] return r @@ -106,7 +105,7 @@ class AddProjectView(APILoginRequiredView): description=3Ddescription) p.save() =20 -class GetProjectPropertiesView(APIView): +class GetProjectPropertiesView(APILoginRequiredView): name =3D "get-project-properties" =20 def handle(self, request, project): --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel