aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStevan Radaković <stevan.radakovic@linaro.org>2013-05-22 21:52:08 +0200
committerStevan Radaković <stevan.radakovic@linaro.org>2013-05-22 21:52:08 +0200
commit0ad26a2c58828eb43be297231d415f18b9fcaede (patch)
tree2287cc178c670edeec0c702687c65b6efb623a49
parente21273711be4ca563e4fd9580bfcc108b4cb5b16 (diff)
Add ACL support for private repositories for git ssh protocol.private_repo_system_acl
-rw-r--r--rhodecode/model/repo.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py
index f7b7b976..e03bb6b6 100644
--- a/rhodecode/model/repo.py
+++ b/rhodecode/model/repo.py
@@ -332,6 +332,12 @@ class RepoModel(BaseModel):
SystemCommand.change_ownership(cur_repo.repo_name,
new_system_name)
+ repo_path = os.path.join(self.repos_path, cur_repo.repo_name)
+ if not cur_repo.private:
+ os.chmod(repo_path, 02775)
+ else:
+ os.chmod(repo_path, 02770)
+
if org_repo_name != new_name:
# rename repository
self.__rename_repo(old=org_repo_name, new=new_name)
@@ -715,7 +721,10 @@ class RepoModel(BaseModel):
# Old value here was 0775. We need directory to be sgid, in order to
# correctly work with git-shell. Value is calculated with values from
# the python stat library.
- os.chmod(repo_path, 02775)
+ if not repo.private:
+ os.chmod(repo_path, 02775)
+ else:
+ os.chmod(repo_path, 02770)
SystemCommand.change_ownership("%s%s%s" % (new_parent_path,
self.URL_SEPARATOR,
repo_name),