def update_index(self):
<EOL>idx = {}<EOL>for _, p in sorted(self.permissions.items(), key=lambda x: str(x[<NUM_LIT:0>])):<EOL><INDENT>branch = idx<EOL>parent_p = const.PERM_DENY<EOL>for k in p.namespace.keys:<EOL><INDENT>if not k in branch:<EOL><INDENT>branch[k] = {"<STR_LIT>": parent_p}<EOL>branch[k].update(__implicit=True)<EOL><DEDENT>branch = branch[k]<EOL>parent_p = branch["<STR_LIT>"]<EOL><DEDENT>branch["<STR_LIT>"] = p.value<EOL>branch["<STR_LIT>"] = False<EOL><DEDENT>self.index = idx<EOL>ramap = {}<EOL>def update_ramap(branch_idx):<EOL><INDENT>r = {"<STR_LIT>": False}<EOL>for k, v in list(branch_idx.items()):<EOL><INDENT>if k != "<STR_LIT>" and k != "<STR_LIT>":<EOL><INDENT>r[k] = update_ramap(v)<EOL><DEDENT><DEDENT>if branch_idx["<STR_LIT>"] is not None and (branch_idx["<STR_LIT>"] & const.PERM_READ) != <NUM_LIT:0>:<EOL><INDENT>r["<STR_LIT>"] = True<EOL><DEDENT>return r<EOL><DEDENT>for k, v in list(idx.items()):<EOL><INDENT>ramap[k] = update_ramap(v)<EOL><DEDENT>self.read_access_map = ramap<EOL>return self.index<EOL>
Regenerates the permission index for this set

Called everytime a rule is added / removed / modified in
the set