# -*- coding: utf-8 -*- #TODO : move the globals to a config file (use the config file parser module) PERM_LIST=['READ','MODIFY','APPEND'] #just add a string here to define a new permission PERMS = len(PERM_LIST) MAX = (1< MAX) or (init < 0) : raise PermissionError('Permission int not in correct range') result = [] for shift in range(PERMS-1,-1,-1) : if init>>shift : result.append(PERM_LIST[shift]) init = init-(1<