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