Sha256: 646f7e8616b73746cd2547a8c408c84b26ddf31108f344acd2483a37e5de763c

Contents?: true

Size: 844 Bytes

Versions: 80

Compression:

Stored size: 844 Bytes

Contents

module ForestLiana
  class PermissionsGetter
    def initialize(rendering_id)
      @route = "/liana/v2/permissions"
      @rendering_id = rendering_id
    end

    def perform
      begin
        query_parameters = { 'renderingId' => @rendering_id }
        response = ForestLiana::ForestApiRequester.get(@route, query: query_parameters)

        if response.is_a?(Net::HTTPOK)
          JSON.parse(response.body)
        else
          raise "Forest API returned an #{ForestLiana::Errors::HTTPErrorHelper.format(response)}"
        end
      rescue => exception
        FOREST_LOGGER.error 'Cannot retrieve the permissions from the Forest server.'
        FOREST_LOGGER.error 'Which was caused by:'
        ForestLiana::Errors::ExceptionHelper.recursively_print(exception, margin: ' ', is_error: true)
        nil
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
forest_liana-6.0.0.pre.beta.2 app/services/forest_liana/permissions_getter.rb
forest_liana-6.0.0.pre.beta.1 app/services/forest_liana/permissions_getter.rb
forest_liana-5.3.3 app/services/forest_liana/permissions_getter.rb
forest_liana-5.3.2 app/services/forest_liana/permissions_getter.rb
forest_liana-5.3.1 app/services/forest_liana/permissions_getter.rb
forest_liana-5.3.0 app/services/forest_liana/permissions_getter.rb
forest_liana-5.2.3 app/services/forest_liana/permissions_getter.rb
forest_liana-5.2.2 app/services/forest_liana/permissions_getter.rb
forest_liana-5.2.1 app/services/forest_liana/permissions_getter.rb
forest_liana-5.2.0 app/services/forest_liana/permissions_getter.rb
forest_liana-5.1.3 app/services/forest_liana/permissions_getter.rb
forest_liana-5.1.2 app/services/forest_liana/permissions_getter.rb
forest_liana-5.1.1 app/services/forest_liana/permissions_getter.rb
forest_liana-5.1.0 app/services/forest_liana/permissions_getter.rb
forest_liana-5.0.0 app/services/forest_liana/permissions_getter.rb
forest_liana-5.0.0.pre.beta.0 app/services/forest_liana/permissions_getter.rb
forest_liana-4.2.0 app/services/forest_liana/permissions_getter.rb
forest_liana-4.1.3 app/services/forest_liana/permissions_getter.rb
forest_liana-4.1.2 app/services/forest_liana/permissions_getter.rb
forest_liana-4.1.1 app/services/forest_liana/permissions_getter.rb