equal
deleted
inserted
replaced
21 |
21 |
22 def __init__(self, ui, repo): |
22 def __init__(self, ui, repo): |
23 self.ui = ui |
23 self.ui = ui |
24 self.repo = repo |
24 self.repo = repo |
25 |
25 |
26 self.rules = ruleset.rules_from_env() |
|
27 self.rules.set(user = os.environ['REMOTE_USER']) |
|
28 self.rules.set(repo = os.environ['HG_REPO_PATH']) |
|
29 |
|
30 def allow(self, ctx): |
26 def allow(self, ctx): |
31 branch = ctx.branch() |
27 branch = ctx.branch() |
32 if not self.rules.allow("write", branch=branch, file=None): |
28 if not ruleset.rules.allow("write", branch=branch, file=None): |
33 return False |
29 return False |
34 for f in ctx.files(): |
30 for f in ctx.files(): |
35 if not self.rules.allow("write", branch=branch, file=f): |
31 if not ruleset.rules.allow("write", branch=branch, file=f): |
36 return False |
32 return False |
37 return True |
33 return True |
38 |
34 |
39 def check(self, ctx): |
35 def check(self, ctx): |
40 '''return if access allowed, raise exception if not.''' |
36 '''return if access allowed, raise exception if not.''' |