#NEWLINE# def validate_realms( self , client_key , token , request , uri = None , realms = None ) : #NEWLINE# #INDENT# 'Check if the token has permission on those realms.' #NEWLINE# log . debug ( 'Validate realms %r for %r' , realms , client_key ) #NEWLINE# if request . access_token : #NEWLINE# #INDENT# tok = request . access_token #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tok = self . _tokengetter ( client_key = client_key , token = token ) #NEWLINE# request . access_token = tok #NEWLINE# #UNINDENT# if ( not tok ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return set ( tok . realms ) . issuperset ( set ( realms ) )