You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/04/02 23:59:52 UTC

allura git commit: [#7865] add docstrings and pass user param through

Repository: allura
Updated Branches:
  refs/heads/db/7865 6ff843e2c -> 2caa5ffd1


[#7865] add docstrings and pass user param through


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

Branch: refs/heads/db/7865
Commit: 2caa5ffd1b50ccb331e10fe11088d48bb71c6811
Parents: 6ff843e
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Apr 2 17:59:38 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Thu Apr 2 17:59:38 2015 -0400

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/2caa5ffd/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 96c9358..8083e17 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -823,19 +823,25 @@ class MergeRequest(VersionedArtifact, ActivityObject):
         return result
 
     def merge_allowed(self, user):
+        """
+        Returns true if a merge is allowed by system and tool configuration.
+        """
         if not c.app.forkable:
             return False
         if self.status != 'open':
             return False
         if asbool(tg.config.get('scm.merge.{}.disabled'.format(self.app.config.tool_name))):
             return False
-        if not h.has_access(c.app, 'write'):
+        if not h.has_access(c.app, 'write', user):
             return False
         if self.app.config.options.get('merge_disabled'):
             return False
         return True
 
     def can_merge(self):
+        """
+        Returns true if you can merge cleanly (no conflicts)
+        """
         if not self.app.forkable:
             return False
         try: