ForestAdmin/forest-rails

View on GitHub
app/services/forest_liana/ability/fetch.rb

Summary

Maintainability
A
0 mins
Test Coverage
module ForestLiana
  module Ability
    module Fetch
      def get_permissions(route)
        response = ForestLiana::ForestApiRequester.get(route)

        if response.is_a?(Net::HTTPOK)
          JSON.parse(response.body)
        else
          raise ForestLiana::Errors::HTTP403Error.new("Permission could not be retrieved")
        end
      end
    end
  end
end