[elbe-devel] [PATCH 03/12] pylint esoap: instead of disabling unused-argument, check access

Torben Hohn torben.hohn at linutronix.de
Thu Sep 26 15:33:23 CEST 2019


the uid parameter is added for a reason. It should be validated,
whether the user is allowed to open the project.

remove the erratic pylint directives, and use open_project() to check
access rights.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/daemons/soap/esoap.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index 9f79b3e74..0f11a1f15 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -161,7 +161,8 @@ class ESoap (ServiceBase):
     @authenticated_uid
     @soap_faults
     def get_file(self, uid, builddir, filename, part):
-        # pylint: disable=unused-argument
+        self.app.pm.open_project(uid, builddir)
+
         size = 1024 * 1024 * 5
         pos = size * part
         file_name = builddir + "/" + filename
@@ -340,7 +341,7 @@ class ESoap (ServiceBase):
     @authenticated_uid
     @soap_faults
     def reset_project(self, uid, builddir):
-        # pylint: disable=unused-argument
+        self.app.pm.open_project(uid, builddir)
         self.app.pm.db.reset_project(builddir, True)
 
     @rpc(String)
@@ -395,7 +396,7 @@ class ESoap (ServiceBase):
     @authenticated_uid
     @soap_faults
     def list_packages(self, uid, builddir):
-        # pylint: disable=unused-argument
+        self.app.pm.open_project(uid, builddir)
         s = ''
         for _, _, filenames in os.walk(
                 os.path.join(builddir, "repo/pool/main")):
-- 
2.20.1




More information about the elbe-devel mailing list