27 |
27 |
28 def allow(self, node): |
28 def allow(self, node): |
29 '''return if access allowed, raise exception if not.''' |
29 '''return if access allowed, raise exception if not.''' |
30 ctx = self.repo.changectx(node) |
30 ctx = self.repo.changectx(node) |
31 branch = ctx.branch() |
31 branch = ctx.branch() |
32 if not self.rules.allow("write", branch=self.branch, file=None): |
32 if not self.rules.allow("write", branch=branch, file=None): |
33 self.ui.debug(_('%s: user %s not allowed on branch %s\n') % |
33 self.ui.debug(_('%s: user %s not allowed on branch %s\n') % |
34 (__name__, self.user, branch)) |
34 (__name__, self.user, branch)) |
35 return False |
35 return False |
36 for f in ctx.files(): |
36 for f in ctx.files(): |
37 if not self.rules.allow("write", branch=self.branch, file=f): |
37 if not self.rules.allow("write", branch=branch, file=f): |
38 self.ui.debug(_('%s: user %s not allowed on %s\n') % |
38 self.ui.debug(_('%s: user %s not allowed on %s\n') % |
39 (__name__, self.user, f)) |
39 (__name__, self.user, f)) |
40 return False |
40 return False |
41 self.ui.debug(_('%s: allowing changeset %s\n') % (__name__, short(node))) |
41 self.ui.debug(_('%s: allowing changeset %s\n') % (__name__, short(node))) |
42 return True |
42 return True |