def resolve_user_restricted_access(document, resource):
 resource_def = app.config['DOMAIN'][resource]
 auth = resource_def['authentication']
 auth_field = resource_def['auth_field']
 if (auth and auth_field):
  request_auth_value = auth.get_request_auth_value()
  if request_auth_value:
   document[auth_field] = request_auth_value

def resolve_user_restricted_access ( document , resource ) : resource_def = app . config [ 'DOMAIN' ] [ resource ] auth = resource_def [ 'authentication' ] auth_field = resource_def [ 'auth_field' ] if ( auth and auth_field ) : request_auth_value = auth . get_request_auth_value ( ) if request_auth_value : document [ auth_field ] = request_auth_value
adds user restricted access medadata to the document if applicable .