doorkeeper_for:all# Require access token for all actionsdoorkeeper_for:all,except::index# All actions except indexdoorkeeper_for:index,:show# Only for index and show actiondoorkeeper_for:create,:scopes=>[:write]#Only for create action and writable
# get or create an client with OAuth2defdoorkeeper_oauth_client@client||=OAuth2::Client.new(DOORKEEPER_APP_ID,DOORKEEPER_APP_SECRET,:site=>DOORKEEPER_APP_URL)end# get or create an AccessTokendefdoorkeeper_access_token@token||=OAuth2::AccessToken.new(doorkeeper_oauth_client,current_user.doorkeeper_access_token)ifcurrent_userend