allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject allura git commit: Commits can be related artifacts but they aren't actually artifacts so don't have permissions
Date Fri, 26 Jan 2018 19:55:06 GMT
Repository: allura
Updated Branches:
  refs/heads/master f5443b8aa -> 272893aff


Commits can be related artifacts but they aren't actually artifacts so don't have permissions


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/272893af
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/272893af
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/272893af

Branch: refs/heads/master
Commit: 272893aff6888c7cb256164f7db27532449418a7
Parents: f5443b8
Author: Dave Brondsema <dave@brondsema.net>
Authored: Fri Jan 26 14:33:34 2018 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jan 26 14:33:34 2018 -0500

----------------------------------------------------------------------
 Allura/allura/model/artifact.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/272893af/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 0f80a90..30836f1 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -177,8 +177,14 @@ class Artifact(MappedClass, SearchIndexable):
             # don't link to artifacts in deleted tools
             if hasattr(artifact, 'app_config') and artifact.app_config is None:
                 continue
-            if user and not h.has_access(artifact, 'read', user):
-                continue
+            try:
+                if user and not h.has_access(artifact, 'read', user):
+                    continue
+            except Exception:
+                log.debug('Error doing permission check on related artifacts of {}, '
+                          'probably because the "artifact" is a Commit not a real artifact'.format(self.index_id()),
+                          exc_info=True)
+
             # TODO: This should be refactored. We shouldn't be checking
             # artifact type strings in platform code.
             if artifact.type_s == 'Commit' and not artifact.repo:


Mime
View raw message