#NEWLINE# def allow( self , role , operation , resource , assertion = None ) : #NEWLINE# #INDENT# 'Add a allowed rule.\n\n        The added rule will allow the role and its all children roles to\n        operate the resource.\n        ' #NEWLINE# assert ( ( not role ) or ( role in self . _roles ) ) #NEWLINE# assert ( ( not resource ) or ( resource in self . _resources ) ) #NEWLINE# self . _allowed [ ( role , operation , resource ) ] = assertion #NEWLINE# for r in itertools . chain ( [ role ] , get_family ( self . _children , role ) ) : #NEWLINE# #INDENT# self . _denial_only_roles . discard ( r )