#NEWLINE# def has_permission( self , mask , permission ) : #NEWLINE# #INDENT# if ( permission is None ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# for pattern in self . masks : #NEWLINE# #INDENT# if fnmatch . fnmatch ( mask , pattern ) : #NEWLINE# #INDENT# if ( not isinstance ( self . masks , dict ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# perms = self . masks [ pattern ] #NEWLINE# if ( ( permission in perms ) or ( 'all_permissions' in perms ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return False