src/access.py
changeset 39 f5055ce263c7
parent 33 18e93dbdaf12
child 41 de0c61b778fa
equal deleted inserted replaced
38:f1ee930c4ba8 39:f5055ce263c7
    19     '''acl checker.'''
    19     '''acl checker.'''
    20 
    20 
    21     def __init__(self, ui, repo):
    21     def __init__(self, ui, repo):
    22         self.ui = ui
    22         self.ui = ui
    23         self.repo = repo
    23         self.repo = repo
    24         self.rules = ruleset.Ruleset.readfile(os.environ['HG_ACCESS_RULES_FILE'])
    24         
       
    25         self.rules = ruleset.rules_from_env()
    25         self.rules.set(user = os.environ['REMOTE_USER'])
    26         self.rules.set(user = os.environ['REMOTE_USER'])
    26         self.rules.set(repo = os.environ['HG_REPO_PATH'])
    27         self.rules.set(repo = os.environ['HG_REPO_PATH'])
    27 
    28 
    28     def allow(self, node):
    29     def allow(self, node):
    29         '''return if access allowed, raise exception if not.'''
    30         '''return if access allowed, raise exception if not.'''