Module: ForestLiana::Ability::Fetch

Included in:
Permission
Defined in:
app/services/forest_liana/ability/fetch.rb

Instance Method Summary collapse

Instance Method Details

#get_permissions(route) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/services/forest_liana/ability/fetch.rb', line 4

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