src/ruleset.py
changeset 45 59dee3c04279
parent 39 f5055ce263c7
child 48 f0cb7ad9e4ab
equal deleted inserted replaced
44:cf851f3ddf16 45:59dee3c04279
    50     '''Class representing the rules in a rule file'''
    50     '''Class representing the rules in a rule file'''
    51     
    51     
    52     levels = ["init", "write", "read", "deny"]
    52     levels = ["init", "write", "read", "deny"]
    53 
    53 
    54     def __init__(self):
    54     def __init__(self):
    55         # The user called "root" automatically has the highest
       
    56         # privilege
       
    57         self.rules = [(self.levels[0], rule([('user', 'root')]))]
       
    58         self.preset = {}
    55         self.preset = {}
    59 
    56 
    60     def add(self, action, conditions):
    57     def add(self, action, conditions):
    61         self.rules.append((action, conditions))
    58         self.rules.append((action, conditions))
    62 
    59