incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [10/23] git commit: [#6460] Get root_project of artifact
Date Wed, 31 Jul 2013 19:14:30 GMT
[#6460] Get root_project of artifact

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/cj/6461
Commit: 625bf2ec9dfe3765d7d8813324b8a61986aba51f
Parents: 4b2d8c1
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Wed Jul 31 14:18:47 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Wed Jul 31 14:18:47 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/security.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/625bf2ec/Allura/allura/lib/security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/security.py b/Allura/allura/lib/security.py
index a39e68d..a0497ca 100644
--- a/Allura/allura/lib/security.py
+++ b/Allura/allura/lib/security.py
@@ -287,9 +287,8 @@ def has_access(obj, permission, user=None, project=None):
                 elif isinstance(obj, M.Project):
                     project = obj.root_project
                 else:
-                    project = getattr(obj, 'project', None)
-                    if project is None:
-                        project = c.project.root_project
+                    project = getattr(obj, 'project', None) or c.project
+                    project = project.root_project
             roles = cred.user_roles(user_id=user._id, project_id=project._id).reaching_ids
         chainable_roles = []
         for rid in roles:


Mime
View raw message