You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/04/16 17:43:54 UTC
[04/22] allura git commit: [#7865] add docstrings and pass user param
through
[#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/99ed9568
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/99ed9568
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/99ed9568
Branch: refs/heads/ib/6017
Commit: 99ed9568fd8c94bddaba0c1e6b589fa9b503b7a8
Parents: 7ee7734
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Apr 2 17:59:38 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Fri Apr 3 15:43:49 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/99ed9568/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: