#NEWLINE# def authorized( self , allowed_roles , resource , method ) : #NEWLINE# #INDENT# ' Validates the the current request is allowed to pass through.\n\n        :param allowed_roles: allowed roles for the current request, can be a\n                              string or a list of roles.\n        :param resource: resource being requested.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# token = request . headers . get ( 'Authorization' ) . split ( ' ' ) [ 1 ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# token = None #NEWLINE# #UNINDENT# return self . check_auth ( token , allowed_roles , resource , method )