You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2018/01/26 19:55:06 UTC

allura git commit: Commits can be related artifacts but they aren't actually artifacts so don't have permissions

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 <da...@brondsema.net>
Authored: Fri Jan 26 14:33:34 2018 -0500
Committer: Dave Brondsema <da...@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: